diff --git a/src/ragnar/bot.py b/src/ragnar/bot.py index 0bf0e29..5ec638d 100644 --- a/src/ragnar/bot.py +++ b/src/ragnar/bot.py @@ -55,7 +55,7 @@ class Bot: self.api = Api(username=self.username, password=self.password) def rsleepii(self): - time.sleep(random.randint(1, 300)) + time.sleep(random.randint(10, 60)) @method_cache def login(self): @@ -91,6 +91,7 @@ class Bot: def is_flagged_as_sus(self, rant_id, num_comments): if not num_comments: return False + self.rsleepii() rant = self.api.get_rant(rant_id) for comment in rant.get("comments", []): if self.names.get(self.username, "") in comment.get("body", ""): @@ -112,6 +113,7 @@ class Bot: def is_comments_sus(self, rant_id): log.info(f"Checking if comments are sus of rant {rant_id}.") + self.rsleepii() rant = self.api.get_rant(rant_id) for comment in rant.get("comments", []): print("Checking if sus comment: ", comment["body"])