diff --git a/payphone/bot.py b/payphone/bot.py index 5e6ed73..5c3e857 100644 --- a/payphone/bot.py +++ b/payphone/bot.py @@ -108,6 +108,16 @@ class Payphone(commands.AutoShardedBot): print(f"Shard {shard_id} was resumed!") + async def on_shard_connect(self, shard_id: int) -> None: + try: + self.update_heartbeat.start() + + except RuntimeError: + pass + + async def on_shard_disconnect(self, shard_id: int) -> None: + self.update_heartbeat.cancel() + async def get_or_fetch_channel( self, channel_id: int ) -> abc.GuildChannel | abc.PrivateChannel | discord.Thread | None: