From aedf6757f6217b632adea658a63010434344a608 Mon Sep 17 00:00:00 2001 From: retoor Date: Sun, 5 Jan 2025 22:54:06 +0000 Subject: [PATCH] Update text and comment filter. --- src/ragnar/bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ragnar/bot.py b/src/ragnar/bot.py index 074ae93..c4aad8a 100644 --- a/src/ragnar/bot.py +++ b/src/ragnar/bot.py @@ -24,7 +24,7 @@ class Bot: "no-spam4": "Vira", } self.name = self.names.get(self.name, self.username.split("@")[0]) - self.mark_text = f"I am {self.name} and downvoted this post because post is considered spam. Your message will be removed from this community site due too much downvotes. See my profile for more information. Read my source code mentioned on my profile to see what you did wrong. Should be no problem for a developer.\n\nHave a nice day!\n\n\nIf the post is not spam, please mention @retoor in the comments of this rant.\n\n@ other ranters downvoting is not needed anymore. Enough bots. It will be deleted automatically, but can take a while. I configured it to eat less resources of server. Still it's important to mention ragnar if a spam falls trough so it's in the administration." + self.mark_text = f"I am {self.name} and downvoted this post because I consider it spam. Your message will be removed from this community site due too much downvotes. See my profile for more information. Read my source code mentioned on my profile to see what you did wrong. Should be no problem for a developer.\n\nHave a nice day!\n\n\nIf your post is not spam, please mention @retoor." self.auth = None self.triggers = [ "$", @@ -116,6 +116,9 @@ class Bot: rant = self.api.get_rant(rant_id) for comment in rant.get("comments", []): print("Checking if sus comment: ", comment["body"]) + if comment['user_score'] >= 5: + print("User has reputation >= 5 so not sus.") + continue if self.is_sus_content(comment.get("body", "")): return True return False