mirror of
https://github.com/weyne85/discord_music_bot.git
synced 2025-10-29 16:58:27 +00:00
Fixing errors when closing the player info and trying to access it again
This commit is contained in:
@@ -342,11 +342,13 @@ class ThreadPlayer(Thread):
|
||||
else:
|
||||
break
|
||||
|
||||
if self.__voiceClient is not None:
|
||||
try:
|
||||
await self.__voiceClient.disconnect(force=True)
|
||||
except Exception as e:
|
||||
print(f'[THREAD PLAYER -> ERROR FORCING DISCONNECT] -> {e}')
|
||||
try:
|
||||
voiceClient = self.__guild.voice_client
|
||||
if voiceClient is not None:
|
||||
await voiceClient.disconnect(force=True)
|
||||
except Exception as e:
|
||||
print(f'[THREAD PLAYER -> ERROR FORCING DISCONNECT] -> {e}')
|
||||
|
||||
self.__voiceClient = await self.__voiceChannel.connect(reconnect=True, timeout=None)
|
||||
return True
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user