Update text and comment filter.
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 6m9s

This commit is contained in:
retoor 2025-01-05 22:54:06 +00:00
parent 7c6331a4ed
commit aedf6757f6

View File

@ -24,7 +24,7 @@ class Bot:
"no-spam4": "Vira", "no-spam4": "Vira",
} }
self.name = self.names.get(self.name, self.username.split("@")[0]) 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.auth = None
self.triggers = [ self.triggers = [
"$", "$",
@ -116,6 +116,9 @@ class Bot:
rant = self.api.get_rant(rant_id) rant = self.api.get_rant(rant_id)
for comment in rant.get("comments", []): for comment in rant.get("comments", []):
print("Checking if sus comment: ", comment["body"]) 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", "")): if self.is_sus_content(comment.get("body", "")):
return True return True
return False return False