Right-hand side of 'instandof' is not an object error in my fact script

Hi! I’ve created a command for nightbot to pull a fact from a list based on this article (Command that searches a bank of quotes, like the djkhaled one) however I’ve had so many issues and it won’t work. After changing the comma at the end of each line of my fact document and replacing with a “/” it is giving the error right-hand side of ‘instanceof’ is not an object.

Here is the code I’m working with.
$(eval var jokes = “$(urlfetch json https://pastebin.com/raw/RjzuKP6F) “.split(”/”); jokes[Math.floor(Math.random)( * (jokes.length - 1))]; )

I would really appreciate any help with this.

Replace: Math.random)(
With: Math.random()

Tried that and had the same error come up.

Try this:

$(eval var jokes = `$(urlfetch json https://pastebin.com/raw/RjzuKP6F) `.split(`/`); jokes[Math.floor(Math.random()* (jokes.length - 1))]; )

EEK! Yep that did it. Thank you so so so much for your help! It shows the quote marks but it’s functional and to be honest, that’s all I really care about.

Np, you can remove the quote marks from the pastebin if you don’t want to show them.

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