I’m trying to build a command that forwards two variables to an IFTTT webhook, the first being a single word and the second a line of text in varying length.
This is my command:
$(eval a=$(urlfetch https://webhook?value1=$(1)&value2=$(querystring))
My issue is that $(querystring) repeats the word picked up by $(1) because it pulls the full line of text and not just everything after the first word.
I need them separated because they are used in different places. When using arguments only, like value1=$(1)&value2=$(2) I can only input two words total. Using $(query) in place of $(querystring) has the same result.
So I’m looking for a way to separate the first word from the rest, or alternatively a way to make $(querystring) ignore or remove the first word entirely, before sending it to my webhook.
Thanks for your help! <3
Hiya, you should only use $(querystring) as single variable, and split that variable on your end. From there remove the first word.
Thank you, that’s good to know! I was hoping there would be an easier way to do it with Nightbot already, but then I will have to look into how I could achieve the split. I’m not really versed in programming, so any pointers at how that might be done would be really appreciated! <3
Doing it on your end is the easiest way, Nightbot sends the full user message, and you can do all the parsing on your end.
I’m probably lacking the basic skills to weave a split() method into that, to remove the first word of ‘Value2’ which contains the $(querystring) from Nightbot. And this might be the wrong place to ask for IFTTT support, but is it possible to achive the same thing already in the Nightbot command by using split()?
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.