Added ragnar check.
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 56s

This commit is contained in:
retoor 2024-11-30 18:14:47 +01:00
parent 2f57178a51
commit 0045264250

View File

@ -112,9 +112,8 @@ class Bot:
def is_comments_sus(self, rant_id): def is_comments_sus(self, rant_id):
log.info("Checking if comments are sus of rant {}.".format(rant_id)) log.info("Checking if comments are sus of rant {}.".format(rant_id))
rant = self.api.get_rant(rant_id) rant = self.api.get_rant(rant_id)
if rant.get("num_comments", 0) == 0:
return False
for comment in rant.get("comments", []): for comment in rant.get("comments", []):
print("Checking if sus comment: ", comment['body'])
if self.is_sus_content(comment.get("body", "")): if self.is_sus_content(comment.get("body", "")):
return True return True
return False return False