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 https://pastebin.com/raw/3WQLD50Z) "responses[Math.floor(Math.random() * responses.length)]:wink:

@dekuw0wser

Nightbot variables aren’t resolved properly if pulled in a url fetch. Edit the Pastebin file at https://pastebin.com/raw/3WQLD50Z 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 https://pastebin.com/raw/3WQLD50Z)];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.