Closed ImChiip closed 8 years ago
Can you describe or share what triggers the bot's response?
@AlcaDesign I do not understand very well But here's the code I call in my function
client.on("chat", function (channel, user, message, self) {
if (user["user-type"] === "mod" || user.username === channel.replace("#", "")) {
client.say("#MyRoom", "My Message");
}
});
A fatal mistake by users when initially testing the module is allowing the bot to respond to itself. The self
argument tells the event listener that the call came from the same tmi.js client. I don't know if this will solve your problem, but I will suggest that you do this in your function:
client.on("chat", function (channel, user, message, self) {
if(self) return false;
// ...
})
@AlcaDesign Thank you for the help I did not use the script from 1h and his works There have anti flood protection on twitch?
Thank you for all this I will use the method that give you :)
If you listen to the "notice" event and console.log
it, you might get "You're sending messages to quickly" ... this is Twitch telling you to slow down. The tmi.js library doesn't come with food protection, but you could probably find a queuing library on npm.
Actual behaviour: Hello I'm about to write a bot twitch I encounter a problem with tmi.js The bot disconnects as soon as a message is sent with client.say log level the message is sent but not on the cat twitch
log:
Server configuration
PS: im french sorry for my bad english :)