Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

play wipes queue #250

Closed
vintium opened this issue Aug 8, 2021 · 1 comment
Closed

play wipes queue #250

vintium opened this issue Aug 8, 2021 · 1 comment

Comments

@vintium
Copy link

vintium commented Aug 8, 2021

I've just started using this bot in my servers and I think it's super powerful and am very happy to have found it. In my testing it out, I found this issue and I was so glad to see that it was open source! Heres the issue:
There's been a couple of times when I wanted to play a song right away, instead of adding it to the queue, so I used $botify play ... to attempt to do this. After doing this, I was a bit bothered to see that my whole queue had been wiped! I understand a full fix to this (preserving the queue and inserting the song at the top) may require the implementation of insertion of songs into the queue, and thus might be part of v2.0. However, this behavior makes the play command a risk; especially if it is used by accident. Until this could be fixed fully, a warning speedbump with this sort of message:

There are multiple songs enqueued. Remove them from the queue and play {song name} ?
(If you would like to instead add {song name} to the queue, use $botify queue {song name}.)

would be helpful.

@vintium vintium changed the title play nukes queue play wipes queue Aug 8, 2021
@robinfriedli
Copy link
Owner

Yes, playing something else replaces the queue. That's not something I ever intend to change as that's how any reasonable music player in the world works ;) However, I do plan on expanding the queue command to allow inserting tracks at a specific position in the queue instead of merely appending tracks to the end of the queue. Then if you want that behavior by default when using the play command you could probably create an interceptor script in botify 2. You can already add a script in botify 2 to optionally enable auto queue behavior, although that would append the tracks to the end of the queue, by doing something like this:

// when executing play command with input while queue is not empty
if (command.getIdentifier().equals('play')
    && !command.getCommandInput().isBlank()
    && !playback.audioQueue.isEmpty()) {
    // run queue command instead
    command.run('queue ' + command.getCommandBody())
    // abort play command
    command.abort()
}

@vintium vintium closed this as completed Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants