Merge pull request #61 from r-Norge/feature/fix_on_voice_state_update

Fix bug when using force disconnect would cause exception
This commit is contained in:
Ev-1 authored and GitHub committed 2022-10-13 20:56:38 +02:00
commit 71c45ff037
2 files changed
+7 -4

No files matched your search

+6 -3
View File
@@ -7,10 +7,13 @@ from musicbot.cogs.music.music_errors import MusicError
class BasicVoiceClient(discord.VoiceClient):
def __init__(self, client: MusicBot, channel: discord.VoiceChannel):
self.music_bot = client
# Needs to be named client in order for base class to work
# in most cases lavalink handles disconnects, but if we force it then we'll get an error.
# during self.cleanup()
self.client = client
self.channel = channel
if self.music_bot.lavalink:
self.lavalink = self.music_bot.lavalink
if self.client.lavalink:
self.lavalink = self.client.lavalink
else:
raise MusicError("client did not have defined lavalink before connect")
+1 -1
View File
@@ -105,7 +105,7 @@ class Scroller:
await self.scrolling_done.wait()
return self.message
def update_view_on_interaction(self, interaction: discord.Interaction):
def update_view_on_interaction(self, _: discord.Interaction):
self.update_view()
def update_view(self):