Add song to front of queue #98
Replies: 3 comments
-
I'd like this feature to be implemented directly in the module too! This is currently how I handle play-top commands, kinda similar to yours, it isn't very elegant and there might be a slight chance it'll cause some bugs. Yeah it's just like putting some duct tape on a broken thing lol await distube.play(message, query);
const { songs } = distube.getQueue(message.guild.id);
songs.splice(1, 0, songs.pop()); |
Beta Was this translation helpful? Give feedback.
-
Actually, you don't need to edit |
Beta Was this translation helpful? Give feedback.
-
yeah i tried doing this, but i think i somehow fucked it up and also skipped the currently playing song lmao
Yes, this is a much cleaner approach than mine (and i might steal it ...)
DisTube is a real fantastic library(?) and i think it is its strongest side that it is simple to hook up to a bot, while exposing the underlying code Compared to me making a bot from scratch, i got a working discord bot within a fraction of the time needed In my experience it also works flawlessly with discord.js-commando, although some clunkyness which i think is unavoidable I will be closing this issue since it has been resolved :) |
Beta Was this translation helpful? Give feedback.
-
Currently if you want a play() that adds to the front of the queue you'll need to either edit the library directly or "hook it"
Ive been doing this to replace the functions to add a variable for play() to append to front:
(note the extra function arguments)
so i can then do this:
I think a more native approach instead of editing and hooking will be better
Beta Was this translation helpful? Give feedback.
All reactions