NightDev Community Forums

[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
  • 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

Installation

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)


List of guesses from users?
I need a queue command
Hope you can help?
Can I do some thing like queue
#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.


#11

is it synonymous in German thanks in advance.


#12

You mean if there is a German version? Currently only English. However you can change the commandcodes manually to German during the installation.


#13

okay thanks i’ll try it


#14

could you please do that for me, I did not know how.


#15

If I now have a Custom Waiting Room, how can I activate it?


#16

You can use this, just replace queuename with the name you gave the room.
!set queuename


#17

okay thanks for the help


#18

When my subs join, the position always states they are all $1 in queue. A way to fix it?


#19

This is fixed, thanks for reporting!


#20

Is it possible to translate the responses of Nightbot ?


#21

Heya, this is currently not possible.


#22

Ich raff das hier nicht mit dem Token, was da so schlimm dran sein soll.

Zwei Stunden meiner Zeit verschwendet um dann zu sagen, komm lass es sein … wäre nice zu haben, aber wenn will ich es schick haben, sodass man den Quote wie folgt hätte mit !addquote - [name] [ID] [Quote] [Game] [Time]