Pastebin Nightbot Coding

Hi, so I mainly use streamelements. But a friend I mod for uses Nightbot and he wants a cookie command where Nightbot randomly chooses a type of cookie thats beign given to the other user. I’ve made a list of responses for it to choose from on Pastebin, but can’t seem to figure out how to code the command for it to work. I want it to look like (User) Gave (toUser) a Cookie! It’s (random cookie type from the list)
Here is the pastebin url, and i know the digits behind the slash is the main thing i need

Hiya! Try something like this:

!commands add !cookie $(user) gave $(touser) a Cookie! It's $(eval a='$(urlfetch json https://pastebin.com/raw/ZnULbfEN)'.split(','); a[Math.floor(Math.random()*a.length)])

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