Help with my !funfact command

Asked Jan 11, 2021·2 replies·Last activity 5 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.

Hi guys, total n00b here. I have created my !funfact command following some templates I found on these boards for joke bots, 8-ball bots, etc. It's not working, I get the same [Response must be less than 400 characters] error that other people have had, but none of their remedies is working for me. Can anyone help me figure this out?

$(eval var facts = "$(urlfetch https://pastebin.com/raw/nSNNj5tA) ".split(";"); facts[Math.floor(Math.random() * (facts.length - 1))];)

2 replies

Hiya, your command was close, you can avoid the character limit by adding json to the urlfetch variable:

js
$(eval facts= "$(urlfetch json https://pastebin.com/raw/nSNNj5tA)".split(";"); facts[Math.floor(Math.random() * (facts.length - 1))])

thank you so much, @Gerhard! It works!