fix queue when only one video
This commit is contained in:
parent
c94404fee5
commit
d0b976f784
1 changed files with 12 additions and 3 deletions
15
newbot.py
15
newbot.py
|
@ -311,7 +311,10 @@ async def getqueue(inter: disnake.AppCmdInter):
|
||||||
await inter.edit_original_response("There are no items in queue")
|
await inter.edit_original_response("There are no items in queue")
|
||||||
return
|
return
|
||||||
message = f"Now Playing: <{queue[0]}>\n"
|
message = f"Now Playing: <{queue[0]}>\n"
|
||||||
message = message + f"Up Next: <{queue[1]}>\n"
|
try:
|
||||||
|
message = message + f"Up Next: <{queue[1]}>\n"
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n")
|
message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n")
|
||||||
res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false")
|
res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false")
|
||||||
links = [x[0] for x in res.fetchall()]
|
links = [x[0] for x in res.fetchall()]
|
||||||
|
@ -339,7 +342,10 @@ async def button_listener(inter: disnake.MessageInteraction):
|
||||||
page = page[-1].split(" of ")
|
page = page[-1].split(" of ")
|
||||||
if inter.component.custom_id == "Forward":
|
if inter.component.custom_id == "Forward":
|
||||||
message = f"Now Playing: <{queue[0]}>\n"
|
message = f"Now Playing: <{queue[0]}>\n"
|
||||||
message = message + f"Up Next: <{queue[1]}>\n"
|
try:
|
||||||
|
message = message + f"Up Next: <{queue[1]}>\n"
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n")
|
message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n")
|
||||||
res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false")
|
res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false")
|
||||||
links = [x[0] for x in res.fetchall()]
|
links = [x[0] for x in res.fetchall()]
|
||||||
|
@ -361,7 +367,10 @@ async def button_listener(inter: disnake.MessageInteraction):
|
||||||
return
|
return
|
||||||
if inter.component.custom_id == "Backward":
|
if inter.component.custom_id == "Backward":
|
||||||
message = f"Now Playing: <{queue[0]}>\n"
|
message = f"Now Playing: <{queue[0]}>\n"
|
||||||
message = message + f"Up Next: <{queue[1]}>\n"
|
try:
|
||||||
|
message = message + f"Up Next: <{queue[1]}>\n"
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n")
|
message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n")
|
||||||
res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false")
|
res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false")
|
||||||
links = [x[0] for x in res.fetchall()]
|
links = [x[0] for x in res.fetchall()]
|
||||||
|
|
Loading…
Reference in a new issue