From d98cd5966ba41cdd602a9455c19d48495ef0495f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 18 Nov 2018 17:45:14 +0100 Subject: [PATCH] Start tasks after bot is ready --- discordbot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discordbot.py b/discordbot.py index 67594819..fd5869ba 100644 --- a/discordbot.py +++ b/discordbot.py @@ -333,10 +333,6 @@ class RoyalDiscordBot(discord.Client): self.radio_messages = True self.next_radio_message_in = int(config["Discord"]["radio_messages_every"]) self.inactivity_timer = 0 - asyncio.ensure_future(self.queue_predownload_videos()) - asyncio.ensure_future(self.queue_play_next_video()) - asyncio.ensure_future(self.inactivity_countdown()) - asyncio.ensure_future(self.activity_task()) async def on_ready(self): # Get the main channel @@ -349,6 +345,10 @@ class RoyalDiscordBot(discord.Client): raise InvalidConfigError("The main guild does not exist!") await self.change_presence(status=discord.Status.online, activity=None) logger.info("Bot is ready!") + asyncio.ensure_future(self.queue_predownload_videos()) + asyncio.ensure_future(self.queue_play_next_video()) + asyncio.ensure_future(self.inactivity_countdown()) + asyncio.ensure_future(self.activity_task()) async def on_message(self, message: discord.Message): if message.channel != self.main_channel or message.author.bot: