Comment disconnection logic to see if that resolves the issue as it seems the bot will disconnect at times and this logic kills it if it does
This commit is contained in:
@@ -50,11 +50,11 @@ class DiscordBotManager:
|
|||||||
if not self._voice_ready_event.is_set(): self._voice_ready_event.set()
|
if not self._voice_ready_event.is_set(): self._voice_ready_event.set()
|
||||||
elif before.channel is not None and after.channel is None:
|
elif before.channel is not None and after.channel is None:
|
||||||
LOGGER.warning(f"{member.name} left voice channel {before.channel.name}")
|
LOGGER.warning(f"{member.name} left voice channel {before.channel.name}")
|
||||||
guild_id = before.channel.guild.id
|
# guild_id = before.channel.guild.id
|
||||||
if guild_id in self.voice_connections:
|
# if guild_id in self.voice_connections:
|
||||||
LOGGER.warning(f"Bot was disconnected from {guild_id} unexpectedly. Cleaning up...")
|
# LOGGER.warning(f"Bot was disconnected from {guild_id} unexpectedly. Cleaning up...")
|
||||||
await self.leave_voice_channel(guild_id)
|
# await self.leave_voice_channel(guild_id)
|
||||||
self._voice_ready_event.clear()
|
# self._voice_ready_event.clear()
|
||||||
|
|
||||||
@self.bot.event
|
@self.bot.event
|
||||||
async def on_disconnect():
|
async def on_disconnect():
|
||||||
|
|||||||
Reference in New Issue
Block a user