diff --git a/bot.py b/bot.py index 0cb7636..0b936b4 100644 --- a/bot.py +++ b/bot.py @@ -52,6 +52,11 @@ client = discord.Client(intents=intents) block_id = ["1000000000000003", "1000000000000004"] #fuck these two in particular +moralfag_id = "1000000000000002" +moralfag_counter = 0 +moralfag_skip = False +faglimit = 3 #ignore every x reply + last_server_message = 0.0 # unix timestamp of last message anyone sent in the server dm_sent = False interaction_count = 0 @@ -383,6 +388,12 @@ async def on_message(message): if replied_to_bot: mentioned = True + if str(message.author.id) == moralfag_id: + global moralfag_skip, moralfag_counter + if moralfag_skip: + moralfag_skip = False + return + if not mentioned and random.random() > 0.05: #5% chance of replying if not mentiond return @@ -404,6 +415,11 @@ async def on_message(message): await message.reply(result) print(f"[{timestamp()}] {message.author} said: {content}\n[{timestamp()}] Faggot-chan said: {result}") log_message(f"[{timestamp()}] {message.author} said: {content}\n[{timestamp()}] Faggot-chan said: {result}") + if str(message.author.id) == moralfag_id: + moralfag_counter += 1 + if moralfag_counter >= faglimit: + moralfag_skip = True + moralfag_counter = 0 except Exception as e: await handle_error(f"[{timestamp()}] failed to send reply: {e}", notify_channel=message.channel)