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:
parent
4f82985f1e
commit
fe8bcd0568
1 changed files with 4 additions and 2 deletions
|
@ -85,8 +85,10 @@ class DiscordBot(GenericBot):
|
||||||
log.debug(f"Creating music_data for {channel.guild}")
|
log.debug(f"Creating music_data for {channel.guild}")
|
||||||
self.music_data[channel.guild] = playmodes.Playlist()
|
self.music_data[channel.guild] = playmodes.Playlist()
|
||||||
|
|
||||||
@staticmethod
|
async def on_message(cli, message: discord.Message):
|
||||||
async def on_message(message: discord.Message):
|
self.loop.create_task(self._handle_message(message))
|
||||||
|
|
||||||
|
async def _handle_message(cli, message: discord.Message):
|
||||||
text = message.content
|
text = message.content
|
||||||
# Skip non-text messages
|
# Skip non-text messages
|
||||||
if not text:
|
if not text:
|
||||||
|
|
Loading…
Reference in a new issue