Subscribe to redisqueue after the bot is ready

This commit is contained in:
Jeremy Zhang 2019-10-19 13:38:45 -07:00
parent d9b8af9a4c
commit 5c446935bc

View File

@ -66,7 +66,6 @@ class Titan(discord.AutoShardedClient):
async def start(self): async def start(self):
await self.redisqueue.connect() await self.redisqueue.connect()
self.loop.create_task(self.redisqueue.subscribe())
await super().start(config["bot-token"]) await super().start(config["bot-token"])
async def on_ready(self): async def on_ready(self):
@ -77,6 +76,7 @@ class Titan(discord.AutoShardedClient):
print('------') print('------')
print("Shard count: " + str(self.shard_count)) print("Shard count: " + str(self.shard_count))
print("------") print("------")
self.loop.create_task(self.redisqueue.subscribe())
self.discordBotsOrg = DiscordBotsOrg(self.user.id, config.get("discord-bots-org-token", None)) self.discordBotsOrg = DiscordBotsOrg(self.user.id, config.get("discord-bots-org-token", None))
self.botsDiscordPw = BotsDiscordPw(self.user.id, config.get("bots-discord-pw-token", None)) self.botsDiscordPw = BotsDiscordPw(self.user.id, config.get("bots-discord-pw-token", None))