1
Fork 0
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:
Steffo 2019-11-08 16:40:33 +01:00
parent 324df8287d
commit 042f8b9ec6
2 changed files with 2 additions and 1 deletions

View file

@ -242,6 +242,7 @@ class DiscordBot(GenericBot):
def advance(error=None):
if error:
voice_client.disconnect(force=True)
guild_music_data.voice_client = None
log.error(f"Error while advancing music_data: {error}")
return
self.loop.create_task(self.advance_music_data(guild))

View file

@ -27,7 +27,7 @@ class SkipCommand(Command):
guild = list(bot.client.guilds)[0]
# Set the currently playing source as ended
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")
# noinspection PyProtectedMember
voice_client._player.stop()