How to make an Eval command without character limit?

Hi! So I’m trying to make an eval command, but the number of objects I’m looking to add exceeds the character limit. I’m doing something like this:
$(eval const responses = [‘Quote1.’, ‘Quote2.’, ‘Quote3.’, ‘Quote4’]; responses[Math.floor(Math.random() * responses.length)]:wink:
The command I’m looking to add has a lot more quotes, though. Is there any way to add a command that will pull a random quote from the list but doesn’t have a character limit?
Thanks!

Go to https://pastebin.com and upload your quotes. Look at my example (https://pastebin.com/raw/bbGr2ETq) to see how to format your quotes.

Replace my Pastebin link with the one you just created (use the raw link).

$(eval s=decodeURIComponent("$(querystring [$(urlfetch json https://pastebin.com/raw/bbGr2ETq)])");try{q=JSON.parse(s);(q.length?q[Math.floor(Math.random()*q.length)]:`No quotes: ${s}`).substr(0,400)}catch(e){`Failed to parse quotes: ${e.message}: ${s}`.substr(0,400)})

You can either create an array of quotes on Pastebin.com and use $(eval) to pull from there,

or you can take a look at this forum post: ehsankia’s quote list CustomAPI It’ll let you create a list of quotes from which Nightbot can randomly pull from.

Ok thank you! I tried this but I got the error message “Failed to parse quotes: SyntaxError: Unexpected token ] in JSON at position 419:” How do I fix this?

The Nightbot command already has the [ and ], so you shouldn’t include them in the quotes you upload to Pastebin.

Thank you so much! It works perfectly now!

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