Help me with my !funfact command

Hi, I’m trying to set my !funfact command. I was looking at other posts about this topic but im not from the US and our pastebin website has different ulr.

The one I was trying is:

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

but my website url is Pastebin.cz , and when I replace it in the command nightbot replies with “Unexpected identifier ‘cs’ [:1:36]”

Thanks for help

Try the following:

$(eval let facts = `$(urlfetch json https://pastebin.com/raw/nSNNj5tA)`.split(`;`).map(line=>line.trim()); facts[Math.floor(Math.random() * facts.length)])

If you’re trying to use a different Pastebin service, you’ll need to make sure you’re using the raw file link. It won’t work if there’s other content at the url (like a webpage).

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