Disc Wars aka !duel command in Twitch Chat

Hello! I have been trying to track down a command a player can @ another person in chat and challenge them to Disc Wars. I would like for it to be able to be a 50/50 chance of choosing the person who is effected by the out come and have two different outcomes.

Player 1 challenges Player 2 to Disc Wars:

Player 1 or 2 has lost and faces deletion


Player 1 or 2 has won and advances to the next round

Also is there any way to setup a command on recording how many disc wars a person has won over time?

1 Like

@marqkthefox This is possible using ehsankia’s quote list API.

What you do is click this link. It will generate three links and two tokens, a public token and a private token (that you should keep to yourself). 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!

I set up two commands that will output a disc war outcome and record the victor’s win, !challenge and !challengep2, although you will really only be using !challenge (!challenge is set up to pass input to !challengep2). I also set up a third command, !wins, that gives the number of wins of any user. Either copy and paste these commands as they are into your chat or use the Nightbot dashboard to create the commands. Add these commands through chat only if you are sure no one else is in chat, otherwise they might see your private token!

Replace each PRIVATE_TOKEN with your private token and each PUBLIC_TOKEN with your public token before adding the commands.

!addcom -cd=5 !challenge -a=!challengep2 $(eval a='$(user)';b='$(1)';if('$(twitch $(1))'!='Unknown Twitch Channel'&&b!='null'&&b.toLowerCase()!=a.toLowerCase()){if(Math.round(Math.random())==0){c=a,d=b;}else{c=b,d=a;}'addquote?token=PRIVATE_TOKEN&data=-'+c+'|'+d;}else{'e';})

!addcom -cd=5 !challengep2 $(eval a='$(urlfetch http://twitch.center/customapi/$(query))';b='$(query)';if(b.includes('PRIVATE_TOKEN')){c=b.split('-')[1];if('$(user)'.toLowerCase()==c.split('|')[0].toLowerCase){d=c.split('|')[1];}else{d=c.split('|')[0];}'$(user) challenges '+d+' to Disc Wars! '+c.split('|')[0]+' has won and advances to the next round!';}else{'Invalid input!';})

!addcom -cd=5 !wins $(eval a='$(urlfetch json http://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)'.match(/-$(touser)/gi);a!=null?'$(touser) has won '+a.length+' Disc Wars.':'$(touser) has won 0 Disc Wars.')
1 Like

First thank you for making this for me. After playing around with the command I have decided on a different path. Is is possible to make the following three commands for sub only users.

Command 1
!Arena Player 1 challenges Player 2 to a Disc War

-This will send the Two players into a cue to be matched up for duel

!discwars Player 1 battles Player 2 in the Arena and has a 50/50 outcome
A) Player 1 Wins and advances to the next level
B) Player 1 Looses and faces Deresolution

*If they loose is is possible to make it to where they can not disc war for a cool down time?

!wins Players can track how many wins they have over the course of their disc war battles

I also want to know if there is a way to make a leader board I can make into a panel to track the top ten best Disc Wars Champions. As stated above I only want this to be able to played by subs as incentive. I am thankful for your time and efforts.

1: Making the commands sub-only is easy. Just add -ul=subscriber in front of -cd=5 for each command I wrote.

2: I suppose the usage of !arena is:

!arena [player to challenge]

The command enters the pair of player names (challenger/target) into a queue… then !discwars triggers an outcome.

i: Do you want a user to be able to challenge multiple people (have their name in the queue more than once)?
ii: Do you want for either player 1 or 2 to be able to use !discwars and trigger an outcome?

3: I’m not totally sure I can add a loss cooldown, but… Do you want only the challenger to endure a cooldown if they lose? Or will the target also endure a cooldown if they lose?

4: It might be possible to make a leaderboard you can turn into a Twitch panel… I’m not the person to ask to make this work (what I do know is that html won’t work within Twitch panels). What I can suggest, though, is making a list that keeps track of player victories that you can view. You can keep screenshots of this leaderboard and upload it to a Twitch panel.

Please reply in a numbered format like this, answering points 1 to 4 as needed.

  1. Okay perfect Im glad to hear this can be a sub only game

  2. !arena is a holding cue for as many subs want to enter

i: I would like for any one in the holding cue to be able to challenge who ever is left
II: I would like the outcome to ONLY apply to the Player who challenges the other to the Disc War

3.Instead of a cool down who ever looses the match is kicked from the Holding cue aka !arena

  1. Is there a command that can be made that shows all who have entered and won for the day so I can make a manual Leader Board I will update myself?

1: Resolved.

2: There are a few things you left unclear about the arena queue…
i: Tell me whether you want a player to be able to have their name in the arena multiple times, ie. one user challenging multiple others.
ii: Does this mean for every challenger/target pair only the challenger can use !discwars to trigger an outcome?

3: That’s doable.

4: Having a list to show who’s entered and who’s won are two different things…
i: I can make another list to show those who entered. Do you want challenger/target pairs to show up there or just challenger names?
ii: I can make another list to show wins.
iii: If these lists are just for the day, there’s going to be another command needed to clear these lists which isn’t hard to make.

  1. Perfect

i.They can only have their name in once and only if they win can they challenge someone else to another disc war
ii.Only the person who triggers the !diskwars suffers the fate of the outcome. Anyone in the arena can challenge anyone left. I guess it would be easier if the !arena command was just used to enter people into Disk Wars. So the player will @themselves to enter and then any one in the Arena can @ the other players into a disk war. The out come only effect the person who initiates the fight.


  1. I would just like a list that shows the wins for the day
    i. Don’t worry about entires
    ii. I just want to see the winners and how many times they have one for that day
    iii. A reset would be perfect so the data is fresh every time I stream

Example of the event:

!arena Player 1

“Player 1 has entered the Arena”

!arena Player 2

“Player 2 has entered the Arena”

!arena Player 3

“Player 3 has entered the Arena”

(Player 1 uses command) !discwars Player 2

Scenerio 1) “Player 1 has won the match and advances to the next round”
-Player 2 is kicked from the Arena and will have to re enter if they want to play
-Player 1 can now challenge any Players left in the Arena

Scenerio 2)“Player 1 has lost and faces Deresolution”
-Player 1 is kicked from the Arena and will have to re enter if they want to play again
-Player 2 can now challenge any Players left in the Arena

!win command shows the win ratio of the individual player who use the command
ex: !win Player 1
“Player 1 has won 10 times”

!windaily shows the wins of All player of the stream
Player 1 has won 10
Player 2 has won 2
Player 3 has won 8

!hardreset clears the counter so the result shows zero

@marqkthefox The entire bundle of commands I have set up requires three sets of tokens - use this link as many times as needed to get your tokens (which you should remember to keep in a safe place). Remember, each set of tokens has a public token (8 characters long) and a private token (16 characters long). I will name the tokens as follows. Please keep track of which tokens you’re using for which commands. Whenever you see one of these token names appear in a command, replace the name with the corresponding token:

Set 1: ArenaPub & ArenaPriv <== Manages the player list.
Set 2: AllTimePub & AllTimePriv <== Manages the all time wins list.
Set 3: DailyPub & DailyPriv <== Manages the daily wins list.

I have grouped the commands according to their functions. Follow the instructions exactly as stated for each group of commands when adding them.

Arena commands: !arena, !arenap2, !arenaclear (mod only). Replace ArenaPub and ArenaPriv with their corresponding tokens. Copy and paste the setup for these commands into chat 1 at a time:

!addcom -cd=5 !arena -a=!arenap2 $(eval `$(urlfetch json http://twitch.center/customapi/quote/list?token=ArenaPub)`.includes(`-$(user)-`)?` `:`http://twitch.center/customapi/addquote?token=ArenaPriv&data=-$(user)-`)
!addcom -cd=5 !arenap2 $(eval a=`$(urlfetch $(query))`.charAt(0)==`S`?`$(user) has entered the Disc Wars arena!`:`$(user) is already in the arena!`)
!addcom -ul=mod !arenaclear $(urlfetch http://twitch.center/customapi/delquote?token=ArenaPriv&clear=1) from the Disc Wars arena!

Disc Wars commands: !discwars, !discwarsp2. Replace ArenaPub, ArenaPriv, AllTimePriv, and DailyPriv with their corresponding tokens. Copy and paste the setup for !discwars into chat, use the Nightbot dashboard to add !discwarsp2:

!addcom -cd=5 !discwars -a=!discwarsp2 $(eval a=`-$(user)-`;b=decodeURIComponent(`-$(querystring)-`);c=`$(urlfetch json http://twitch.center/customapi/quote/list?token=ArenaPub)`;if(c.includes(a)&&c.toLowerCase().includes(b.toLowerCase())&&a.toLowerCase()!=b.toLowerCase()){if(Math.round(Math.random())==0){`ArenaPriv&data=`+a+` &data=`+b;}else{`ArenaPriv&data=`+b+` &data=`+a;}}else{` `;})

On the dashboard:
Click Add Command
Type !discwarsp2 into Command field
Copy and paste this into Message field. Don’t forget to copy and paste in those tokens:

$(eval a=`$(urlfetch http://twitch.center/customapi/delquote?token=$(1))`;b=`$(urlfetch http://twitch.center/customapi/addquote?token=AllTimePriv$(2))`;c=`$(urlfetch http://twitch.center/customapi/addquote?token=DailyPriv$(2))`;if(`$(query)`!=` `){c=`$(1)`.slice(23,`$(1)`.length-1);d=`$(2)`.slice(7,`$(2)`.length-1);if(`$(user)`.toLowerCase()==d.toLowerCase()){d+` won against `+c+` and advanced to the next level!`;}else{c+` lost against `+d+` and faced Deresolution!`;}}else{`Error!`})

Click Submit

Wins commands: !wins, !winsclear (mod only), !winsdaily, !winsdailyclear (mod only). Replace AllTimePub, AllTimePriv, DailyPub, and DailyPriv with their corresponding tokens. Copy and paste the setup for these commands into chat 1 at a time:

!addcom -cd=5 !wins $(eval a=`$(urlfetch json http://twitch.center/customapi/quote/list?token=AllTimePub)`.match(/-$(touser)-/gi);a!=null?`$(touser) has won `+a.length+` Disc Wars.`:`$(touser) has won 0 Disc Wars in total.`)
!addcom -ul=mod !winsclear $(urlfetch http://twitch.center/customapi/delquote?token=AllTimePriv&clear=1) from the Disc Wars All Time points list!
!addcom -cd=5 !winsdaily $(eval a=`$(urlfetch json http://twitch.center/customapi/quote/list?token=DailyPub)`.match(/-$(touser)-/gi);a!=null?`$(touser) has won `+a.length+` Disc Wars.`:`$(touser) has won 0 Disc Wars today.`)
!addcom -ul=mod !winsdailyclear $(urlfetch http://twitch.center/customapi/delquote?token=DailyPriv&clear=1) from the Disc Wars Daily points list!

Command usages:

!arena <= Join the Disc Wars arena.
!arenaclear <= Clear the Disc Wars arena (mod only).
!discwars [username] <= Challenge another user to Disc Wars. Loser is removed from the arena.
!wins [username/leave blank] <= Look up any user's all time wins. Enter username to look up another user's wins or leave blank to look up your own wins.
!winsclear <= Clear the all-time wins list (mod only).
!winsdaily [username/leave blank] <= Look up any user's daily wins. Enter username to look up another user's wins or leave blank to look up your own wins.
!winsdailyclear <= Clear the daily wins list (mod only).

When I enter in the diskwars command after adding the tokens I get “Error!” Once I try to initiate it with one of my MODS. Is it not working because he is not subbed?

Moderator userlevel is higher than sub userlevel so they should be able to use the commands… Please double check that your command responses match what I setup exactly as they are, specifically the !discwars and !discwarsp2 responses.

When you click on the link can you see my public and private tokens? What is the point of having TWO Private Tokens that are the same?

Here is a screenshot bellow to make sure I am adding the info in the correct spots

Your tokens aren’t shown in your screenshot.

For each pair of public & private tokens did you keep them labeled together as such? e.g. When you generated a pair of tokens to use for the arena, did you keep them labeled as ArenaPub and ArenaPriv? You cannot mix and match different public and private tokens.

Did you also follow the special instructions for adding !discwarsp2 ?


First off, I don’t think you can make Nightbot enter the arena by itself. Second, don’t use @

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.