Help with a command including a urlfetch

I’m trying to do a command which needs more characters than what is useable. So I thought I could use an url fetch but I can’t get it to work.

I would greatly appreciate it if someone could help me with why this command does not work.

$(user) fought $(touser) and $(eval const responses = [$(urlfetch "responses[Math.floor(Math.random() * responses.length)]:wink:


Nightbot variables aren’t resolved properly if pulled in a url fetch. Edit the Pastebin file at and replace $(user) with ~U and replace $(touser) with ~T

Then copy and paste the following command response:

$(user) fought $(touser) and $(eval a=[$(urlfetch json];a[Math.floor(Math.random()*a.length)].replace(/~U/g,`$(user)`).replace(/~T/g,decodeURIComponent(`$(querystring $(touser))`)))
1 Like

Thank you so much! That fixed it

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