From 8fc408a14da5c65fb7760c65faba53728ba8c7c0 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Tue, 25 Aug 2020 19:13:01 +0100 Subject: Move command invoke to before checking if we can process a user --- metricity/bot.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/metricity/bot.py b/metricity/bot.py index 476404e..b2a54ff 100644 --- a/metricity/bot.py +++ b/metricity/bot.py @@ -222,6 +222,9 @@ async def on_member_update(_before: Member, member: Member) -> None: @bot.event async def on_message(message: DiscordMessage) -> None: """Add a message to the table when one is sent providing the author has accepted.""" + if message.channel.id == BotConfig.bot_commands_channel: + await bot.process_commands(message) + if not message.guild: return @@ -248,10 +251,6 @@ async def on_message(message: DiscordMessage) -> None: created_at=message.created_at ) - if message.channel.id == BotConfig.bot_commands_channel: - await bot.process_commands(message) - - @bot.command() async def opt_in(ctx: Context) -> None: """Opt-in to the server analytics system.""" -- cgit v1.2.3