mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Possible skip fix
This commit is contained in:
parent
324df8287d
commit
042f8b9ec6
2 changed files with 2 additions and 1 deletions
|
@ -242,6 +242,7 @@ class DiscordBot(GenericBot):
|
||||||
def advance(error=None):
|
def advance(error=None):
|
||||||
if error:
|
if error:
|
||||||
voice_client.disconnect(force=True)
|
voice_client.disconnect(force=True)
|
||||||
|
guild_music_data.voice_client = None
|
||||||
log.error(f"Error while advancing music_data: {error}")
|
log.error(f"Error while advancing music_data: {error}")
|
||||||
return
|
return
|
||||||
self.loop.create_task(self.advance_music_data(guild))
|
self.loop.create_task(self.advance_music_data(guild))
|
||||||
|
|
|
@ -27,7 +27,7 @@ class SkipCommand(Command):
|
||||||
guild = list(bot.client.guilds)[0]
|
guild = list(bot.client.guilds)[0]
|
||||||
# Set the currently playing source as ended
|
# Set the currently playing source as ended
|
||||||
voice_client: discord.VoiceClient = bot.client.find_voice_client_by_guild(guild)
|
voice_client: discord.VoiceClient = bot.client.find_voice_client_by_guild(guild)
|
||||||
if not (voice_client.is_playing() or voice_client.is_paused()):
|
if voice_client and not (voice_client.is_playing() or voice_client.is_paused()):
|
||||||
raise CommandError("Nothing to skip")
|
raise CommandError("Nothing to skip")
|
||||||
# noinspection PyProtectedMember
|
# noinspection PyProtectedMember
|
||||||
voice_client._player.stop()
|
voice_client._player.stop()
|
||||||
|
|
Loading…
Reference in a new issue