{"action":"created","comment":{"url":"https://api.github.com/repos/botpress/botpress-slack/pulls/comments/94597891","pull_request_review_id":15126420,"id":94597891,"diff_hunk":"@@ -0,0 +1,51 @@\n+import Promise from 'bluebird'\n+import { RtmClient, CLIENT_EVENTS, RTM_EVENTS } from '@slack/client'\n+\n+// TODO handle all events from slack\n+//\n+// - connection failed\n+//\n+export default (slackApiToken, sendIncoming) => {\n+  let data\n+  let isConnected = false\n+\n+  const rtm = new RtmClient(slackApiToken)\n+\n+  const authenticateP = new Promise((resolve) => {\n+    rtm.on(CLIENT_EVENTS.RTM.AUTHENTICATED, (rtmStartData) => {","path":"src/slackConnector.js","position":15,"original_position":15,"commit_id":"b5b7628af3488a0517a7b693c90a5a5785da8fb8","original_commit_id":"b5b7628af3488a0517a7b693c90a5a5785da8fb8","user":{"login":"slvnperron","id":1315508,"avatar_url":"https://avatars.githubusercontent.com/u/1315508?v=3","gravatar_id":"","url":"https://api.github.com/users/slvnperron","html_url":"https://github.com/slvnperron","followers_url":"https://api.github.com/users/slvnperron/followers","following_url":"https://api.github.com/users/slvnperron/following{/other_user}","gists_url":"https://api.github.com/users/slvnperron/gists{/gist_id}","starred_url":"https://api.github.com/users/slvnperron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slvnperron/subscriptions","organizations_url":"https://api.github.com/users/slvnperron/orgs","repos_url":"https://api.github.com/users/slvnperron/repos","events_url":"https://api.github.com/users/slvnperron/events{/privacy}","received_events_url":"https://api.github.com/users/slvnperron/received_events","type":"User","site_admin":false},"body":"Reject the promise on auth error:\r\n\r\nhttps://github.com/slackapi/node-slack-sdk/blob/cbe9da5fbd38a22cbf7fe7b7253a6fdefe6a4df3/lib/clients/events/client.js#L35","created_at":"2017-01-04T15:03:37Z","updated_at":"2017-01-04T15:11:56Z","html_url":"https://github.com/botpress/botpress-slack/pull/1#discussion_r94597891","pull_request_url":"https://api.github.com/repos/botpress/botpress-slack/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/botpress/botpress-slack/pulls/comments/94597891"},"html":{"href":"https://github.com/botpress/botpress-slack/pull/1#discussion_r94597891"},"pull_request":{"href":"https://api.github.com/repos/botpress/botpress-slack/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/botpress/botpress-slack/pulls/1","id":99820377,"html_url":"https://github.com/botpress/botpress-slack/pull/1","diff_url":"https://github.com/botpress/botpress-slack/pull/1.diff","patch_url":"https://github.com/botpress/botpress-slack/pull/1.patch","issue_url":"https://api.github.com/repos/botpress/botpress-slack/issues/1","number":1,"state":"open","locked":false,"title":"Feature/rs basic infra","user":{"login":"rayshih","id":613044,"avatar_url":"https://avatars.githubusercontent.com/u/613044?v=3","gravatar_id":"","url":"https://api.github.com/users/rayshih","html_url":"https://github.com/rayshih","followers_url":"https://api.github.com/users/rayshih/followers","following_url":"https://api.github.com/users/rayshih/following{/other_user}","gists_url":"https://api.github.com/users/rayshih/gists{/gist_id}","starred_url":"https://api.github.com/users/rayshih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayshih/subscriptions","organizations_url":"https://api.github.com/users/rayshih/orgs","repos_url":"https://api.github.com/users/rayshih/repos","events_url":"https://api.github.com/users/rayshih/events{/privacy}","received_events_url":"https://api.github.com/users/rayshih/received_events","type":"User","site_admin":false},"body":"This is an unfinished feature. However, it is an almost finished infrastructure. This PR is created for aggregating some feedbacks.\r\n\r\nThe followings are what I'm going to do next:\r\n\r\n1. create web interfaces to setup slack token and config slack channel\r\n2. port some examples from https://github.com/botpress/botpress-examples\r\n    - maybe extend those modules to support both connectors.\r\n3. handle all event from slack\r\n","created_at":"2017-01-01T09:46:11Z","updated_at":"2017-01-04T15:11:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e394e70eb670cbd597659296ac5c0908f43ecfea","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/botpress/botpress-slack/pulls/1/commits","review_comments_url":"https://api.github.com/repos/botpress/botpress-slack/pulls/1/comments","review_comment_url":"https://api.github.com/repos/botpress/botpress-slack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/botpress/botpress-slack/issues/1/comments","statuses_url":"https://api.github.com/repos/botpress/botpress-slack/statuses/b5b7628af3488a0517a7b693c90a5a5785da8fb8","head":{"label":"botpress:feature/rs-basic-infra","ref":"feature/rs-basic-infra","sha":"b5b7628af3488a0517a7b693c90a5a5785da8fb8","user":{"login":"botpress","id":23510677,"avatar_url":"https://avatars.githubusercontent.com/u/23510677?v=3","gravatar_id":"","url":"https://api.github.com/users/botpress","html_url":"https://github.com/botpress","followers_url":"https://api.github.com/users/botpress/followers","following_url":"https://api.github.com/users/botpress/following{/other_user}","gists_url":"https://api.github.com/users/botpress/gists{/gist_id}","starred_url":"https://api.github.com/users/botpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botpress/subscriptions","organizations_url":"https://api.github.com/users/botpress/orgs","repos_url":"https://api.github.com/users/botpress/repos","events_url":"https://api.github.com/users/botpress/events{/privacy}","received_events_url":"https://api.github.com/users/botpress/received_events","type":"Organization","site_admin":false},"repo":{"id":73967451,"name":"botpress-slack","full_name":"botpress/botpress-slack","owner":{"login":"botpress","id":23510677,"avatar_url":"https://avatars.githubusercontent.com/u/23510677?v=3","gravatar_id":"","url":"https://api.github.com/users/botpress","html_url":"https://github.com/botpress","followers_url":"https://api.github.com/users/botpress/followers","following_url":"https://api.github.com/users/botpress/following{/other_user}","gists_url":"https://api.github.com/users/botpress/gists{/gist_id}","starred_url":"https://api.github.com/users/botpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botpress/subscriptions","organizations_url":"https://api.github.com/users/botpress/orgs","repos_url":"https://api.github.com/users/botpress/repos","events_url":"https://api.github.com/users/botpress/events{/privacy}","received_events_url":"https://api.github.com/users/botpress/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/botpress/botpress-slack","description":null,"fork":false,"url":"https://api.github.com/repos/botpress/botpress-slack","forks_url":"https://api.github.com/repos/botpress/botpress-slack/forks","keys_url":"https://api.github.com/repos/botpress/botpress-slack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/botpress/botpress-slack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/botpress/botpress-slack/teams","hooks_url":"https://api.github.com/repos/botpress/botpress-slack/hooks","issue_events_url":"https://api.github.com/repos/botpress/botpress-slack/issues/events{/number}","events_url":"https://api.github.com/repos/botpress/botpress-slack/events","assignees_url":"https://api.github.com/repos/botpress/botpress-slack/assignees{/user}","branches_url":"https://api.github.com/repos/botpress/botpress-slack/branches{/branch}","tags_url":"https://api.github.com/repos/botpress/botpress-slack/tags","blobs_url":"https://api.github.com/repos/botpress/botpress-slack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/botpress/botpress-slack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/botpress/botpress-slack/git/refs{/sha}","trees_url":"https://api.github.com/repos/botpress/botpress-slack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/botpress/botpress-slack/statuses/{sha}","languages_url":"https://api.github.com/repos/botpress/botpress-slack/languages","stargazers_url":"https://api.github.com/repos/botpress/botpress-slack/stargazers","contributors_url":"https://api.github.com/repos/botpress/botpress-slack/contributors","subscribers_url":"https://api.github.com/repos/botpress/botpress-slack/subscribers","subscription_url":"https://api.github.com/repos/botpress/botpress-slack/subscription","commits_url":"https://api.github.com/repos/botpress/botpress-slack/commits{/sha}","git_commits_url":"https://api.github.com/repos/botpress/botpress-slack/git/commits{/sha}","comments_url":"https://api.github.com/repos/botpress/botpress-slack/comments{/number}","issue_comment_url":"https://api.github.com/repos/botpress/botpress-slack/issues/comments{/number}","contents_url":"https://api.github.com/repos/botpress/botpress-slack/contents/{+path}","compare_url":"https://api.github.com/repos/botpress/botpress-slack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/botpress/botpress-slack/merges","archive_url":"https://api.github.com/repos/botpress/botpress-slack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/botpress/botpress-slack/downloads","issues_url":"https://api.github.com/repos/botpress/botpress-slack/issues{/number}","pulls_url":"https://api.github.com/repos/botpress/botpress-slack/pulls{/number}","milestones_url":"https://api.github.com/repos/botpress/botpress-slack/milestones{/number}","notifications_url":"https://api.github.com/repos/botpress/botpress-slack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/botpress/botpress-slack/labels{/name}","releases_url":"https://api.github.com/repos/botpress/botpress-slack/releases{/id}","deployments_url":"https://api.github.com/repos/botpress/botpress-slack/deployments","created_at":"2016-11-16T22:34:29Z","updated_at":"2016-12-02T17:25:09Z","pushed_at":"2017-01-01T09:49:39Z","git_url":"git://github.com/botpress/botpress-slack.git","ssh_url":"git@github.com:botpress/botpress-slack.git","clone_url":"https://github.com/botpress/botpress-slack.git","svn_url":"https://github.com/botpress/botpress-slack","homepage":null,"size":28,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"botpress:develop","ref":"develop","sha":"e90f39ba1265a2ef704aa0b467a6e6cc083c8c39","user":{"login":"botpress","id":23510677,"avatar_url":"https://avatars.githubusercontent.com/u/23510677?v=3","gravatar_id":"","url":"https://api.github.com/users/botpress","html_url":"https://github.com/botpress","followers_url":"https://api.github.com/users/botpress/followers","following_url":"https://api.github.com/users/botpress/following{/other_user}","gists_url":"https://api.github.com/users/botpress/gists{/gist_id}","starred_url":"https://api.github.com/users/botpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botpress/subscriptions","organizations_url":"https://api.github.com/users/botpress/orgs","repos_url":"https://api.github.com/users/botpress/repos","events_url":"https://api.github.com/users/botpress/events{/privacy}","received_events_url":"https://api.github.com/users/botpress/received_events","type":"Organization","site_admin":false},"repo":{"id":73967451,"name":"botpress-slack","full_name":"botpress/botpress-slack","owner":{"login":"botpress","id":23510677,"avatar_url":"https://avatars.githubusercontent.com/u/23510677?v=3","gravatar_id":"","url":"https://api.github.com/users/botpress","html_url":"https://github.com/botpress","followers_url":"https://api.github.com/users/botpress/followers","following_url":"https://api.github.com/users/botpress/following{/other_user}","gists_url":"https://api.github.com/users/botpress/gists{/gist_id}","starred_url":"https://api.github.com/users/botpress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botpress/subscriptions","organizations_url":"https://api.github.com/users/botpress/orgs","repos_url":"https://api.github.com/users/botpress/repos","events_url":"https://api.github.com/users/botpress/events{/privacy}","received_events_url":"https://api.github.com/users/botpress/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/botpress/botpress-slack","description":null,"fork":false,"url":"https://api.github.com/repos/botpress/botpress-slack","forks_url":"https://api.github.com/repos/botpress/botpress-slack/forks","keys_url":"https://api.github.com/repos/botpress/botpress-slack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/botpress/botpress-slack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/botpress/botpress-slack/teams","hooks_url":"https://api.github.com/repos/botpress/botpress-slack/hooks","issue_events_url":"https://api.github.com/repos/botpress/botpress-slack/issues/events{/number}","events_url":"https://api.github.com/repos/botpress/botpress-slack/events","assignees_url":"https://api.github.com/repos/botpress/botpress-slack/assignees{/user}","branches_url":"https://api.github.com/repos/botpress/botpress-slack/branches{/branch}","tags_url":"https://api.github.com/repos/botpress/botpress-slack/tags","blobs_url":"https://api.github.com/repos/botpress/botpress-slack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/botpress/botpress-slack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/botpress/botpress-slack/git/refs{/sha}","trees_url":"https://api.github.com/repos/botpress/botpress-slack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/botpress/botpress-slack/statuses/{sha}","languages_url":"https://api.github.com/repos/botpress/botpress-slack/languages","stargazers_url":"https://api.github.com/repos/botpress/botpress-slack/stargazers","contributors_url":"https://api.github.com/repos/botpress/botpress-slack/contributors","subscribers_url":"https://api.github.com/repos/botpress/botpress-slack/subscribers","subscription_url":"https://api.github.com/repos/botpress/botpress-slack/subscription","commits_url":"https://api.github.com/repos/botpress/botpress-slack/commits{/sha}","git_commits_url":"https://api.github.com/repos/botpress/botpress-slack/git/commits{/sha}","comments_url":"https://api.github.com/repos/botpress/botpress-slack/comments{/number}","issue_comment_url":"https://api.github.com/repos/botpress/botpress-slack/issues/comments{/number}","contents_url":"https://api.github.com/repos/botpress/botpress-slack/contents/{+path}","compare_url":"https://api.github.com/repos/botpress/botpress-slack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/botpress/botpress-slack/merges","archive_url":"https://api.github.com/repos/botpress/botpress-slack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/botpress/botpress-slack/downloads","issues_url":"https://api.github.com/repos/botpress/botpress-slack/issues{/number}","pulls_url":"https://api.github.com/repos/botpress/botpress-slack/pulls{/number}","milestones_url":"https://api.github.com/repos/botpress/botpress-slack/milestones{/number}","notifications_url":"https://api.github.com/repos/botpress/botpress-slack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/botpress/botpress-slack/labels{/name}","releases_url":"https://api.github.com/repos/botpress/botpress-slack/releases{/id}","deployments_url":"https://api.github.com/repos/botpress/botpress-slack/deployments","created_at":"2016-11-16T22:34:29Z","updated_at":"2016-12-02T17:25:09Z","pushed_at":"2017-01-01T09:49:39Z","git_url":"git://github.com/botpress/botpress-slack.git","ssh_url":"git@github.com:botpress/botpress-slack.git","clone_url":"https://github.com/botpress/botpress-slack.git","svn_url":"https://github.com/botpress/botpress-slack","homepage":null,"size":28,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/botpress/botpress-slack/pulls/1"},"html":{"href":"https://github.com/botpress/botpress-slack/pull/1"},"issue":{"href":"https://api.github.com/repos/botpress/botpress-slack/issues/1"},"comments":{"href":"https://api.github.com/repos/botpress/botpress-slack/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/botpress/botpress-slack/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/botpress/botpress-slack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/botpress/botpress-slack/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/botpress/botpress-slack/statuses/b5b7628af3488a0517a7b693c90a5a5785da8fb8"}}}}
{"actor":{"display_login":"slvnperron"}}