1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Handle discord commands asyncronously

This commit is contained in:
Steffo 2019-10-03 14:52:47 +02:00
parent 4f82985f1e
commit fe8bcd0568

View file

@ -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: