Closed Azayzel closed 6 years ago
The listeners are global. If you have different logic, you need to filter that in the function.
client.on("chat", function (channel, userstate, message, self) {
if (channel==='#user1'){
user1ListenerFunction(channel, userstate, message, self)
}
else if (channel==='#user2'){
user2ListenerFunction(channel, userstate, message, self)
}
});
You can use a switch/case as well if you like, but that is the basic idea if you want to have 1 listener for multiple channels. Have 1 listener, and then forward those to channel specific functions.
Actual behaviour: Can’t seem to add an event listener for each channel I’m connecting to.
Expected behaviour:
If I connect to say, 100 channels, I want to listen for a channel join event of some sort or a message that came in on each channel so I can handle those accordingly.
Error log:
Server configuration