feat(bot): Restart heartbeat on shard reconnect.
This commit is contained in:
+9
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user