From 042f8b9ec6ef57304e816a318512b5ce1c3e7bd2 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 8 Nov 2019 16:40:33 +0100 Subject: [PATCH] Possible skip fix --- royalnet/bots/discord.py | 1 + royalnet/packs/royal/commands/skip.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/royalnet/bots/discord.py b/royalnet/bots/discord.py index e9cdcb7e..1fc21de2 100644 --- a/royalnet/bots/discord.py +++ b/royalnet/bots/discord.py @@ -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)) diff --git a/royalnet/packs/royal/commands/skip.py b/royalnet/packs/royal/commands/skip.py index 222486e7..48e2a4ed 100644 --- a/royalnet/packs/royal/commands/skip.py +++ b/royalnet/packs/royal/commands/skip.py @@ -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()