{"action":"created","comment":{"url":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/comments/96781211","pull_request_review_id":17373388,"id":96781211,"diff_hunk":"@@ -1,21 +1,35 @@\n+const Discord = require('discord.js');\n const firebase = require('firebase');\n-const moment = require('moment');\n-const format = require('../momentFormat');\n+const splitargs = require('splitargs');\n+const juration = require('juration');\n \n module.exports = {\n-  usage: '[@user]',\n+  usage: '[@user] [30m]',\n   description: 'ADMIN ONLY: Give a user the \\'Restricted\\' role for 30 minutes. Will also remove the \\'18+\\' role.',\n   allowDM: false,\n   requireRoles: ['Admin', 'Moderator'],\n   process: (bot, message) => {\n-    let timeoutEnd = Date.now() + 1800000;\n-\n-    const userLogs = bot.channels.find('name', 'user-logs');\n+    const userLogsChannel = bot.channels.find('name', 'user-logs');\n \n     const restrictedRole = message.guild.roles.find('name', 'Restricted');\n     const over18Role = message.guild.roles.find('name', '18+');\n     const memberRole = message.guild.roles.find('name', 'Member');\n \n+    // Calculate the end time\n+    const timeoutStart = Date.now();\n+\n+    // Let's grab just the time...\n+    const timeoutLengthArray = splitargs(message.content);\n+    timeoutLengthArray.shift();\n+    timeoutLengthArray.shift();\n+    let timeoutLength = timeoutLengthArray[0];\n+\n+    if (!timeoutLength) {\n+      timeoutLength = '30m';\n+    }\n+\n+    const timeoutEnd = timeoutStart + juration.parse(timeoutLength) * 1000;","path":"commands/timeout.js","position":37,"original_position":37,"commit_id":"dad4f105d7b2f8c0aeaaa8dad62fd2ed4a0d3e8d","original_commit_id":"dad4f105d7b2f8c0aeaaa8dad62fd2ed4a0d3e8d","user":{"login":"LuaMilkshake","id":1238784,"avatar_url":"https://avatars.githubusercontent.com/u/1238784?v=3","gravatar_id":"","url":"https://api.github.com/users/LuaMilkshake","html_url":"https://github.com/LuaMilkshake","followers_url":"https://api.github.com/users/LuaMilkshake/followers","following_url":"https://api.github.com/users/LuaMilkshake/following{/other_user}","gists_url":"https://api.github.com/users/LuaMilkshake/gists{/gist_id}","starred_url":"https://api.github.com/users/LuaMilkshake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuaMilkshake/subscriptions","organizations_url":"https://api.github.com/users/LuaMilkshake/orgs","repos_url":"https://api.github.com/users/LuaMilkshake/repos","events_url":"https://api.github.com/users/LuaMilkshake/events{/privacy}","received_events_url":"https://api.github.com/users/LuaMilkshake/received_events","type":"User","site_admin":false},"body":"If the duration is invalid here, it throws an exception where `e.stack` is undefined? Anyway, should slam a try-catch in here and tell the user they're stupid if it's wrong.","created_at":"2017-01-19T02:30:36Z","updated_at":"2017-01-19T02:32:47Z","html_url":"https://github.com/gaymers-discord/DiscoBot/pull/166#discussion_r96781211","pull_request_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/166","_links":{"self":{"href":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/comments/96781211"},"html":{"href":"https://github.com/gaymers-discord/DiscoBot/pull/166#discussion_r96781211"},"pull_request":{"href":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/166"}}},"pull_request":{"url":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/166","id":100310608,"html_url":"https://github.com/gaymers-discord/DiscoBot/pull/166","diff_url":"https://github.com/gaymers-discord/DiscoBot/pull/166.diff","patch_url":"https://github.com/gaymers-discord/DiscoBot/pull/166.patch","issue_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/issues/166","number":166,"state":"open","locked":false,"title":"Custom timeout length 🎉","user":{"login":"ThomasShaped","id":2439407,"avatar_url":"https://avatars.githubusercontent.com/u/2439407?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasShaped","html_url":"https://github.com/ThomasShaped","followers_url":"https://api.github.com/users/ThomasShaped/followers","following_url":"https://api.github.com/users/ThomasShaped/following{/other_user}","gists_url":"https://api.github.com/users/ThomasShaped/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasShaped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasShaped/subscriptions","organizations_url":"https://api.github.com/users/ThomasShaped/orgs","repos_url":"https://api.github.com/users/ThomasShaped/repos","events_url":"https://api.github.com/users/ThomasShaped/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasShaped/received_events","type":"User","site_admin":false},"body":"_Finally._\r\n\r\n- Adds the ability to set a length of time (in the format `2h45m`).\r\n- Defaults to 30 minutes\r\n- Updates timeout related logs to new embeds\r\n- `!choose` now uses the `.random()` array function from utils","created_at":"2017-01-05T15:37:43Z","updated_at":"2017-01-19T02:32:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0604fa0640bfb131803a8a73d45eb283d1a0dd29","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/166/commits","review_comments_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/166/comments","review_comment_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/issues/166/comments","statuses_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/statuses/dad4f105d7b2f8c0aeaaa8dad62fd2ed4a0d3e8d","head":{"label":"ThomasShaped:custom-timeout","ref":"custom-timeout","sha":"dad4f105d7b2f8c0aeaaa8dad62fd2ed4a0d3e8d","user":{"login":"ThomasShaped","id":2439407,"avatar_url":"https://avatars.githubusercontent.com/u/2439407?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasShaped","html_url":"https://github.com/ThomasShaped","followers_url":"https://api.github.com/users/ThomasShaped/followers","following_url":"https://api.github.com/users/ThomasShaped/following{/other_user}","gists_url":"https://api.github.com/users/ThomasShaped/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasShaped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasShaped/subscriptions","organizations_url":"https://api.github.com/users/ThomasShaped/orgs","repos_url":"https://api.github.com/users/ThomasShaped/repos","events_url":"https://api.github.com/users/ThomasShaped/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasShaped/received_events","type":"User","site_admin":false},"repo":{"id":77043539,"name":"DiscoBot","full_name":"ThomasShaped/DiscoBot","owner":{"login":"ThomasShaped","id":2439407,"avatar_url":"https://avatars.githubusercontent.com/u/2439407?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasShaped","html_url":"https://github.com/ThomasShaped","followers_url":"https://api.github.com/users/ThomasShaped/followers","following_url":"https://api.github.com/users/ThomasShaped/following{/other_user}","gists_url":"https://api.github.com/users/ThomasShaped/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasShaped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasShaped/subscriptions","organizations_url":"https://api.github.com/users/ThomasShaped/orgs","repos_url":"https://api.github.com/users/ThomasShaped/repos","events_url":"https://api.github.com/users/ThomasShaped/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasShaped/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ThomasShaped/DiscoBot","description":null,"fork":true,"url":"https://api.github.com/repos/ThomasShaped/DiscoBot","forks_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/forks","keys_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/teams","hooks_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/hooks","issue_events_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/issues/events{/number}","events_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/events","assignees_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/assignees{/user}","branches_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/branches{/branch}","tags_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/tags","blobs_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/git/refs{/sha}","trees_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/statuses/{sha}","languages_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/languages","stargazers_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/stargazers","contributors_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/contributors","subscribers_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/subscribers","subscription_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/subscription","commits_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/commits{/sha}","git_commits_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/git/commits{/sha}","comments_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/comments{/number}","issue_comment_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/issues/comments{/number}","contents_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/contents/{+path}","compare_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/merges","archive_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/downloads","issues_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/issues{/number}","pulls_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/pulls{/number}","milestones_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/milestones{/number}","notifications_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/labels{/name}","releases_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/releases{/id}","deployments_url":"https://api.github.com/repos/ThomasShaped/DiscoBot/deployments","created_at":"2016-12-21T10:52:22Z","updated_at":"2016-12-21T10:52:25Z","pushed_at":"2017-01-16T12:04:13Z","git_url":"git://github.com/ThomasShaped/DiscoBot.git","ssh_url":"git@github.com:ThomasShaped/DiscoBot.git","clone_url":"https://github.com/ThomasShaped/DiscoBot.git","svn_url":"https://github.com/ThomasShaped/DiscoBot","homepage":null,"size":335,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gaymers-discord:master","ref":"master","sha":"4d3ae977c877bf3c0feaa4ea5a239a9b838c9386","user":{"login":"gaymers-discord","id":19373342,"avatar_url":"https://avatars.githubusercontent.com/u/19373342?v=3","gravatar_id":"","url":"https://api.github.com/users/gaymers-discord","html_url":"https://github.com/gaymers-discord","followers_url":"https://api.github.com/users/gaymers-discord/followers","following_url":"https://api.github.com/users/gaymers-discord/following{/other_user}","gists_url":"https://api.github.com/users/gaymers-discord/gists{/gist_id}","starred_url":"https://api.github.com/users/gaymers-discord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaymers-discord/subscriptions","organizations_url":"https://api.github.com/users/gaymers-discord/orgs","repos_url":"https://api.github.com/users/gaymers-discord/repos","events_url":"https://api.github.com/users/gaymers-discord/events{/privacy}","received_events_url":"https://api.github.com/users/gaymers-discord/received_events","type":"Organization","site_admin":false},"repo":{"id":58863263,"name":"DiscoBot","full_name":"gaymers-discord/DiscoBot","owner":{"login":"gaymers-discord","id":19373342,"avatar_url":"https://avatars.githubusercontent.com/u/19373342?v=3","gravatar_id":"","url":"https://api.github.com/users/gaymers-discord","html_url":"https://github.com/gaymers-discord","followers_url":"https://api.github.com/users/gaymers-discord/followers","following_url":"https://api.github.com/users/gaymers-discord/following{/other_user}","gists_url":"https://api.github.com/users/gaymers-discord/gists{/gist_id}","starred_url":"https://api.github.com/users/gaymers-discord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaymers-discord/subscriptions","organizations_url":"https://api.github.com/users/gaymers-discord/orgs","repos_url":"https://api.github.com/users/gaymers-discord/repos","events_url":"https://api.github.com/users/gaymers-discord/events{/privacy}","received_events_url":"https://api.github.com/users/gaymers-discord/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gaymers-discord/DiscoBot","description":null,"fork":false,"url":"https://api.github.com/repos/gaymers-discord/DiscoBot","forks_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/forks","keys_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/teams","hooks_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/hooks","issue_events_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/issues/events{/number}","events_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/events","assignees_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/assignees{/user}","branches_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/branches{/branch}","tags_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/tags","blobs_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/git/refs{/sha}","trees_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/statuses/{sha}","languages_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/languages","stargazers_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/stargazers","contributors_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/contributors","subscribers_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/subscribers","subscription_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/subscription","commits_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/commits{/sha}","git_commits_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/git/commits{/sha}","comments_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/comments{/number}","issue_comment_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/issues/comments{/number}","contents_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/contents/{+path}","compare_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/merges","archive_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/downloads","issues_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/issues{/number}","pulls_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls{/number}","milestones_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/milestones{/number}","notifications_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/labels{/name}","releases_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/releases{/id}","deployments_url":"https://api.github.com/repos/gaymers-discord/DiscoBot/deployments","created_at":"2016-05-15T13:32:24Z","updated_at":"2016-12-22T17:08:23Z","pushed_at":"2017-01-16T00:38:57Z","git_url":"git://github.com/gaymers-discord/DiscoBot.git","ssh_url":"git@github.com:gaymers-discord/DiscoBot.git","clone_url":"https://github.com/gaymers-discord/DiscoBot.git","svn_url":"https://github.com/gaymers-discord/DiscoBot","homepage":null,"size":337,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":12,"forks":8,"open_issues":12,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/166"},"html":{"href":"https://github.com/gaymers-discord/DiscoBot/pull/166"},"issue":{"href":"https://api.github.com/repos/gaymers-discord/DiscoBot/issues/166"},"comments":{"href":"https://api.github.com/repos/gaymers-discord/DiscoBot/issues/166/comments"},"review_comments":{"href":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/166/comments"},"review_comment":{"href":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gaymers-discord/DiscoBot/pulls/166/commits"},"statuses":{"href":"https://api.github.com/repos/gaymers-discord/DiscoBot/statuses/dad4f105d7b2f8c0aeaaa8dad62fd2ed4a0d3e8d"}}}}
{"actor":{"display_login":"LuaMilkshake"}}