From 2c72163d3cbfd800fcccb79e2514b26eb3890e11 Mon Sep 17 00:00:00 2001 From: retoor Date: Thu, 9 Jan 2025 23:59:56 +0100 Subject: [PATCH] Bots update. --- src/ragnar/bot.py | 7 +++---- src/ragnar/cli.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ragnar/bot.py b/src/ragnar/bot.py index c306e1e..2851622 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, 3)) + time.sleep(random.randint(1, 60)) @method_cache def login(self): @@ -91,7 +91,6 @@ 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", ""): @@ -127,9 +126,9 @@ class Bot: return False def mark_as_sus(self, rant): - self.rsleepii() self.api.post_comment(rant["id"], self.mark_text) - + self.rsleepii() + def fight(self): self.rsleepii() rants = self.api.get_rants("recent", self.amount_of_rants_to_check, 0) diff --git a/src/ragnar/cli.py b/src/ragnar/cli.py index bcc328c..f8c887e 100644 --- a/src/ragnar/cli.py +++ b/src/ragnar/cli.py @@ -31,7 +31,7 @@ def bot_task(username, password): def main(): args = parse_args() - usernames = vic.get_friends() + usernames = vic.get_friends() with Executor(len(usernames)) as executor: for username in usernames: