NightDev Community Forums

Querystring split


#1

now i already can encode search parameter with $(querystring)

$(eval var x="$(query)".split("&"),y="http://ac1011.hopto.org:4095/data/songlist.json?search=$(querystring))",a=($(urlfetch json http://ac1011.hopto.org:4095/data/songlist.json?search=$(querystring)));{y})

but now i want add a mode_parameter behind search_parameter
for example: ab&fullmode=1

ab is search_parameter that i want encodeing with $(querystring)
&fullmode=1 is mode_parameter that i don’t want encode

so how do that?


Output $(querystring $(1)) with %20
#2

I am a bit confused on what you are trying to do?
You can use $(querystring) to urlencode all arguments after a command, however you can urlencode them separately by using for example $(querystring $(1)) this will return only the first argument urlencoded.

See https://docs.nightbot.tv/commands/variables/querystring for more info.