Nightbot/Pastebin command

Asked Apr 20, 2023·1 reply·Last activity 3 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.

So I'm trying to make a command on nightbot using pastebin to pull a random fact from pastebin. I already have a slap command that does the same thing and it DOES work. But when creating a new one for the random fact command, it just says "Unexpected Identifier" in chat when I test the command in my Twitch chat....what am I doing wrong?

The command variable I use is:

$(eval a="$(urlfetch json )".split(";");a[Math.floor(Math.random()*a.length)])

The pastebin link IS there after the "json" but this wont let me post with a link so I just took that part out for the purpose of this post.

1 reply

Hey @Snappy Octopus!

Snappy Octopus said:
The pastebin link IS there after the “json” but this wont let me post with a link so I just took that part out for the purpose of this post.

Ah, that's a shame because I think the problem is in the Pastebin, can't you give us its ID? We don't need the full link.