I’ve been asked to create a queue system/command for a channel, even though on the forums we have a couple queue systems available, through for example the creative usage of the quote system, I thought this would be a fun little project to play around with various stuff, Nightbot headers, Nightbot API, OAuth.
The code behind the system is available at: https://github.com/xgerhard/nbqueue
If you have improvements or issues feel free to post them there, or let me know in the comments here.
A basic queue system for Nightbot. The usage is pretty straight forward,
!leave for users to enter or leave the queue, the user can check their position in the queue with
!position. Moderators can
!close the queue and pick a user from the queue with
The command supports multiple queues, but there can only be one active. Only the active channel is joinable. Moderators can manage queues by using
!add $queueName or
!del $queueName, to switch to a different queue use
!set $queueName. To empty the queue a moderator can use
!clear, or remove one user by using
!remove $id, where $id is the ID of the user in that specific queue (this ID can be found by using
- join $message - Joines the current queue with optional message “$message”, this message is displayed when the user will be picked from the queue
- leave - Leaves the current queue
- position - Displays the position from the user in the current active queue
- list - Displays a link to a webpage with the full list of users in the queue
- info - Displays the current queue information, if the queue is open and how many people are in it
- open - Opens the current queue
- close - Closes the current queue
- next $x - Picks and removes the first $x users from the queue, the $x is optional
- clear - Clears the current queue
- add $name - Creates a new queue with the name $name
- del $name - Deletes the queue with name $name (the default queue can’t be deleted)
- set $name - Will set the queue with name $name as active queue.
- remove $id - Will remove the user with id $id from the queue
- userlevel $userlevel - Will set the userlevel of current active queue, so you can create for example sub only queues. Available userlevels: moderator, vip, regular, subscriber, everyone.
- ul $userlevel - Short version of the userlevel command
Sign in with Nightbot here, the installer will add the selected commands to Nightbot: https://2g.be/twitch/nbqueue/public/install/auto
Update, December 8, userlevel option added
This will give you the option to set your current queue open for a specific group of users.
The userlevel is option is available directly from the !q command, for example:
!q userlevel subscriber.
If you want a separate !userlevel command, it is now included in the automatic installation. If you have installed before this date you can add the command yourself:
!commands add !userlevel -a=!q userlevel $(query)