I’m trying to rewrite a command. The command fetches from warp.world API.
Due to message length limitations on YouTube, the command does not work.
Are there any limitations to the JS one can use with $(eval)?
Here’s what I’ve been trying to do:
var str = $(urlfetch Warp World - The Future of Streamingetc.);
if (($(provider) == ‘youtube’))
{ str = str.substr(1,201-3) + “…”; }
return str;
And then I wrap it up like $(eval above code).
I’ve tried some different implementations of the same thing, but the only error popping out of NightBot when I try the command is “right-hand side of ‘instanceof’ is not an object”
Can I perhaps not use $(provider) or $(urlfetch) within an $(eval)?
The problem isn’t that NightBot cannot get ahold of the entire payload from Warp World.
Rather it’s that the payload needs to shortened so that it’ll fit YouTube’s length requirements.
I’m trying to do that using the $(eval) variable within a Nightbot command.
Usually, we’ve been using a regular $(urlfetch), like the one in the OP.
That has been working great over at Twitch though, which is why I’m trying to use the $(provider) variable…
Seems to me as if Nightbot won’t let me make en $(eval) with more than one JS statement, but I still managed to get the kind of output I wanted, so it’s no biggie.
Feel free to correct me on that though.
I know there are some other streamers on YouTube that use Nightbot and warp.world, who can’t get their !queue going, so I’ll just drop this here and hope they find it when searching
I suppose maybe Youtube “superchat” would allow for longer message length… I’ll update this post in case I find that to be the case