Slowerrr.
All checks were successful
Build Ragnar anti spam bot / Build (push) Successful in 55s

This commit is contained in:
retoor 2025-01-10 01:11:09 +01:00
parent 2ec002135a
commit a7fd05c094

View File

@ -55,7 +55,7 @@ class Bot:
self.api = Api(username=self.username, password=self.password) self.api = Api(username=self.username, password=self.password)
def rsleepii(self): def rsleepii(self):
time.sleep(random.randint(1, 300)) time.sleep(random.randint(10, 60))
@method_cache @method_cache
def login(self): def login(self):
@ -91,6 +91,7 @@ class Bot:
def is_flagged_as_sus(self, rant_id, num_comments): def is_flagged_as_sus(self, rant_id, num_comments):
if not num_comments: if not num_comments:
return False return False
self.rsleepii()
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", []):
if self.names.get(self.username, "") in comment.get("body", ""): if self.names.get(self.username, "") in comment.get("body", ""):
@ -112,6 +113,7 @@ class Bot:
def is_comments_sus(self, rant_id): def is_comments_sus(self, rant_id):
log.info(f"Checking if comments are sus of rant {rant_id}.") log.info(f"Checking if comments are sus of rant {rant_id}.")
self.rsleepii()
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"])