return string when running postman: $(query) test test5
return string when running the command: $(query)testtest5
trying to understand how nightbot works, but the lack of debug tools makes it hard for me to do so.
so why does urlfetch remove the spaces when calling the list for the quotes command? some in detail documentation of nightbot would be greatly appreciated as well. i have already found: What is Nightbot? - Nightbot Docs but it does not describe this behavior but i might have misunderstood something
with your command here you try to output the entire quote list in the chat, Twitch chat’s limit is 500 characters, so with such command you’ll end up reaching an error very soon.
Now, why does the spaces appear to be removed?
They’re not, in fact there isn’t spaces in the output of the API, if you open the link you’re trying to fetch in your browser, you’ll notice that every quote is on a new line, and since Twitch chat doesn’t support new lines, it puts everything on a single line. Nightbot has nothing to do with the presence or absence of spaces here, it’s a combination of how the API is built and how Twitch chat works.
thanks for taking your time to answer my question!
I am aware that quotes api is separate from nightbot and that there is a chat limit, this code is mostly to try to understand how things work and purely for testing. what i did not understand however is that twitch chat removes line breaks, which is information i greatly appreciate.
after doing some testing i am still a bit confused doe. since this code still returns 1
!commands edit !iqMOD -ul=moderator $(eval
a=$(urlfetch json http://twitch.center/customapi/quote/list?token=ed9dbc83).split(/\n/g);
while the regex test with the postman output for the same url returns 5 matches.
does it take away the line breaks even when the text is not outputted to twitch chat? or am i misunderstanding something?