Closed MTRNord closed 8 years ago
@MTRNord you could include the client in your listeners, so in your function you always have the appropriate client available.
var client1 = Client(...);
var client2 = Client(...);
var clients = [client1, client2];
function eventHandler(callback) {
console.log("Now when this function is called, 'this' is equal to the client that received the message");
};
function addListener(event, callback) {
clients.forEach(function(client) {
client.addListener(event, eventHandler.bind(client));
});
}
that is not working :/ now the bot is not working anymore :/ i will better leave it as before. (the function is triggered but bot is not responding anymore.
Since I am using the code snippet from @jirwin that he gave me in #434 I need to know from which server a meassage is send. Is there a way to get this value?