I want to apologize if this has already been answered but I was trying to set up a command to add quotes with a specific format but I’m running into an error. Any time the quote is too long (around 20 or characters), it gives me the error “missing ) after argument list” but it does not give this error if the query is shorter.
Edit: The issue is not length. I found out from testing that the issue is actually that apostrophe returns errors
Here’s the command:
$(urlfetch //https://twitch.center/customapi/addquote?token=XXXXXXX&data=%22$(eval a=decodeURIComponent(’$(querystring)’);a.substr(a.indexOf(" “) + 1);a.substr(a.indexOf(” ") + 1))%22 by $(touser) on $(time Canada/Newfoundland “MMMM Do YYYY”))
The $(urlfetch) is a part of the nightbot quote system I am using by eksankia. It calls an API that stores text and adds a new line to it depending on whatever comes after data coded in URI Component. I then have %22 as the code for the quotation mark (") to simplify the addition process. After the eval (full extent listed below), it then ends the quotation and adds “by $(touser) on” and it gives only a date based on Newfoundland Standard Time (streamer’s timezone) given only in month day year format.
$(eval a = decodeURIComponent('$(querystring)');
a.substr(a.indexOf(" ") + 1);
a.substr(a.indexOf(" ") + 1);)
The eval is meant to turn the querystring into a string, then it skips past 2 spaces because it includes the first space that is between !addquote and $(touser) and then skip the second one between $(touser) and the message. The purpose of this is to get the whole quotation while removing the $(touser) at the beginning.
I have done testing and found out that the eval part is the problem in this but I wanted to include it all in case I’m missing anything.