Multi Shout-out command

2022 visit: it’s fun seeing where I started, now JavaScript is my best friend.

Hey there!

I’m trying to create a multi shout-out command, so it goes like this:

var q="$(query)".split(" ");
var i;
var r=[];
	r[r.length]=$(twitch q[i] "Give {{displayName}} a follow boys and girls! {{url}} They played {{game}}.");
	r=r.join(" ____________________________________________ ");

The idea is to be able to do regular shout-outs (!so streamer), and when needed to combine multiple shout-outs in one command (!so streamer1 streamer2 …). The underscores are covering the regular width of the Twitch chat so it adds something like a line break before shouting out the second streamer to make it clearer for the chat, they appear only if there’s more than one streamer that is shouted out.

But it’s not working, I think it’s because $(twitch) is not working with variables, I mean other than $(touser) or a name, so I’m seeking for confirmation of this, and to ask if there’s a workaround.

Thanks in advance for the help!

Your correct of your issue of $(twitch), variables evaluates before everything else, that’s why you can use "$(query)".split(" ") for your actual values.

You can just cheat the system in this case, also it’s very hard to account for linebreaks just due to Twitch’s chat.

$(eval `$(query)`.split(' ').reduce((acc, name, i, a) => acc += `Give ${name} a follow!${name} ${i === a.length-1 ? '' :  '---  '}`, ''))
1 Like

OMG! Thank you so much! :heart:
I’ll take a deep look at your code so I understand what you’ve exactly done: Javascript isn’t my domain, but I love to learn more, and you got me very curious, haha!

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