Nightbot funfact command?

Asked Dec 18, 2021·1 reply·Last activity 4 years 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.

Hey,

I wanna add a !funfact command, so everytime somebody type that into the chat,a random funfact out of a pastebin list for example is picked and writed in the chat :) how is that possible?

1 reply

Hi @Chipper Chipmunk yes, it is possible.

!addcom -cd=5 !funfact Fact: $(eval a = $(urlfetch json https://pastebin.com/raw/x0vgXCwJ); a[Math.floor(Math.random() * a.length)])

Also, I believe this fact topic is being discussed a lot of times. Next time consider checking the Forum first, you probably find the answer.

Regards