!duel command for a youtube stream

I am wanting to make a !duel command that does this

Okay so when someone on the youtube stream type !addduel it will add there name to a list and then when someone types !duel it will show all people that are waiting. Idk if this isn’t possible or not.

1 Like

!duel You to a challenge do you accept

1 Like

@Zemo_DEV This is possible using ehsankia’s quote API - read more about it here.

What you do is click this link. It will generate three links and two tokens, a public token (8 characters long) and a private token (16 characters long). The public token is located within the first generated link. The private token is located within both the second and third generated links. The tokens are found after token= and before &data=$(querystring) Copy them and keep them somewhere safe!

So you want two commands: !addduel which adds the user’s name to a list and !duel which shows that list. Copy and paste these into your chat to add the commands. Replace PUBLIC_TOKEN with your public token and PRIVATE_TOKEN with your private token:

!addcom -cd=5 !addduel $(urlfetch http://twitch.center/$(eval '$(urlfetch http://twitch.center/customapi/quote?token=PUBLIC_TOKEN&data=$(user)&no_id=1)'!='$(user)'?'customapi/addquote?token=PRIVATE_TOKEN':' ')&data=$(user))

!addcom -cd=5 !duel Duel list: http://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1

When you type !addduel, Nightbot will add your name to the list based on whether your name is already on the list or not. When you type !duel, Nightbot will post a link to the list of users who have used !addduel

2 Likes

One of them are too big. What do i do?

1 Like

@Zemo_DEV Go to the Nightbot dashboard here and login using your YouTube account.

Click Add Command
In the Command field type !addduel
In the Message field copy and paste the response for the !addduel command. The response should contain 199 characters, which is within YouTube’s 200-character response limit.
Click Submit

1 Like

Okay so when i foment hen !addduel and done my name it sent back the message. What do i do and also there was nothing in the list

When you type !addduel it should add your name to the list if it isn’t there already.
To get the list of users type !duel and it’ll give you a link to the list.
If you followed the instructions for setting up the commands (generating the public and private tokens and placing them into the command responses) they should work.

2 Likes

I did but when i type !addduel it spits out the raw message.

If the command !addduel is simply returning the raw command response, you might have not copied and pasted the entire response. Try removing the command (!delcom !addduel) and re-create the command. Be sure to copy and paste the entire command response!

1 Like

The message is 7 characters over the limit.

1 Like

Use the dashboard to add the !addduel command… when you replace publicTokenHere with your public token (which should be 8 characters long) and replace privateTokenHere with your private token (which should be 16 characters long) the entire response should be 199 characters.

I’ve included a screenshot of what it should look like on the dashboard:

1 Like

I have all the same stuff and it sitll doesnt work…

I have the private tokens and public tokens

Compare your screenshot to my screenshot. The command responses aren’t the same. Specifically there is %27 where there should be '

I’ll copy and paste the command response for !addduel over here for easy access. Remember to replace publicTokenHere with your public token and privateTokenHere with your private token before adding the command:

$(urlfetch http://twitch.center/$(eval '$(urlfetch http://twitch.center/customapi/quote?token=publicTokenHere&data=$(user)&no_id=1)'!='$(user)'?'customapi/addquote?token=privateTokenHere':' ')&data=$(user))

For future reference, do not show anyone your private tokens. :slight_smile:

1 Like

It was discord messing with me and adding the things UGh. What i am wanting the command to do exactly is if someone does !addduel and it will add the to the list
IS this possible?

Yes, that is what !addduel will do. It will add the user’s name to the list. If the user’s name is already on the list, it won’t add the name again.

1 Like

Its only adding our youtube names but thats not what i was looking for. The command is for a minecraft streamer and hes wanting this to be a duel list so if someone wanted to duiel them they will do !duel but when i do this it just spits out my Youtube name. I know $(query) may be possible but idk

We tried that but it was still spitting out my youtube name and nothing after that.

I’ve been playing around with the response for the last 15 minutes trying to fit $(query) in without going over the 200-character limit. What I did was just cut out the part that checks whether your name is on the list:

$(urlfetch http://twitch.center/customapi/addquote?token=privateTokenHere&data=$(query))

1 Like

Well thanks man! Means a lot!

SO this will spit out whatever i type after the command?