Queueing System

Hello, I was wondering if there was a way to make a command that you can do !join (name) and then they would be added to a queue. I need this so I can do a queue for people that want to play games with me, and this would help a lot so I don’t have to remember so many people and what position they are in.

Will the names ever contain spaces?

If not, then you can just use these queue commands:
https://community.nightdev.com/t/setting-up-a-list/16981/2?u=am_1
You would just have to change the messages a bit to not mention “courses”.

If they might contain spaces, then you can edit those commands to use a comma as a separator instead of a space.

If you need help changing the commands, let me know.

Thanks but not what im really looking for.

Those commands do exactly what you describe in your first post. The messages are just about “courses” and can be easily changed.

Then how do I set it up with those that u sent

Can you add me On discord so you can show me how to do this, Im a visual learner

Because these commands contain private tokens, you should add them through the Nightbot web interface: https://beta.nightbot.tv/commands/custom.

Go to https://twitch.center/customapi/quote/generate. You will see three lines. Your first token is after token= and before &data= on the first line. Your second token is after token= and before &data= on the second and third lines. Replace FIRSTTOKEN and SECONDTOKEN with these before you add the following commands.

!join
$(eval q=`$(urlfetch json http://twitch.center/customapi/quote/list?token=FIRSTTOKEN&no_id=1)`;u=`$(user)`.split(" ")[0];c=`$(query)`.split(" ")[0];e=false;r=/([^ ]*): [^ ]* /g;while((m=r.exec(q))!==null){if(u.toLowerCase()==m[1].toLowerCase()){e=true}}if(e){"$EXISTS$"}else if(!c){"$NONAME$"}else{"addquote?token=SECONDTOKEN&data="+encodeURIComponent(`${u}: ${c} `)})

!joinadder
$(eval if(`$(urlfetch json http://twitch.center/customapi/$(query))`.startsWith("Successfully added entry ")){`$(user) joined the queue!`}else if(`$(query)`=="$EXISTS$"){`$(user) -> You are already in the queue`}else if(`$(query)`=="$NONAME$"){`$(user) -> Enter your name after !join`}else{`$(user) -> Use !join`})

!next3
$(eval q=`$(urlfetch json http://twitch.center/customapi/quote/list?token=FIRSTTOKEN&no_id=1)`;n3="";i=0;r=/([^ ]*): ([^ ]*) /g;while((m=r.exec(q))!==null&&i<3){n3+=`${m[1]}: ${m[2]} `;i++}i==0?`$(user) -> There are no names in the queue`:`Next ${i==1?"name":i+" names"}: ${n3}`)

!fullqueue
Full queue: http://twitch.center/customapi/quote/list?token=FIRSTTOKEN

!popqueue (userlevel moderator)
$(eval r=`$(urlfetch json http://twitch.center/customapi/delquote?token=SECONDTOKEN&data=1)`;m=r.match(/^Successfully deleted entry #1: (.*)$/);if(m){m[1]}else if(r=="Invalid entry index"){`$(user) -> The queue is empty`}else{`$(user) -> Unknown error (${r})`})

!clearqueue (userlevel moderator)
$(eval q=`$(urlfetch json http://twitch.center/customapi/quote/list?token=FIRSTTOKEN)`;r=`$(urlfetch json http://twitch.center/customapi/delquote?token=SECONDTOKEN&clear=1)`;if(q=="There are no quotes added"){`$(user) -> The queue is already empty`}else if(r=="All entries have been deleted"){"The queue has been cleared"}else{`$(user) -> Unknown error (${r})`})

These commands don’t let people use spaces in the names they type after !join, because it makes the page that !fullqueue links prettier. If you need people to be able to join the queue with names that contains spaces, let me know and I can change the commands.

When I do the join queue command it said I’m in but when I check the viewqueue it says it’s empty

I just tested all the commands and verified that they work. You must not be properly inserting your tokens. Please reread the instructions in the post for inserting the tokens.

I did everything right but for some reason my name is not popping up in the queue list when I try to join

That’s because you aren’t replacing all instances of FIRSTTOKEN and SECONDTOKEN with the appropriate tokens. Reread this post: Queueing System

Ye it’s kinda confusing but ima try to fix it

it wouldn’t let me make a command and I’m also mod

You need to use !commands add or !addcom, or preferably https://beta.nightbot.tv/commands/custom. And you aren’t replacing FIRSTTOKEN and SECONDTOKEN with your tokens.

Are you able to send a photo of what it suppose to look like?






He srry but I’m hella comfused cuz I’m new to these stuff it would be easy if u just paste that so I can copy it

!commands add !join -a=!joinadder $(eval q=`$(urlfetch json http://twitch.center/customapi/quote/list?token=FIRSTTOKEN&no_id=1)`;u=`$(user)`.split(" ")[0];c=`$(query)`.split(" ")[0];e=false;r=/([^ ]*): [^ ]* /g;while((m=r.exec(q))!==null){if(u.toLowerCase()==m[1].toLowerCase()){e=true}}if(e){"$EXISTS$"}else if(!c){"$NONAME$"}else{"addquote?token=SECONDTOKEN&data="+encodeURIComponent(`${u}: ${c} `)})

!commands add !joinadder $(eval if(`$(urlfetch json http://twitch.center/customapi/$(query))`.startsWith("Successfully added entry ")){`$(user) joined the queue!`}else if(`$(query)`=="$EXISTS$"){`$(user) -> You are already in the queue`}else if(`$(query)`=="$NONAME$"){`$(user) -> Enter your name after !join`}else{`$(user) -> Use !join`})

!commands add !next3 $(eval q=`$(urlfetch json http://twitch.center/customapi/quote/list?token=FIRSTTOKEN&no_id=1)`;n3="";i=0;r=/([^ ]*): ([^ ]*) /g;while((m=r.exec(q))!==null&&i<3){n3+=`${m[1]}: ${m[2]} `;i++}i==0?`$(user) -> There are no names in the queue`:`Next ${i==1?"name":i+" names"}: ${n3}`)

!commands add !fullqueue Full queue: http://twitch.center/customapi/quote/list?token=FIRSTTOKEN

!commands add !popqueue -ul=moderator $(eval r=`$(urlfetch json http://twitch.center/customapi/delquote?token=SECONDTOKEN&data=1)`;m=r.match(/^Successfully deleted entry #1: (.*)$/);if(m){m[1]}else if(r=="Invalid entry index"){`$(user) -> The queue is empty`}else{`$(user) -> Unknown error (${r})`})

!commands add !clearqueue -ul=moderator $(eval q=`$(urlfetch json http://twitch.center/customapi/quote/list?token=FIRSTTOKEN)`;r=`$(urlfetch json http://twitch.center/customapi/delquote?token=SECONDTOKEN&clear=1)`;if(q=="There are no quotes added"){`$(user) -> The queue is already empty`}else if(r=="All entries have been deleted"){"The queue has been cleared"}else{`$(user) -> Unknown error (${r})`})

You still need to replace FIRSTTOKEN and SECONDTOKEN with your tokens.

Did u dis it right if not tell me what I did wrong