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”)
@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
PUBLIC_TOKEN with your public token and
PRIVATE_TOKEN with your private token.
!addcom -cd=5 !thanos -a=!thanosp2 $(eval Math.floor(Math.random()*2)==0?`PRIVATE_TOKEN&data=$(user) - u ded`:`PRIVATE_TOKEN&data=$(user) - You have been spared`)
!addcom -cd=5 !thanosp2 $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=$(query))`;`$(query)`.includes(`PRIVATE_TOKEN`)?`$(query)`.split(` - `):` `)
!addcom -cd=5 !thanoslist List of Thanos' responses: http://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1
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.
Thanks this is amazing and makes me want to learn code
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.