{"action":"created","issue":{"url":"https://api.github.com/repos/hydrabolt/discord.js/issues/136","labels_url":"https://api.github.com/repos/hydrabolt/discord.js/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/hydrabolt/discord.js/issues/136/comments","events_url":"https://api.github.com/repos/hydrabolt/discord.js/issues/136/events","html_url":"https://github.com/hydrabolt/discord.js/issues/136","id":125588056,"number":136,"title":"React on a user going from offline to online","user":{"login":"TheJellyfishTFP","id":16608194,"avatar_url":"https://avatars.githubusercontent.com/u/16608194?v=3","gravatar_id":"","url":"https://api.github.com/users/TheJellyfishTFP","html_url":"https://github.com/TheJellyfishTFP","followers_url":"https://api.github.com/users/TheJellyfishTFP/followers","following_url":"https://api.github.com/users/TheJellyfishTFP/following{/other_user}","gists_url":"https://api.github.com/users/TheJellyfishTFP/gists{/gist_id}","starred_url":"https://api.github.com/users/TheJellyfishTFP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheJellyfishTFP/subscriptions","organizations_url":"https://api.github.com/users/TheJellyfishTFP/orgs","repos_url":"https://api.github.com/users/TheJellyfishTFP/repos","events_url":"https://api.github.com/users/TheJellyfishTFP/events{/privacy}","received_events_url":"https://api.github.com/users/TheJellyfishTFP/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hydrabolt/discord.js/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-01-08T10:57:35Z","updated_at":"2016-01-17T01:13:01Z","closed_at":null,"body":"I'm trying to make my bot greet people when they come online on a server. It works now by using the presence event, except that it also greets the people who go from afk to online or switch games. Is there a way to check the status of the user before it changed? Here's the relevant part of the code, I just edited the ping pong example.\r\n\r\n\tbot.on(\"presence\", function (pUser, pStatus, pGameID) {\r\n\t\tif (pStatus === \"online\")\r\n\t\t{\r\n\t\t\tswitch(pUser.username)\r\n\t\t\t{\r\n\t\t\t\t//bunch of cases with special usernames go here, example\r\n\tcase \"example\":\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbot.sendMessage(/*channel ID goes here */,\"example message\")\r\n\t\t\t\t\t\tconsole.log(pUser.username)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n                \r\n\t\t\t\tdefault:\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbot.sendMessage(/*channel ID goes here*/, \"Welcome back \" + pUser.mention() + \"!\")\r\n\t\t\t\t\t\tconsole.log(pUser.username)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\nThank's in advance!"},"comment":{"url":"https://api.github.com/repos/hydrabolt/discord.js/issues/comments/172281886","html_url":"https://github.com/hydrabolt/discord.js/issues/136#issuecomment-172281886","issue_url":"https://api.github.com/repos/hydrabolt/discord.js/issues/136","id":172281886,"user":{"login":"abalabahaha","id":2415829,"avatar_url":"https://avatars.githubusercontent.com/u/2415829?v=3","gravatar_id":"","url":"https://api.github.com/users/abalabahaha","html_url":"https://github.com/abalabahaha","followers_url":"https://api.github.com/users/abalabahaha/followers","following_url":"https://api.github.com/users/abalabahaha/following{/other_user}","gists_url":"https://api.github.com/users/abalabahaha/gists{/gist_id}","starred_url":"https://api.github.com/users/abalabahaha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abalabahaha/subscriptions","organizations_url":"https://api.github.com/users/abalabahaha/orgs","repos_url":"https://api.github.com/users/abalabahaha/repos","events_url":"https://api.github.com/users/abalabahaha/events{/privacy}","received_events_url":"https://api.github.com/users/abalabahaha/received_events","type":"User","site_admin":false},"created_at":"2016-01-17T01:13:01Z","updated_at":"2016-01-17T01:13:01Z","body":"After some discussion, it appeared that most people seem to prefer merging userUpdated into presence, and supplying a before User and after User. I attempted this in 0164d3e (still needs indev testers)."}}