Special characters in $(query) when using urlfetch GET

With the command below, if $(query) contains special characters, they are dropped or $(query) is truncated. I understand why it would happen. It would mess with the URL but is there any solution. The two characters giving me trouble are & and +. anyway around this. I’d even consider replacing like the + symbol with the word plus as an example. Any suggestions? Here’s the command:

$(urlfetch https://www.testdomain.com/nb/atest.php?cid= $(chatid)&user=$(user)&query=“$(query)”)

I’ve tried with and without quote and single quotes. Thanks! Cap

Hiya, you should have a look at $(querystring), this variable can accepts arguments to convert it into a url-encoded string. $(querystring) without arguments is the url-encoded version of $(query), but you can also use for example $(querystring $(user))

https://docs.nightbot.tv/variables/querystring

Thank you!!! That worked perfectly!!

Cap

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