{"action":"created","comment":{"url":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/comments/99769324","pull_request_review_id":20453369,"id":99769324,"diff_hunk":"@@ -0,0 +1,110 @@\n+# Description:\n+#   Позволяет узнать лучших сотрудников (в плане отработанного времени) за этот или за прошлый месяц\n+#\n+# Commands:\n+#   hubot кто молодец в этом месяце - Покажет Вам список сотрудников с их отработанным временем, по текущему месяцу\n+#   hubot кто молодец в прошлом месяце - Покажет список сотрудников с их отработанным временем, за прошлый месяц\n+#\n+# Author:\n+#   artem.telnov@kodep.ru\n+#\n+\n+request = require('axios')\n+Promise = require('bluebird')\n+\n+module.exports = (robot) ->\n+  durationService = new QuiryAPI()\n+\n+\n+  # Duration This Month\n+  #\n+  robot.respond /(кто молодец в этом месяце)/i, (res) ->\n+    durationService.getCount('duration', 'current')\n+    .then((result) -> res.send(result))\n+    .catch((err) ->\n+      robot.logger.error err\n+      res.reply 'Я занят, попросите позже'\n+    )\n+\n+  robot.router.post '/hubot/duration_this_month', (req, res) ->\n+    durationService.getCount('duration', 'current')\n+    .then((result) -> res.json({text: result}))\n+    .catch((err) ->\n+      robot.logger.error err\n+      res.status(500).json({text: 'Я занят, попросите позже'})\n+    )\n+  # Approved This Month\n+  #\n+  # robot.respond /(кто самый оплачиваемый)/i, (res) ->\n+  #   durationService.getCount('approved_duration', 'current')\n+  #   .then((result) -> res.send(result))\n+  #   .catch((err) ->\n+  #     robot.logger.error err\n+  #     res.reply 'Я занят, попросите позже'\n+  #   )\n+  #\n+  # robot.router.post '/hubot/approved_duration_this_month', (req, res) ->\n+  #   durationService.getCount('approved_duration', 'current')\n+  #   .then((result) -> res.json({text: result}))\n+  #   .catch((err) ->\n+  #     robot.logger.error err\n+  #     res.status(500).json({text: 'Я занят, попросите позже'})\n+  #   )\n+\n+  # Duration Previous Month\n+  #\n+  robot.respond /(кто молодец в прошлом месяце)/i, (res) ->\n+    durationService.getCount('duration', 'previous')\n+    .then((result) -> res.send(result))\n+    .catch((err) ->\n+      robot.logger.error err\n+      res.reply 'Я занят, попросите позже'\n+    )\n+\n+  robot.router.post '/hubot/duration_previous_month', (req, res) ->\n+    durationService.getCount('duration', 'previos')\n+    .then((result) -> res.json({text: result}))\n+    .catch((err) ->\n+      robot.logger.error err\n+      res.status(500).json({text: 'Я занят, попросите позже'})\n+    )\n+\n+  # Approved Previous Month\n+  #\n+  # robot.respond /(кто был самым оплачиваемый)|(кому мы скажем спасибо за прошлый месяц)|(кто в прошлом месяце принес денег)/i, (res) ->\n+  #   durationService.getCount('approved_duration', 'previous')\n+  #   .then((result) -> res.send(result))\n+  #   .catch((err) ->\n+  #     robot.logger.error err\n+  #     res.reply 'Я занят, попросите позже'\n+  #   )\n+  #\n+  # robot.router.post '/hubot/approved_duration_previous_month', (req, res) ->\n+  #   durationService.getCount('approved_duration', 'previos')\n+  #   .then((result) -> res.json({text: result}))\n+  #   .catch((err) ->\n+  #     robot.logger.error err\n+  #     res.status(500).json({text: 'Я занят, попросите позже'})\n+  #   )\n+\n+class QuiryAPI\n+  TTL: 5","path":"scripts/who_is_better.coffee","position":90,"original_position":91,"commit_id":"ecb6924e8b8a7d348672a8f6cc1024c55a1decc3","original_commit_id":"ecb6924e8b8a7d348672a8f6cc1024c55a1decc3","user":{"login":"khmm12","id":4437249,"avatar_url":"https://avatars.githubusercontent.com/u/4437249?v=3","gravatar_id":"","url":"https://api.github.com/users/khmm12","html_url":"https://github.com/khmm12","followers_url":"https://api.github.com/users/khmm12/followers","following_url":"https://api.github.com/users/khmm12/following{/other_user}","gists_url":"https://api.github.com/users/khmm12/gists{/gist_id}","starred_url":"https://api.github.com/users/khmm12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khmm12/subscriptions","organizations_url":"https://api.github.com/users/khmm12/orgs","repos_url":"https://api.github.com/users/khmm12/repos","events_url":"https://api.github.com/users/khmm12/events{/privacy}","received_events_url":"https://api.github.com/users/khmm12/received_events","type":"User","site_admin":false},"body":"unnecessary","created_at":"2017-02-07T08:44:22Z","updated_at":"2017-02-07T08:44:22Z","html_url":"https://github.com/kodep/kodep-jarvis/pull/1#discussion_r99769324","pull_request_url":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/comments/99769324"},"html":{"href":"https://github.com/kodep/kodep-jarvis/pull/1#discussion_r99769324"},"pull_request":{"href":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/1","id":104950394,"html_url":"https://github.com/kodep/kodep-jarvis/pull/1","diff_url":"https://github.com/kodep/kodep-jarvis/pull/1.diff","patch_url":"https://github.com/kodep/kodep-jarvis/pull/1.patch","issue_url":"https://api.github.com/repos/kodep/kodep-jarvis/issues/1","number":1,"state":"open","locked":false,"title":"who_is_better","user":{"login":"baradabacka","id":22814057,"avatar_url":"https://avatars.githubusercontent.com/u/22814057?v=3","gravatar_id":"","url":"https://api.github.com/users/baradabacka","html_url":"https://github.com/baradabacka","followers_url":"https://api.github.com/users/baradabacka/followers","following_url":"https://api.github.com/users/baradabacka/following{/other_user}","gists_url":"https://api.github.com/users/baradabacka/gists{/gist_id}","starred_url":"https://api.github.com/users/baradabacka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baradabacka/subscriptions","organizations_url":"https://api.github.com/users/baradabacka/orgs","repos_url":"https://api.github.com/users/baradabacka/repos","events_url":"https://api.github.com/users/baradabacka/events{/privacy}","received_events_url":"https://api.github.com/users/baradabacka/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-02-07T07:29:19Z","updated_at":"2017-02-07T08:44:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f63d274b7fc0ae27a72a300357c5a2ac1a532ad0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/1/commits","review_comments_url":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/1/comments","review_comment_url":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kodep/kodep-jarvis/issues/1/comments","statuses_url":"https://api.github.com/repos/kodep/kodep-jarvis/statuses/ecb6924e8b8a7d348672a8f6cc1024c55a1decc3","head":{"label":"kodep:time_tracker_bot","ref":"time_tracker_bot","sha":"ecb6924e8b8a7d348672a8f6cc1024c55a1decc3","user":{"login":"kodep","id":6205176,"avatar_url":"https://avatars.githubusercontent.com/u/6205176?v=3","gravatar_id":"","url":"https://api.github.com/users/kodep","html_url":"https://github.com/kodep","followers_url":"https://api.github.com/users/kodep/followers","following_url":"https://api.github.com/users/kodep/following{/other_user}","gists_url":"https://api.github.com/users/kodep/gists{/gist_id}","starred_url":"https://api.github.com/users/kodep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodep/subscriptions","organizations_url":"https://api.github.com/users/kodep/orgs","repos_url":"https://api.github.com/users/kodep/repos","events_url":"https://api.github.com/users/kodep/events{/privacy}","received_events_url":"https://api.github.com/users/kodep/received_events","type":"Organization","site_admin":false},"repo":{"id":47421332,"name":"kodep-jarvis","full_name":"kodep/kodep-jarvis","owner":{"login":"kodep","id":6205176,"avatar_url":"https://avatars.githubusercontent.com/u/6205176?v=3","gravatar_id":"","url":"https://api.github.com/users/kodep","html_url":"https://github.com/kodep","followers_url":"https://api.github.com/users/kodep/followers","following_url":"https://api.github.com/users/kodep/following{/other_user}","gists_url":"https://api.github.com/users/kodep/gists{/gist_id}","starred_url":"https://api.github.com/users/kodep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodep/subscriptions","organizations_url":"https://api.github.com/users/kodep/orgs","repos_url":"https://api.github.com/users/kodep/repos","events_url":"https://api.github.com/users/kodep/events{/privacy}","received_events_url":"https://api.github.com/users/kodep/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kodep/kodep-jarvis","description":"Butler of Kodep LLC","fork":false,"url":"https://api.github.com/repos/kodep/kodep-jarvis","forks_url":"https://api.github.com/repos/kodep/kodep-jarvis/forks","keys_url":"https://api.github.com/repos/kodep/kodep-jarvis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kodep/kodep-jarvis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kodep/kodep-jarvis/teams","hooks_url":"https://api.github.com/repos/kodep/kodep-jarvis/hooks","issue_events_url":"https://api.github.com/repos/kodep/kodep-jarvis/issues/events{/number}","events_url":"https://api.github.com/repos/kodep/kodep-jarvis/events","assignees_url":"https://api.github.com/repos/kodep/kodep-jarvis/assignees{/user}","branches_url":"https://api.github.com/repos/kodep/kodep-jarvis/branches{/branch}","tags_url":"https://api.github.com/repos/kodep/kodep-jarvis/tags","blobs_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/refs{/sha}","trees_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kodep/kodep-jarvis/statuses/{sha}","languages_url":"https://api.github.com/repos/kodep/kodep-jarvis/languages","stargazers_url":"https://api.github.com/repos/kodep/kodep-jarvis/stargazers","contributors_url":"https://api.github.com/repos/kodep/kodep-jarvis/contributors","subscribers_url":"https://api.github.com/repos/kodep/kodep-jarvis/subscribers","subscription_url":"https://api.github.com/repos/kodep/kodep-jarvis/subscription","commits_url":"https://api.github.com/repos/kodep/kodep-jarvis/commits{/sha}","git_commits_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/commits{/sha}","comments_url":"https://api.github.com/repos/kodep/kodep-jarvis/comments{/number}","issue_comment_url":"https://api.github.com/repos/kodep/kodep-jarvis/issues/comments{/number}","contents_url":"https://api.github.com/repos/kodep/kodep-jarvis/contents/{+path}","compare_url":"https://api.github.com/repos/kodep/kodep-jarvis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kodep/kodep-jarvis/merges","archive_url":"https://api.github.com/repos/kodep/kodep-jarvis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kodep/kodep-jarvis/downloads","issues_url":"https://api.github.com/repos/kodep/kodep-jarvis/issues{/number}","pulls_url":"https://api.github.com/repos/kodep/kodep-jarvis/pulls{/number}","milestones_url":"https://api.github.com/repos/kodep/kodep-jarvis/milestones{/number}","notifications_url":"https://api.github.com/repos/kodep/kodep-jarvis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kodep/kodep-jarvis/labels{/name}","releases_url":"https://api.github.com/repos/kodep/kodep-jarvis/releases{/id}","deployments_url":"https://api.github.com/repos/kodep/kodep-jarvis/deployments","created_at":"2015-12-04T18:16:00Z","updated_at":"2016-02-05T13:47:45Z","pushed_at":"2017-02-07T08:35:29Z","git_url":"git://github.com/kodep/kodep-jarvis.git","ssh_url":"git@github.com:kodep/kodep-jarvis.git","clone_url":"https://github.com/kodep/kodep-jarvis.git","svn_url":"https://github.com/kodep/kodep-jarvis","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"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":"kodep:master","ref":"master","sha":"874805c8f72d683068539d6a6fd8e4eb257f44c2","user":{"login":"kodep","id":6205176,"avatar_url":"https://avatars.githubusercontent.com/u/6205176?v=3","gravatar_id":"","url":"https://api.github.com/users/kodep","html_url":"https://github.com/kodep","followers_url":"https://api.github.com/users/kodep/followers","following_url":"https://api.github.com/users/kodep/following{/other_user}","gists_url":"https://api.github.com/users/kodep/gists{/gist_id}","starred_url":"https://api.github.com/users/kodep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodep/subscriptions","organizations_url":"https://api.github.com/users/kodep/orgs","repos_url":"https://api.github.com/users/kodep/repos","events_url":"https://api.github.com/users/kodep/events{/privacy}","received_events_url":"https://api.github.com/users/kodep/received_events","type":"Organization","site_admin":false},"repo":{"id":47421332,"name":"kodep-jarvis","full_name":"kodep/kodep-jarvis","owner":{"login":"kodep","id":6205176,"avatar_url":"https://avatars.githubusercontent.com/u/6205176?v=3","gravatar_id":"","url":"https://api.github.com/users/kodep","html_url":"https://github.com/kodep","followers_url":"https://api.github.com/users/kodep/followers","following_url":"https://api.github.com/users/kodep/following{/other_user}","gists_url":"https://api.github.com/users/kodep/gists{/gist_id}","starred_url":"https://api.github.com/users/kodep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodep/subscriptions","organizations_url":"https://api.github.com/users/kodep/orgs","repos_url":"https://api.github.com/users/kodep/repos","events_url":"https://api.github.com/users/kodep/events{/privacy}","received_events_url":"https://api.github.com/users/kodep/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kodep/kodep-jarvis","description":"Butler of Kodep LLC","fork":false,"url":"https://api.github.com/repos/kodep/kodep-jarvis","forks_url":"https://api.github.com/repos/kodep/kodep-jarvis/forks","keys_url":"https://api.github.com/repos/kodep/kodep-jarvis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kodep/kodep-jarvis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kodep/kodep-jarvis/teams","hooks_url":"https://api.github.com/repos/kodep/kodep-jarvis/hooks","issue_events_url":"https://api.github.com/repos/kodep/kodep-jarvis/issues/events{/number}","events_url":"https://api.github.com/repos/kodep/kodep-jarvis/events","assignees_url":"https://api.github.com/repos/kodep/kodep-jarvis/assignees{/user}","branches_url":"https://api.github.com/repos/kodep/kodep-jarvis/branches{/branch}","tags_url":"https://api.github.com/repos/kodep/kodep-jarvis/tags","blobs_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/refs{/sha}","trees_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kodep/kodep-jarvis/statuses/{sha}","languages_url":"https://api.github.com/repos/kodep/kodep-jarvis/languages","stargazers_url":"https://api.github.com/repos/kodep/kodep-jarvis/stargazers","contributors_url":"https://api.github.com/repos/kodep/kodep-jarvis/contributors","subscribers_url":"https://api.github.com/repos/kodep/kodep-jarvis/subscribers","subscription_url":"https://api.github.com/repos/kodep/kodep-jarvis/subscription","commits_url":"https://api.github.com/repos/kodep/kodep-jarvis/commits{/sha}","git_commits_url":"https://api.github.com/repos/kodep/kodep-jarvis/git/commits{/sha}","comments_url":"https://api.github.com/repos/kodep/kodep-jarvis/comments{/number}","issue_comment_url":"https://api.github.com/repos/kodep/kodep-jarvis/issues/comments{/number}","contents_url":"https://api.github.com/repos/kodep/kodep-jarvis/contents/{+path}","compare_url":"https://api.github.com/repos/kodep/kodep-jarvis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kodep/kodep-jarvis/merges","archive_url":"https://api.github.com/repos/kodep/kodep-jarvis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kodep/kodep-jarvis/downloads","issues_url":"https://api.github.com/repos/kodep/kodep-jarvis/issues{/number}","pulls_url":"https://api.github.com/repos/kodep/kodep-jarvis/pulls{/number}","milestones_url":"https://api.github.com/repos/kodep/kodep-jarvis/milestones{/number}","notifications_url":"https://api.github.com/repos/kodep/kodep-jarvis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kodep/kodep-jarvis/labels{/name}","releases_url":"https://api.github.com/repos/kodep/kodep-jarvis/releases{/id}","deployments_url":"https://api.github.com/repos/kodep/kodep-jarvis/deployments","created_at":"2015-12-04T18:16:00Z","updated_at":"2016-02-05T13:47:45Z","pushed_at":"2017-02-07T08:35:29Z","git_url":"git://github.com/kodep/kodep-jarvis.git","ssh_url":"git@github.com:kodep/kodep-jarvis.git","clone_url":"https://github.com/kodep/kodep-jarvis.git","svn_url":"https://github.com/kodep/kodep-jarvis","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"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/kodep/kodep-jarvis/pulls/1"},"html":{"href":"https://github.com/kodep/kodep-jarvis/pull/1"},"issue":{"href":"https://api.github.com/repos/kodep/kodep-jarvis/issues/1"},"comments":{"href":"https://api.github.com/repos/kodep/kodep-jarvis/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kodep/kodep-jarvis/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/kodep/kodep-jarvis/statuses/ecb6924e8b8a7d348672a8f6cc1024c55a1decc3"}}}}
{"actor":{"display_login":"khmm12"}}