From 662f25fab88ba15f205de3662b70b826a7c39673 Mon Sep 17 00:00:00 2001 From: insert Date: Thu, 18 Jul 2024 07:59:24 -0400 Subject: [PATCH] fix queue being too long and other random issues --- bot.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index ee963b3..616c5f3 100644 --- a/bot.py +++ b/bot.py @@ -89,13 +89,12 @@ async def play(inter: disnake.AppCmdInter, link: str): ) async def shuffleplay(inter: disnake.AppCmdInter, toggle: str = commands.Param(choices=["on", "off"])): await inter.response.defer(ephemeral=True) + global shuffle if toggle == "on": - global shuffle shuffle = True await inter.edit_original_response(f"shuffle enabled") return else: - global shuffle shuffle = False await inter.edit_original_response(f"shuffle disabled") return @@ -114,7 +113,7 @@ async def getqueue(inter: disnake.AppCmdInter): message = message + f"Now playing: <{item}>\n" continue message = message + f"{idx}. <{item}>\n" - await inter.edit_original_response(message) + await inter.edit_original_response(message[:2000]) #its possible for the queue to be longer then discords max allowed @bot.slash_command( name="toggleplayback", @@ -134,7 +133,7 @@ async def toggleplayback(inter: disnake.AppCmdInter): description="skips the current video DON'T SKIP LESS THAN 18 SECONDS INTO A VIDEO", ) async def skip(inter: disnake.AppCmdInter): - await inter.response.defer(ephemeral=True) + await inter.response.defer(ephemeral=False) global queuetask queuetask.cancel() try: @@ -146,7 +145,7 @@ async def skip(inter: disnake.AppCmdInter): driver.fullscreen_window() else: queuetask = asyncio.create_task(queuehandler()) - await inter.edit_original_response("skipepd") + await inter.edit_original_response("skipped") @bot.slash_command( name="remove",