From 971a500ae69e116351b745bccab9a3d9ef01d7f0 Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 17 Dec 2024 18:02:38 +0100 Subject: [PATCH] Sus algorithm. --- src/ragnar/bot.py | 6 ++---- src/ragnar/cli.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ragnar/bot.py b/src/ragnar/bot.py index 9759393..0227401 100644 --- a/src/ragnar/bot.py +++ b/src/ragnar/bot.py @@ -142,7 +142,7 @@ class Bot: log.info("Comments of rant are sus + user sus. Will flag as spam.") elif rant["user_username"] in self.sus_users: - pass + pass elif not self.is_sus_rant(rant["id"], rant["text"]): log.info( "{}: Rant by {} is not sus.".format( @@ -150,9 +150,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( self.name, rant["user_username"] diff --git a/src/ragnar/cli.py b/src/ragnar/cli.py index b6a805c..c40b2d2 100644 --- a/src/ragnar/cli.py +++ b/src/ragnar/cli.py @@ -55,7 +55,7 @@ def main(): "JamesMedina", ] - with Executor(len(usernames) + 1) as executor: + with Executor(len(usernames)) as executor: for username in usernames: executor.submit(bot_task, f"{username}@molodetz.nl", args.password) executor.shutdown(wait=True)