From eb19932d7fa95a889d2896ac12242f7f8f9cb812 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 20 Apr 2019 01:14:52 +0200 Subject: [PATCH] Working skip! Buuuuut now you can't hear anything. --- royalgames.py | 3 +++ royalnet/commands/skip.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/royalgames.py b/royalgames.py index 5a0ed69e..660ad22a 100644 --- a/royalgames.py +++ b/royalgames.py @@ -15,6 +15,9 @@ log = logging.root stream_handler = logging.StreamHandler() stream_handler.formatter = logging.Formatter("{asctime}\t{name}\t{levelname}\t{message}", style="{") log.addHandler(stream_handler) +logging.getLogger("royalnet.audio.royalpcmfile").setLevel(logging.DEBUG) +logging.getLogger("royalnet.audio.royalpcmaudio").setLevel(logging.DEBUG) +logging.getLogger("royalnet.audio.youtubedl").setLevel(logging.DEBUG) logging.getLogger("royalnet.bots.generic").setLevel(logging.DEBUG) logging.getLogger("royalnet.bots.discord").setLevel(logging.DEBUG) logging.getLogger("royalnet.bots.telegram").setLevel(logging.DEBUG) diff --git a/royalnet/commands/skip.py b/royalnet/commands/skip.py index 206f4bd4..7534588a 100644 --- a/royalnet/commands/skip.py +++ b/royalnet/commands/skip.py @@ -20,7 +20,7 @@ class SkipNH(NetworkHandler): async def discord(cls, bot: "DiscordBot", message: SkipMessage): # Find the matching guild if message.guild_name: - guild = bot.client.find_guild(message.guild_name) + guild = bot.client.find_guild_by_name(message.guild_name) else: if len(bot.music_data) != 1: raise TooManyFoundError("Multiple guilds found") @@ -31,6 +31,7 @@ class SkipNH(NetworkHandler): raise NoneFoundError("Nothing to skip") # noinspection PyProtectedMember voice_client._player.stop() + return RequestSuccessful() class SkipCommand(Command): @@ -43,6 +44,6 @@ class SkipCommand(Command): @classmethod async def common(cls, call: Call): - guild = call.args.match(r"(?:\[(.+)])?") + guild, = call.args.match(r"(?:\[(.+)])?") response: RequestSuccessful = await call.net_request(SkipMessage(guild), "discord") await call.reply(f"✅ Richiesta lo skip della canzone attuale..")