Hi, I'm trying to make a custom greeting on my twich channel, and the code I have is this.
$(eval u='$(urlfetch json https://pastebin.com/raw/nW88mUvJ))
inside the pastebin I have this code
$(user)';
if(u === 'user1'){'hello user1'}
else if(u === 'user2'){'hello user2'}
else if(u === 'user3'){'hello user3'}
else {'¡hello @$user! 👋'}
The code works fine, but I don't know how to replace the username if it doesn't match any of the above.
I tried to use .replace(/\$user/g, $(user)), but it gives me an error.
$(eval u='$(urlfetch json https://pastebin.com/raw/nW88mUvJ).replace(/\$user/g, $(user)))
please, could you help me? Thank you.