Sanitize mentions for autoreply

This commit is contained in:
Mint 2022-09-10 19:24:49 +03:00
parent 448729bac3
commit 599bbce185

View file

@ -76,6 +76,7 @@ class ReplyBot:
def extract_toot(toot, cfg):
text = utils.extract_post_content(toot)
text = re.sub(r"^@\S+\s", r"", text) # remove the initial mention
toot = toot.replace("@", "@\u200b") # sanitize mentions
text = utils.remove_mentions(cfg, text)
text = text.lower() # treat text as lowercase for easier keyword matching (if this bot uses it)
return text