From 3a78548159a3013cbdce87cb38feb3ce8eef98b4 Mon Sep 17 00:00:00 2001 From: YakMM Date: Sun, 14 Nov 2021 23:20:37 +0100 Subject: [PATCH] main.py fix --- bot/main.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bot/main.py b/bot/main.py index cfc0a37..812b70c 100644 --- a/bot/main.py +++ b/bot/main.py @@ -119,11 +119,6 @@ async def on_command_error(ctx, error): await disp.UNKNOWN_ERROR.send(ctx, type(original).__name__) raise error - # Reaction update handler (for rule acceptance) - @client.event - # Has to be on_raw cause the message already exists when the bot starts - - @client.event async def on_member_join(member): player = Player.get(member.id) @@ -176,10 +171,11 @@ async def on_ready(): # fetch rule message, remove all reaction but the bot's channel = client.get_channel(cfg.channels["rules"]) msg = await channel.fetch_message(channel.last_message_id) - ctx = _interactions_handler.get_new_context(msg) if msg.author.id == client.user.id: + ctx = _interactions_handler.get_new_context(msg) await disp.RULES.edit(ctx) else: + ctx = _interactions_handler.get_new_context(channel) await disp.RULES.send(ctx) # Update all players roles