diff --git a/payphone/bot.py b/payphone/bot.py index 73e91a9..a8813a2 100644 --- a/payphone/bot.py +++ b/payphone/bot.py @@ -124,8 +124,15 @@ class Payphone(commands.AutoShardedBot): print(f"Shard {shard_id} was resumed!") - async def on_shard_disconnect(shard_id: int) -> None: - self.update_heartbeat.cancel() + 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