mirror of
https://github.com/UiO-Gaming/ShiteMusicBot.git
synced 2026-11-05 13:56:51 +01:00
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:
2 files changed
+7
-4
No files matched your search
@@ -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")
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user