From b0a885fca19249d78d7bc0d8a81e1973a357925f Mon Sep 17 00:00:00 2001 From: ekzyis Date: Sat, 25 Sep 2021 20:30:38 +0200 Subject: [PATCH] Add skip command --- src/bot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bot.py b/src/bot.py index 79dc9c0..1440562 100644 --- a/src/bot.py +++ b/src/bot.py @@ -76,6 +76,13 @@ class Music(commands.Cog): if ctx.voice_client.is_playing(): await ctx.send(f"Queued: {title}") + @commands.command() + async def skip(self, ctx): + async with ctx.typing(): + if not ctx.voice_client.is_playing(): + raise commands.CommandError("Cannot skip: No song playing") + ctx.voice_client.stop() + @commands.command() async def stop(self, ctx): await ctx.voice_client.disconnect()