{"action":"created","issue":{"url":"https://api.github.com/repos/xBytez/slackbotapi/issues/40","labels_url":"https://api.github.com/repos/xBytez/slackbotapi/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/xBytez/slackbotapi/issues/40/comments","events_url":"https://api.github.com/repos/xBytez/slackbotapi/issues/40/events","html_url":"https://github.com/xBytez/slackbotapi/issues/40","id":112581629,"number":40,"title":"presence_change events being blocked","user":{"login":"magroski","id":2437681,"avatar_url":"https://avatars.githubusercontent.com/u/2437681?v=3","gravatar_id":"","url":"https://api.github.com/users/magroski","html_url":"https://github.com/magroski","followers_url":"https://api.github.com/users/magroski/followers","following_url":"https://api.github.com/users/magroski/following{/other_user}","gists_url":"https://api.github.com/users/magroski/gists{/gist_id}","starred_url":"https://api.github.com/users/magroski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magroski/subscriptions","organizations_url":"https://api.github.com/users/magroski/orgs","repos_url":"https://api.github.com/users/magroski/repos","events_url":"https://api.github.com/users/magroski/events{/privacy}","received_events_url":"https://api.github.com/users/magroski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-21T12:55:11Z","updated_at":"2015-10-21T17:10:40Z","closed_at":null,"body":"I was testing multiple events using your code and I noticed that this block of code\r\n```javascript \r\n} else if (data.type === 'presence_change') {\r\n   // update slackData presence when user becomes active/inactive\r\n   for (var i in self.slackData.users) {\r\n      if (self.slackData.users[i].id === data.user) {\r\n         self.slackData.users[i].presence = data.presence;\r\n         break;\r\n      }\r\n   }\r\n}\r\n```\r\nis blocking the bot from processing `presence_change` events.\r\n\r\nAdding `cb(null, messageData);` after the for loop easily solve this problem.\r\n\r\nhttps://github.com/xBytez/slackbotapi/blob/master/lib/rtm.js#L240"},"comment":{"url":"https://api.github.com/repos/xBytez/slackbotapi/issues/comments/149965389","html_url":"https://github.com/xBytez/slackbotapi/issues/40#issuecomment-149965389","issue_url":"https://api.github.com/repos/xBytez/slackbotapi/issues/40","id":149965389,"user":{"login":"magroski","id":2437681,"avatar_url":"https://avatars.githubusercontent.com/u/2437681?v=3","gravatar_id":"","url":"https://api.github.com/users/magroski","html_url":"https://github.com/magroski","followers_url":"https://api.github.com/users/magroski/followers","following_url":"https://api.github.com/users/magroski/following{/other_user}","gists_url":"https://api.github.com/users/magroski/gists{/gist_id}","starred_url":"https://api.github.com/users/magroski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magroski/subscriptions","organizations_url":"https://api.github.com/users/magroski/orgs","repos_url":"https://api.github.com/users/magroski/repos","events_url":"https://api.github.com/users/magroski/events{/privacy}","received_events_url":"https://api.github.com/users/magroski/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T17:10:40Z","updated_at":"2015-10-21T17:10:40Z","body":"Don't forget to push the changes to npm :)"}}