[CustomAPI] Queue system


#1

Intro

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.


nbqueue

A basic queue system for Nightbot. The usage is pretty straight forward, !join and !leave for users to enter or leave the queue, the user can check their position in the queue with !position. Moderators can !open or !close the queue and pick a user from the queue with !next.

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 !list).

User commands

  • 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

Moderator commands

  • 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

Installation

Sign in with Nightbot here, the installer will add the selected commands to Nightbot: https://2g.be/twitch/nbqueue/public/install/auto


List of guesses from users?
#4

Hello, I would like to thank you for your work on this. I have implemented this on a channel I mod. The streamer uses restream to stream on Youtube, Twitch, and Mixer. Nightbot is setup on only youtube as that is where the majority of his audience participates. The queue system works great until a Twitch or Mixer user tries to join. Is it possible to have a mod manually insert a username in the list? Sorry if this sounds like a noobish question, but I am a noob at all this lol… Or would it be easy to modify or add any command to allow this?
Thank you again for this queue system you have created.


#5

Heya, thanks! Unfortunately this is not possible at the moment. The system is currently setup that only the user who types the command can join, in the background Nightbot will send that user’s ID which I link to the queue.


#6

Ok, thanks again for your help!


#7

Hey,

i am mod in my friend’s channel and i am having issues using this command… whenever i use any of them commands the nightbot returns me the message “Remote Server Returned Code 500”. Do u know what is happening or what am i doing wrong ?

Thanks in advance.


#8

@Yamihiken Heya, sorry about that, could you try again, the error should be resolved.


#9

Hey, thanks for making the API! Really loving it and making it easier to play with people on Twitch. I have one thing I need to ask, whenever I open up a queue and I type !list, for some reason the list seems to be empty. It just says “Queue: Default Status: Open” but nothing else. I have it on both Youtube and Twitch, is it possible it can’t do both?


#10

Heya! If you click/tap on that sentence “Queue: Default Status: Open” the list of users that are in that queue will show. If you click/tap on it again the list will be hidden again.

It should work for both Youtube and Twitch however they most likely will be treated as seperated channels. So Youtube users can’t join the Twitch queue, and vice versa.