Nightbot command using Pastebin

Asked Sep 7, 2025·2 replies·Last activity 11 months ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

I am trying to set up a command that will give a random god/goddess from my pastebin link when the user uses it. Example: User has received a boon from, Poseidon, God of the sea!

I have looked up and tried everything. I either keep getting unexpected identifier errors like "God" or stuff like, "Poseidon is not defined." I have no idea what to do at this point so any and all help is greatly appreciated. I'm new to this and am very unsure as to what I'm doing. Code I've been trying to use is pasted below.

$(user) received a boon from $(eval a=$(urlfetch json https://pastebin.com/raw/G6eEZmH2).split(","); a[Math.floor(Math.random()*a.length)])!

2 replies

I had to modify both the command syntax and some pastebin parameters to make it work and I succeeded.

$(user) received a boon from $(eval a=$(urlfetch json https://pastebin.com/raw/Vva5kHgZ);a[Math.floor(Math.random()*a.length)])

For these types of commands which use Pastebin as a list, the words or sentences that you want to appear randomly have to be written in the following way

[
"option1",
"option2",
"last option"
]

Beginning and ending with [ and ], each option must be enclosed in quotes at the beginning and end of each sentence "options" and each option except the last must end with a comma ,

I ask you to copy the content of the pastebin that I share with you and paste it directly into yours and remember to use the link to your own pastebin when copying the command that I provide you

Thank you so much for helping out and explaining things! I appreciate it so much!