Fix help status not visible on all shards

This commit is contained in:
Noi 2021-04-22 13:01:23 -07:00
parent 5e59acbacf
commit 1cb159c64b

View file

@ -16,9 +16,9 @@ class WorldTime(discord.AutoShardedClient):
self.commands = WtCommands(self.userdb, self) self.commands = WtCommands(self.userdb, self)
self.bg_task = self.loop.create_task(self.periodic_report()) self.bg_task = self.loop.create_task(self.periodic_report())
async def on_ready(self): async def on_shard_connect(self, sid):
logPrint('Status', 'Connected as {0} ({1})'.format(self.user.name, self.user.id)) logPrint('Status', 'Shard {2} connected as {0} ({1})'.format(self.user.name, self.user.id, sid))
await self.change_presence(activity=discord.Game("tz.help")) await self.change_presence(activity=discord.Game("tz.help"), shard_id=sid)
async def on_message(self, message): async def on_message(self, message):
# ignore bots (should therefore also ignore self) # ignore bots (should therefore also ignore self)