From fe8bcd0568f6e677277c5e3bb352729fd93db0ae Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 3 Oct 2019 14:52:47 +0200 Subject: [PATCH] Handle discord commands asyncronously --- royalnet/bots/discord.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/royalnet/bots/discord.py b/royalnet/bots/discord.py index f158b0cc..36a8fb66 100644 --- a/royalnet/bots/discord.py +++ b/royalnet/bots/discord.py @@ -85,8 +85,10 @@ class DiscordBot(GenericBot): log.debug(f"Creating music_data for {channel.guild}") self.music_data[channel.guild] = playmodes.Playlist() - @staticmethod - async def on_message(message: discord.Message): + async def on_message(cli, message: discord.Message): + self.loop.create_task(self._handle_message(message)) + + async def _handle_message(cli, message: discord.Message): text = message.content # Skip non-text messages if not text: