HighlightOfMyChat
HighlightOfMyChat copied to clipboard
I have no idea what I am doing
I see a video with instafluff talking about adding your channel name and redemption reward id into the code, but the code I see now in the index isn't the same from the video, so trying c/p a url as a browser source just doesn't do anything. Am I missing some kind of crucial, painfully obvious step?
I do not think custom rewards are supported in the current version of HighlightOfMyChat, although you could hack it together yourself.
inside the ComfyJS.onChat
you could add a Switch statement or if-else block that executes code based on the reward ids
Example
ComfyJS.onChat = (user, message, flags, self, extra) => {
if (flags.highlighted) {
highlightThisMessage(user, message, extra);
}
switch (extra.customRewardId) {
case 'custom id code here':
msgQueue.push(message.trim());
playTTS();
break;
case 'custom id code here':
msgQueue.push(message.trim());
playTTS();
break;
// add more cases here
}
};
with this code you can execute different actions based on different rewards, for example, you could have each reward be a different voice by setting the voice before pushing to msgQueue
like this
case 'custom id code here':
ttsVoice = 'Brian';
msgQueue.push(message.trim());
playTTS();
break;