1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Working skip! Buuuuut now you can't hear anything.

This commit is contained in:
Steffo 2019-04-20 01:14:52 +02:00
parent be2e95030f
commit eb19932d7f
2 changed files with 6 additions and 2 deletions

View file

@ -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)

View file

@ -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..")