diff --git a/bot/handlers/comments.py b/bot/handlers/comments.py index 94bc16923..be638c21d 100644 --- a/bot/handlers/comments.py +++ b/bot/handlers/comments.py @@ -16,6 +16,7 @@ log = logging.getLogger(__name__) MIN_COMMENT_LEN = 40 +SKIP_COMMANDS = ("/skip", "#skip", "#ignore") def comment(update: Update, context: CallbackContext) -> None: @@ -72,6 +73,10 @@ def reply_to_comment(update: Update, context: CallbackContext) -> None: ) return None + for skip_word in SKIP_COMMANDS: + if skip_word in text: + return None + # max 3 levels of comments are allowed reply_to_id = comment.id if comment.reply_to_id and comment.reply_to.reply_to_id: @@ -136,7 +141,7 @@ def comment_to_post(update: Update, context: CallbackContext) -> None: ) return None - for skip_word in ("/skip","#skip","#ignore"): + for skip_word in SKIP_COMMANDS: if skip_word in text: return None