I run two bots, one from streamlabs and another script (using tmi.js) that I run locally.
For the script, I found this code by Ma3x from this source: cooldown for twitch bot (portion of the code shown below) and added it on my script. It was able to detect the messages sent by the chatters.
However, it does not detect the messages sent by the streamlabs bot. I tried a lot of changes to the code but to no avail. What should I do to make the script detect the words sent by a bot.
Here’s the code:
let lastHelpTime = 0
client.on('message', (channel, tags, message, self) => {
const send = message === "This is the message sent by a bot"
if ( !send ) return;
const timeNow = new Date().getTime()
if (timeNow - lastHelpTime > 60 * 1000) {
lastHelpTime = timeNow
client.say(channel, `This is the reply`)
}
Thanks in advance!