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

Implement "playtop" command #10

Closed
aquelemiguel opened this issue Oct 7, 2021 · 7 comments · Fixed by #24
Closed

Implement "playtop" command #10

aquelemiguel opened this issue Oct 7, 2021 · 7 comments · Fixed by #24
Assignees
Labels
✨ feature New feature or request 🐤 good first issue Good for newcomers 🎃 hacktoberfest Suitable for Hacktoberfest

Comments

@aquelemiguel
Copy link
Owner

aquelemiguel commented Oct 7, 2021

Allows for pushing songs to the top of the queue to be played up next.

Usage

  • !playtop <song> pushes a new track to the top of the queue.

Notes

  • If the bot isn't playing anything, the command should push to the first position.
  • However, if it is currently playing, it should place the new track in the queue's second position as the topmost element will be the track that's now playing.
@aquelemiguel aquelemiguel added ✨ feature New feature or request 🐤 good first issue Good for newcomers 🎃 hacktoberfest Suitable for Hacktoberfest labels Oct 7, 2021
@Antonio-Bennett
Copy link
Contributor

Hi! I never worked on a discord bot before so I would love to try and solve this issue :)

@aquelemiguel
Copy link
Owner Author

Hi! I never worked on a discord bot before so I would love to try and solve this issue :)

@Antonio-Bennett Hi, sure! Let me know if you need something. 🚀

@Antonio-Bennett
Copy link
Contributor

@aquelemiguel Hey! I've been trying to solve an issue by myself but I think I should ask for help now 😅
The issue I have is that when we get the handler through handler lock and then the queue, if I modify the queue it is not saved. Is there a method or something I am missing?

@aquelemiguel
Copy link
Owner Author

aquelemiguel commented Oct 13, 2021

@aquelemiguel Hey! I've been trying to solve an issue by myself but I think I should ask for help now 😅
The issue I have is that when we get the handler through handler lock and then the queue, if I modify the queue it is not saved. Is there a method or something I am missing?

@Antonio-Bennett Hi, let's see if I can help. 😉
Are you using the .modify_queue method? Check this example for usage:

queue.modify_queue(|v| { v.drain(1..); });

Note this queue should be of type TrackQueue. If you're trying to modify a vector, I'd guess you used .current_queue. This takes a snapshot of the queue and is uneditable, which could explain why you can't see your queue change.

@Antonio-Bennett
Copy link
Contributor

That is definitely what I'm looking for! Can't believe I missed it 😭 Thanks a lot :)

@Antonio-Bennett
Copy link
Contributor

Hey submitted PR #24 :)

@aquelemiguel
Copy link
Owner Author

Hey submitted PR #24 :)

Awesome, I'll take a look at it and give you feedback ASAP. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature or request 🐤 good first issue Good for newcomers 🎃 hacktoberfest Suitable for Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants