Creating a !prompt command

So I am interested in setting up a command in chat to pull a word from a list but I don’t know how to go about this cause I’ve tried it a way to no good results.

I was trying to use Notepad and Google Drive to make this happen. My first attempt was a list of 500 fantasy creatures and it was with this formula in quotations “Your prompt is: $(urlfetch this is where I would put my url)” The result was that It would say the max characters is 400.

So I attempted again with 10 options, still did the same. I did it again with just three options and same result…I ended trying a different string of code that I don’t recall. It didn’t work that way either.

I tried changing how it was in the document and still no results.

Is there any way I can do this?

If there is any how tos about how the coding works with Nightbot I love to see it.

Hey @jfcx90!

You need to use Pastebin, create a paste with your list of words and select a separator, I’d suggest using the comma:

this,is,my,list,of,words

And then the command would be like this:

$(eval a = '$(urlfetch json https://pastebin.com/raw/XXXXXXXX)'.split(','); a[Math.floor(Math.random() * a.length)];)

Don’t forget to replace XXXXXXXX with your paste ID.


Please use the search bar before opening a new topic, we’ve covered this countless times already.

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