!thanos command help


#1

Hi all is there a way to make this command remember the answer it gives to each user just a thought no idea how to code but found this command for !coinflip but changed the name and outcome answers

!commands add !thanos $(eval Math.floor(Math.random() * 2) == 0 ? “u ded” : “You have been spared”)


#2

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

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!

I’ve set up 3 commands below:
!thanos and !thanosp2 which work in tandem to output one of the two possible responses (“u ded”, “You have been spared”) and save the output to a list
!thanoslist which gives a link to that list

Either copy and paste these commands into chat or add them through the Nightbot dashboard. Add the commands through chat only if you are sure no one else is there, otherwise they might see your private token (which is used to edit the list)! Replace publicTokenHere with your public token and privateTokenHere with your private token.

!addcom -cd=5 !thanos -a=!thanosp2 $(eval Math.floor(Math.random()*2)==0?`privateTokenHere&data=$(user) - u ded`:`privateTokenHere&data=$(user) - You have been spared`)
!addcom -cd=5 !thanosp2 $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=$(query))`;`$(query)`.includes(`privateTokenHere`)?`$(query)`.split(` - `)[1]:` `)
!addcom -cd=5 !thanoslist List of Thanos' responses: http://twitch.center/customapi/quote/list?token=publicTokenHere&no_id=1

#3

The quote api sure is getting a lot of mileage. At this point I think it’s basically used as a mini-database for all custom commands.


#4

Thanks this is amazing and makes me want to learn code