I was testing multiple events using your code and I noticed that this block of code
} else if (data.type === 'presence_change') {
// update slackData presence when user becomes active/inactive
for (var i in self.slackData.users) {
if (self.slackData.users[i].id === data.user) {
self.slackData.users[i].presence = data.presence;
break;
}
}
}
is blocking the bot from processing presence_change events.
Adding cb(null, messageData); after the for loop easily solve this problem.
https://github.com/xBytez/slackbotapi/blob/master/lib/rtm.js#L240
I was testing multiple events using your code and I noticed that this block of code
is blocking the bot from processing
presence_changeevents.Adding
cb(null, messageData);after the for loop easily solve this problem.https://github.com/xBytez/slackbotapi/blob/master/lib/rtm.js#L240