diff options
author | 2020-08-25 19:13:01 +0100 | |
---|---|---|
committer | 2020-08-25 19:13:01 +0100 | |
commit | 8fc408a14da5c65fb7760c65faba53728ba8c7c0 (patch) | |
tree | d9eb594d26f053afe2058a20f16a293377c9702b | |
parent | Update in channel check to equality (diff) |
Move command invoke to before checking if we can process a user
-rw-r--r-- | metricity/bot.py | 7 |
1 files 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.""" |