I want ! for choose at nightbot

someone can give me random !food or movie othes pls

Here’s an example for you.

$(eval a=`$(urlfetch json https://zoeballz.uk/_Nightbot/random_line_test/lines.txt)`.split(`#`);a[Math.floor(Math.random()*a.length)])

It reads the lines from a text file. In this case it’s https://zoeballz.uk/_Nightbot/random_line_test/lines.txt and picks a random line from it.

This particular file contains…

This is line 1.#
This is the second line.#
This is probably the 3rd line.#
Looks like this is a 4th line.

Feel free to give it a try.
NOTE: Each line finishes with a “#” except the last line. These are needed.

You can create your own text file on your own website or on Pastebin or something and change the URL in the command to point to your own file.

:slight_smile:

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