{"action":"created","comment":{"url":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/comments/173625348","pull_request_review_id":102854083,"id":173625348,"diff_hunk":"@@ -10,13 +11,40 @@ const client = new Discord.Client();\n // Pre-load controllers\n const controllers = require('./controllers')();\n \n+// Award bonus points\n+const awardBonusPoints = async (user) => {\n+  const numberOfMessagesForBonus = 1000;\n+  const amountOfBonusPoints = 100;\n+  // Get User Message Count\n+  const memberData = await models.Member.findAll(\n+    {\n+      attributes: ['messagesCount', 'points'],\n+      where: { discordUser: user.author.id },\n+    },\n+  );\n+  let { messagesCount } = memberData[0].dataValues;\n+  let { points } = memberData[0].dataValues;","path":"bot/client.js","position":24,"original_position":24,"commit_id":"d7df179be0d88025e04cf06994375d8b3a9313e4","original_commit_id":"d7df179be0d88025e04cf06994375d8b3a9313e4","user":{"login":"krogers78","id":28968652,"avatar_url":"https://avatars2.githubusercontent.com/u/28968652?v=4","gravatar_id":"","url":"https://api.github.com/users/krogers78","html_url":"https://github.com/krogers78","followers_url":"https://api.github.com/users/krogers78/followers","following_url":"https://api.github.com/users/krogers78/following{/other_user}","gists_url":"https://api.github.com/users/krogers78/gists{/gist_id}","starred_url":"https://api.github.com/users/krogers78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krogers78/subscriptions","organizations_url":"https://api.github.com/users/krogers78/orgs","repos_url":"https://api.github.com/users/krogers78/repos","events_url":"https://api.github.com/users/krogers78/events{/privacy}","received_events_url":"https://api.github.com/users/krogers78/received_events","type":"User","site_admin":false},"body":"Hey! If you wanted to you could condense these two lines into one. When deconstructing a variable, you can add multiple items... For example here you could say `let { messagesCount, points } = memberData[0].dataValues;` and it would say the same thing with one less line of code. They could also be made a const too since they don't change.","created_at":"2018-03-10T15:34:11Z","updated_at":"2018-03-10T15:34:23Z","html_url":"https://github.com/reactivepixel/Max-Bot/pull/119#discussion_r173625348","pull_request_url":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/119","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/comments/173625348"},"html":{"href":"https://github.com/reactivepixel/Max-Bot/pull/119#discussion_r173625348"},"pull_request":{"href":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/119"}}},"pull_request":{"url":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/119","id":174148129,"html_url":"https://github.com/reactivepixel/Max-Bot/pull/119","diff_url":"https://github.com/reactivepixel/Max-Bot/pull/119.diff","patch_url":"https://github.com/reactivepixel/Max-Bot/pull/119.patch","issue_url":"https://api.github.com/repos/reactivepixel/Max-Bot/issues/119","number":119,"state":"open","locked":false,"title":"Award bonus points","user":{"login":"drubiodev","id":11436921,"avatar_url":"https://avatars3.githubusercontent.com/u/11436921?v=4","gravatar_id":"","url":"https://api.github.com/users/drubiodev","html_url":"https://github.com/drubiodev","followers_url":"https://api.github.com/users/drubiodev/followers","following_url":"https://api.github.com/users/drubiodev/following{/other_user}","gists_url":"https://api.github.com/users/drubiodev/gists{/gist_id}","starred_url":"https://api.github.com/users/drubiodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drubiodev/subscriptions","organizations_url":"https://api.github.com/users/drubiodev/orgs","repos_url":"https://api.github.com/users/drubiodev/repos","events_url":"https://api.github.com/users/drubiodev/events{/privacy}","received_events_url":"https://api.github.com/users/drubiodev/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-10T02:24:28Z","updated_at":"2018-03-10T15:34:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1164a5c5f879f52fb5e06a55ca34477ec7d7af9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/119/commits","review_comments_url":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/119/comments","review_comment_url":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reactivepixel/Max-Bot/issues/119/comments","statuses_url":"https://api.github.com/repos/reactivepixel/Max-Bot/statuses/d7df179be0d88025e04cf06994375d8b3a9313e4","head":{"label":"reactivepixel:award-bonus-points","ref":"award-bonus-points","sha":"d7df179be0d88025e04cf06994375d8b3a9313e4","user":{"login":"reactivepixel","id":430063,"avatar_url":"https://avatars1.githubusercontent.com/u/430063?v=4","gravatar_id":"","url":"https://api.github.com/users/reactivepixel","html_url":"https://github.com/reactivepixel","followers_url":"https://api.github.com/users/reactivepixel/followers","following_url":"https://api.github.com/users/reactivepixel/following{/other_user}","gists_url":"https://api.github.com/users/reactivepixel/gists{/gist_id}","starred_url":"https://api.github.com/users/reactivepixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactivepixel/subscriptions","organizations_url":"https://api.github.com/users/reactivepixel/orgs","repos_url":"https://api.github.com/users/reactivepixel/repos","events_url":"https://api.github.com/users/reactivepixel/events{/privacy}","received_events_url":"https://api.github.com/users/reactivepixel/received_events","type":"User","site_admin":false},"repo":{"id":100329642,"name":"Max-Bot","full_name":"reactivepixel/Max-Bot","owner":{"login":"reactivepixel","id":430063,"avatar_url":"https://avatars1.githubusercontent.com/u/430063?v=4","gravatar_id":"","url":"https://api.github.com/users/reactivepixel","html_url":"https://github.com/reactivepixel","followers_url":"https://api.github.com/users/reactivepixel/followers","following_url":"https://api.github.com/users/reactivepixel/following{/other_user}","gists_url":"https://api.github.com/users/reactivepixel/gists{/gist_id}","starred_url":"https://api.github.com/users/reactivepixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactivepixel/subscriptions","organizations_url":"https://api.github.com/users/reactivepixel/orgs","repos_url":"https://api.github.com/users/reactivepixel/repos","events_url":"https://api.github.com/users/reactivepixel/events{/privacy}","received_events_url":"https://api.github.com/users/reactivepixel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reactivepixel/Max-Bot","description":"Official Bot of the Full Sail Armada","fork":false,"url":"https://api.github.com/repos/reactivepixel/Max-Bot","forks_url":"https://api.github.com/repos/reactivepixel/Max-Bot/forks","keys_url":"https://api.github.com/repos/reactivepixel/Max-Bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reactivepixel/Max-Bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reactivepixel/Max-Bot/teams","hooks_url":"https://api.github.com/repos/reactivepixel/Max-Bot/hooks","issue_events_url":"https://api.github.com/repos/reactivepixel/Max-Bot/issues/events{/number}","events_url":"https://api.github.com/repos/reactivepixel/Max-Bot/events","assignees_url":"https://api.github.com/repos/reactivepixel/Max-Bot/assignees{/user}","branches_url":"https://api.github.com/repos/reactivepixel/Max-Bot/branches{/branch}","tags_url":"https://api.github.com/repos/reactivepixel/Max-Bot/tags","blobs_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reactivepixel/Max-Bot/statuses/{sha}","languages_url":"https://api.github.com/repos/reactivepixel/Max-Bot/languages","stargazers_url":"https://api.github.com/repos/reactivepixel/Max-Bot/stargazers","contributors_url":"https://api.github.com/repos/reactivepixel/Max-Bot/contributors","subscribers_url":"https://api.github.com/repos/reactivepixel/Max-Bot/subscribers","subscription_url":"https://api.github.com/repos/reactivepixel/Max-Bot/subscription","commits_url":"https://api.github.com/repos/reactivepixel/Max-Bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/reactivepixel/Max-Bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/reactivepixel/Max-Bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/reactivepixel/Max-Bot/contents/{+path}","compare_url":"https://api.github.com/repos/reactivepixel/Max-Bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reactivepixel/Max-Bot/merges","archive_url":"https://api.github.com/repos/reactivepixel/Max-Bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reactivepixel/Max-Bot/downloads","issues_url":"https://api.github.com/repos/reactivepixel/Max-Bot/issues{/number}","pulls_url":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls{/number}","milestones_url":"https://api.github.com/repos/reactivepixel/Max-Bot/milestones{/number}","notifications_url":"https://api.github.com/repos/reactivepixel/Max-Bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reactivepixel/Max-Bot/labels{/name}","releases_url":"https://api.github.com/repos/reactivepixel/Max-Bot/releases{/id}","deployments_url":"https://api.github.com/repos/reactivepixel/Max-Bot/deployments","created_at":"2017-08-15T02:27:00Z","updated_at":"2017-11-12T21:45:06Z","pushed_at":"2018-03-10T02:24:28Z","git_url":"git://github.com/reactivepixel/Max-Bot.git","ssh_url":"git@github.com:reactivepixel/Max-Bot.git","clone_url":"https://github.com/reactivepixel/Max-Bot.git","svn_url":"https://github.com/reactivepixel/Max-Bot","homepage":"","size":211,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":41,"license":null,"forks":13,"open_issues":41,"watchers":3,"default_branch":"dev"}},"base":{"label":"reactivepixel:rewardsSystem","ref":"rewardsSystem","sha":"874416f8faf478b7b4ea7d5303423202466a1376","user":{"login":"reactivepixel","id":430063,"avatar_url":"https://avatars1.githubusercontent.com/u/430063?v=4","gravatar_id":"","url":"https://api.github.com/users/reactivepixel","html_url":"https://github.com/reactivepixel","followers_url":"https://api.github.com/users/reactivepixel/followers","following_url":"https://api.github.com/users/reactivepixel/following{/other_user}","gists_url":"https://api.github.com/users/reactivepixel/gists{/gist_id}","starred_url":"https://api.github.com/users/reactivepixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactivepixel/subscriptions","organizations_url":"https://api.github.com/users/reactivepixel/orgs","repos_url":"https://api.github.com/users/reactivepixel/repos","events_url":"https://api.github.com/users/reactivepixel/events{/privacy}","received_events_url":"https://api.github.com/users/reactivepixel/received_events","type":"User","site_admin":false},"repo":{"id":100329642,"name":"Max-Bot","full_name":"reactivepixel/Max-Bot","owner":{"login":"reactivepixel","id":430063,"avatar_url":"https://avatars1.githubusercontent.com/u/430063?v=4","gravatar_id":"","url":"https://api.github.com/users/reactivepixel","html_url":"https://github.com/reactivepixel","followers_url":"https://api.github.com/users/reactivepixel/followers","following_url":"https://api.github.com/users/reactivepixel/following{/other_user}","gists_url":"https://api.github.com/users/reactivepixel/gists{/gist_id}","starred_url":"https://api.github.com/users/reactivepixel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactivepixel/subscriptions","organizations_url":"https://api.github.com/users/reactivepixel/orgs","repos_url":"https://api.github.com/users/reactivepixel/repos","events_url":"https://api.github.com/users/reactivepixel/events{/privacy}","received_events_url":"https://api.github.com/users/reactivepixel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reactivepixel/Max-Bot","description":"Official Bot of the Full Sail Armada","fork":false,"url":"https://api.github.com/repos/reactivepixel/Max-Bot","forks_url":"https://api.github.com/repos/reactivepixel/Max-Bot/forks","keys_url":"https://api.github.com/repos/reactivepixel/Max-Bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reactivepixel/Max-Bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reactivepixel/Max-Bot/teams","hooks_url":"https://api.github.com/repos/reactivepixel/Max-Bot/hooks","issue_events_url":"https://api.github.com/repos/reactivepixel/Max-Bot/issues/events{/number}","events_url":"https://api.github.com/repos/reactivepixel/Max-Bot/events","assignees_url":"https://api.github.com/repos/reactivepixel/Max-Bot/assignees{/user}","branches_url":"https://api.github.com/repos/reactivepixel/Max-Bot/branches{/branch}","tags_url":"https://api.github.com/repos/reactivepixel/Max-Bot/tags","blobs_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reactivepixel/Max-Bot/statuses/{sha}","languages_url":"https://api.github.com/repos/reactivepixel/Max-Bot/languages","stargazers_url":"https://api.github.com/repos/reactivepixel/Max-Bot/stargazers","contributors_url":"https://api.github.com/repos/reactivepixel/Max-Bot/contributors","subscribers_url":"https://api.github.com/repos/reactivepixel/Max-Bot/subscribers","subscription_url":"https://api.github.com/repos/reactivepixel/Max-Bot/subscription","commits_url":"https://api.github.com/repos/reactivepixel/Max-Bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/reactivepixel/Max-Bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/reactivepixel/Max-Bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/reactivepixel/Max-Bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/reactivepixel/Max-Bot/contents/{+path}","compare_url":"https://api.github.com/repos/reactivepixel/Max-Bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reactivepixel/Max-Bot/merges","archive_url":"https://api.github.com/repos/reactivepixel/Max-Bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reactivepixel/Max-Bot/downloads","issues_url":"https://api.github.com/repos/reactivepixel/Max-Bot/issues{/number}","pulls_url":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls{/number}","milestones_url":"https://api.github.com/repos/reactivepixel/Max-Bot/milestones{/number}","notifications_url":"https://api.github.com/repos/reactivepixel/Max-Bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reactivepixel/Max-Bot/labels{/name}","releases_url":"https://api.github.com/repos/reactivepixel/Max-Bot/releases{/id}","deployments_url":"https://api.github.com/repos/reactivepixel/Max-Bot/deployments","created_at":"2017-08-15T02:27:00Z","updated_at":"2017-11-12T21:45:06Z","pushed_at":"2018-03-10T02:24:28Z","git_url":"git://github.com/reactivepixel/Max-Bot.git","ssh_url":"git@github.com:reactivepixel/Max-Bot.git","clone_url":"https://github.com/reactivepixel/Max-Bot.git","svn_url":"https://github.com/reactivepixel/Max-Bot","homepage":"","size":211,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":41,"license":null,"forks":13,"open_issues":41,"watchers":3,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/119"},"html":{"href":"https://github.com/reactivepixel/Max-Bot/pull/119"},"issue":{"href":"https://api.github.com/repos/reactivepixel/Max-Bot/issues/119"},"comments":{"href":"https://api.github.com/repos/reactivepixel/Max-Bot/issues/119/comments"},"review_comments":{"href":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/119/comments"},"review_comment":{"href":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reactivepixel/Max-Bot/pulls/119/commits"},"statuses":{"href":"https://api.github.com/repos/reactivepixel/Max-Bot/statuses/d7df179be0d88025e04cf06994375d8b3a9313e4"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"krogers78"}}