Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #219 from GrafeasGroup/214-transcription-with-fuck
Browse files Browse the repository at this point in the history
Do transcription reply detection before 'fuck' detection
  • Loading branch information
TheLonelyGhost committed Jun 11, 2021
2 parents d2bb0f4 + 37ee2fe commit 662235c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tor/core/inbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ def process_reply(reply: Comment, cfg: Config) -> None:
flair = None
r_body = reply.body.lower() # cache that thing

if matches := [match.group() for match in [regex.search(reply.body) for regex in MOD_SUPPORT_PHRASES] if match]:
if 'image transcription' in r_body or validation.contains_footer(reply, cfg):
message = _(i18n['responses']['general']['transcript_on_tor_post'])
elif matches := [match.group() for match in [regex.search(reply.body) for regex in MOD_SUPPORT_PHRASES] if match]:
phrases = '"' + '", "'.join(matches) + '"'
send_to_modchat(
":rotating_light::rotating_light: Mod Intervention Needed "
":rotating_light::rotating_light: "
f'\n\nDetected use of {phrases} {reply.submission.shortlink}',
cfg
)
elif 'image transcription' in r_body or validation.contains_footer(reply, cfg):
message = _(i18n['responses']['general']['transcript_on_tor_post'])
elif 'thank' in r_body: # trigger on "thanks" and "thank you"
thumbs_up_gifs = i18n['urls']['thumbs_up_gifs']
youre_welcome = i18n['responses']['general']['youre_welcome']
Expand Down

0 comments on commit 662235c

Please sign in to comment.