From 6930f964c50363f3ca127b9fac526ab70f11316a Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Sun, 5 Jan 2025 16:48:22 -0500 Subject: [PATCH] feat(commands/voice): add playing --- commands/utils.py | 1 + commands/voice.py | 16 ++++++++++++++++ core.py | 2 ++ 3 files changed, 19 insertions(+) diff --git a/commands/utils.py b/commands/utils.py index 4e5ab7e..9a7dc25 100644 --- a/commands/utils.py +++ b/commands/utils.py @@ -11,6 +11,7 @@ class Command(enum.Enum): LEAVE = "leave" PAUSE = "pause" PLAY = "play" + PLAYING = "playing" PURGE = "purge" QUEUE = "queue" RELOAD = "reload" diff --git a/commands/voice.py b/commands/voice.py index 336897c..1e18f8e 100644 --- a/commands/voice.py +++ b/commands/voice.py @@ -199,6 +199,22 @@ async def queue_or_play(message): ) +async def playing(message): + if not command_allowed(message): + return + + if message.guild.voice_client.source: + await utils.reply( + message, + f"{'(paused) ' if message.guild.voice_client.is_paused() else ''} {players[message.guild.id].current.format(show_queuer=True)}", + ) + else: + await utils.reply( + message, + "nothing is playing!", + ) + + async def skip(message): if not command_allowed(message): return diff --git a/core.py b/core.py index 1bf0a09..5d714f0 100644 --- a/core.py +++ b/core.py @@ -116,6 +116,8 @@ async def on_message(message): await commands.bot.help(message) case C.UPTIME: await commands.bot.uptime(message) + case C.PLAYING: + await commands.voice.playing(message) except Exception as e: await utils.reply( message,