Single argument with spaces?

Hey guys, I’m new here, couldn’t find this on search so I hope I’m not repeating a FAQ question.

I want to create a command that accepts one argument, but I need that argument to include spaces (I want to get names of countries as my argument, and some countries have more than one word [e.g: United States, United Kingdom, New Zealand…]).

Is there any way for me to escape that so Nightbot gets that string as one argument with spaces?
Thanks in advance! :slight_smile:

Nightbot’s argument variables depend on spaces to delimit input. Here’s a template for setting your own delimiter.

$(eval input = decodeURIComponent(`$(querystring)`).split(`CUSTOM DELIMITER HERE`); // some more code here...)

Cool, thanks! I’ll give it a try :slight_smile:

Sorry in this case how would you deal? !addcom que haces $(eval Math.random() >= 0.5 ? ‘$(user)’ : ‘$(touser)’) $(eval const responses = [‘quien sabe’, ‘que no ves?’, ‘si yo no se menos tu CoolStoryBob’, ‘acabas de llegar?’]; responses[Math.floor(Math.random() * responses.length)] :worried:

!addcom que haces $(eval a=[`quien sabe`,`que no ves?`,`si yo no se menos tu CoolStoryBob`];(Math.random()+0.5?`$(user)`:`$(touser)`)+` `+a[Math.floor(Math.random()*a.length)])

Actually, for my purpose, the $(queryString) was all I needed, as it automatically send the names of the counties encoded so my web-server can easily handle this as one parameter. This is awesome! Works like a charm. Thanks for your help!

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