Fixed caching bug.
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 1m24s
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 1m24s
This commit is contained in:
parent
75f6ee13c5
commit
c4d44e741a
@ -126,12 +126,13 @@ class Bot:
|
||||
if rant["id"] in self.rant_history:
|
||||
log.debug("{}: Already checked rant {}.".format(self.name, rant["id"]))
|
||||
continue
|
||||
else:
|
||||
self.rant_history.append(rant["id"])
|
||||
|
||||
|
||||
if not self.is_user_sus(rant["user_username"]):
|
||||
log.info(
|
||||
"{}: User {} is trusted.".format(self.name, rant["user_username"])
|
||||
)
|
||||
self.rant_history.append(rant["id"])
|
||||
continue
|
||||
elif self.is_comments_sus(rant["id"]):
|
||||
|
||||
@ -144,6 +145,7 @@ class Bot:
|
||||
)
|
||||
continue
|
||||
if self.is_flagged_as_sus(rant["id"], rant.get("num_comments")):
|
||||
self.rant_history.append(rant["id"])
|
||||
continue
|
||||
log.warning(
|
||||
"{}: Rant is not {} flagged as sus yet.".format(
|
||||
@ -157,7 +159,8 @@ class Bot:
|
||||
)
|
||||
self.mark_as_sus(rant)
|
||||
self.down_vote_rant(rant)
|
||||
|
||||
self.rant_history.append(rant["id"])
|
||||
|
||||
def down_vote_rant(self, rant):
|
||||
log.warning("Downvoting rant by {}.".format(rant["user_username"]))
|
||||
log.debug(json.loads(self.api.post_rant_vote(rant["id"], -1)))
|
||||
|
Loading…
Reference in New Issue
Block a user