{"action":"created","comment":{"url":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/comments/168776674","pull_request_review_id":97200987,"id":168776674,"diff_hunk":"@@ -1,55 +1,120 @@\n const Command = require(`${process.cwd()}/base/Command.js`);\n-\n+const {MessageEmbed} = require(\"discord.js\");\n+const perpage = 10;\n+/*\n+  The HELP command is used to display every command's name and description\n+  to the user, so that he may see what commands are available. The help\n+  command is also filtered by level, so if a user does not have access to\n+  a command, it is not shown to them. If a command name is given with the\n+  help command, its extended help is shown.\n+*/\n class Help extends Command {\n   constructor(client) {\n     super(client, {\n       name: \"help\",\n-      description: \"Displays the commands for your level.\",\n-      usage: \"help [command]\",\n-      category: \"System\",\n-      extended: \"This command will display all available commands for your permission level, with the additonal option of getting per command information when you run 'help <command name>'.\",\n-      hidden: true,\n-      aliases: [\"h\", \"halp\", \"commands\"]\n+      description: \"Get help on a command, command category, or a setting\",\n+      category: \"Utility\",\n+      enabled:true,\n+      guildOnly:false,\n+      usage: \"help <category/command/setting> [page-num]\",\n+      aliases: [\"halp\",\"h\"],\n+      permLevel: \"User\",\n+      examples:[\"moderation\",\"mute\"]\n     });\n   }\n \n   async run(message, args, level) {\n-    const settings = message.settings;\n+  // If no specific command is called, show all filtered commands.\n+    const client = this.client;\n+    const embed = new MessageEmbed();\n+    // Load guild settings (for prefixes and eventually per-guild tweaks)\n+    const settings = message.guild ? await this.client.settings.get(message.guild.id) : this.client.config.defaultSettings;\n+    // Filter all commands by which are available for the user's level, using the <Collection>.filter() method.\n+    \n+    const myCommands = this.client.commands.filter(function(cmd) {return cmd.help.category != \"Staff\";});\n+    \n+    //myCommands = message.guild ? client.commands.filter(cmd => client.levelCache[cmd.conf.permLevel] <= level) : client.commands.filter(cmd => client.levelCache[cmd.conf.permLevel] <= level &&  cmd.conf.guildOnly !== true);\n+    \n+    // Here we have to get the command names only, and we use that array to get the longest name.\n+    // This make the help commands \"aligned\" in the output.\n+    \n+    let currentCategory = \"\";\n+    const sorted = myCommands.array().sort((p, c) => p.help.category > c.help.category ? 1 :  p.help.name > c.help.name && p.help.category === c.help.category ? 1 : -1 );\n     if (!args[0]) {\n-      try {\n-        const myCommands = message.guild ? this.client.commands.filter(cmd => this.client.levelCache[cmd.conf.permLevel] <= level && cmd.conf.hidden !== true) : this.client.commands.filter(cmd => this.client.levelCache[cmd.conf.permLevel] <= level && cmd.conf.hidden !== true && cmd.conf.guildOnly !== true);\n-        const commandNames = myCommands.keyArray();\n-        const longest = commandNames.reduce((long, str) => Math.max(long, str.length), 0);\n-        let currentCategory = \"\";\n-        let output = `= Command List =\\n\\n[Use ${settings.prefix}help <commandname> in a guild channel for details]\\n`;\n-        const sorted = myCommands.array().sort((p, c) => p.help.category > c.help.category ? 1 :  p.help.name > c.help.name && p.help.category === c.help.category ? 1 : -1 );\n-        sorted.forEach( c => {\n-          const cat = c.help.category.toProperCase();\n-          if (currentCategory !== cat) {\n-            output += `\\u200b\\n== ${cat} ==\\n`;\n-            currentCategory = cat;\n+      const description = `Command category list\\n\\nUse \\`${settings.prefix}help <category>\\` to find commands for a specific category`;\n+      let output = \"\";\n+      sorted.forEach( c => {\n+        const cat = c.help.category.toProperCase();\n+    \n+        if (currentCategory !== cat && !args[0]) {\n+          output += `\\`${settings.prefix}help ${cat.toLowerCase()}\\` | Shows ${cat} commands\\n`;\n+          currentCategory = cat;\n+        }\n+        //output += `${settings.prefix.value}${c.help.name}${\" \".repeat(longest - c.help.name.length)} :: ${c.help.description}\\n`;\n+      });\n+      embed.setTitle(\"Misaki Help\")","path":"commands/general/help.js","position":75,"original_position":75,"commit_id":"2b31228374869ced83ef0396543b2e2e8c776157","original_commit_id":"2b31228374869ced83ef0396543b2e2e8c776157","user":{"login":"YorkAARGH","id":20838878,"avatar_url":"https://avatars1.githubusercontent.com/u/20838878?v=4","gravatar_id":"","url":"https://api.github.com/users/YorkAARGH","html_url":"https://github.com/YorkAARGH","followers_url":"https://api.github.com/users/YorkAARGH/followers","following_url":"https://api.github.com/users/YorkAARGH/following{/other_user}","gists_url":"https://api.github.com/users/YorkAARGH/gists{/gist_id}","starred_url":"https://api.github.com/users/YorkAARGH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YorkAARGH/subscriptions","organizations_url":"https://api.github.com/users/YorkAARGH/orgs","repos_url":"https://api.github.com/users/YorkAARGH/repos","events_url":"https://api.github.com/users/YorkAARGH/events{/privacy}","received_events_url":"https://api.github.com/users/YorkAARGH/received_events","type":"User","site_admin":false},"body":"Why? We know it's the bot's help, pls remove the bot name","created_at":"2018-02-16T14:52:20Z","updated_at":"2018-02-16T14:54:25Z","html_url":"https://github.com/NotAWeebDev/Misaki/pull/62#discussion_r168776674","pull_request_url":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/62","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/comments/168776674"},"html":{"href":"https://github.com/NotAWeebDev/Misaki/pull/62#discussion_r168776674"},"pull_request":{"href":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/62","id":169639293,"html_url":"https://github.com/NotAWeebDev/Misaki/pull/62","diff_url":"https://github.com/NotAWeebDev/Misaki/pull/62.diff","patch_url":"https://github.com/NotAWeebDev/Misaki/pull/62.patch","issue_url":"https://api.github.com/repos/NotAWeebDev/Misaki/issues/62","number":62,"state":"open","locked":false,"title":"Simpler help command","user":{"login":"AndrewJWin","id":28762465,"avatar_url":"https://avatars2.githubusercontent.com/u/28762465?v=4","gravatar_id":"","url":"https://api.github.com/users/AndrewJWin","html_url":"https://github.com/AndrewJWin","followers_url":"https://api.github.com/users/AndrewJWin/followers","following_url":"https://api.github.com/users/AndrewJWin/following{/other_user}","gists_url":"https://api.github.com/users/AndrewJWin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewJWin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewJWin/subscriptions","organizations_url":"https://api.github.com/users/AndrewJWin/orgs","repos_url":"https://api.github.com/users/AndrewJWin/repos","events_url":"https://api.github.com/users/AndrewJWin/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewJWin/received_events","type":"User","site_admin":false},"body":"Yay, we now have an embeded ``help`` command with categories.","created_at":"2018-02-16T14:36:58Z","updated_at":"2018-02-16T14:54:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f9c6ba0b22fbd30239ecb5712aab33dba8e0f61","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/62/commits","review_comments_url":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/62/comments","review_comment_url":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NotAWeebDev/Misaki/issues/62/comments","statuses_url":"https://api.github.com/repos/NotAWeebDev/Misaki/statuses/2b31228374869ced83ef0396543b2e2e8c776157","head":{"label":"AndrewJWin:Yukine-Refactor","ref":"Yukine-Refactor","sha":"2b31228374869ced83ef0396543b2e2e8c776157","user":{"login":"AndrewJWin","id":28762465,"avatar_url":"https://avatars2.githubusercontent.com/u/28762465?v=4","gravatar_id":"","url":"https://api.github.com/users/AndrewJWin","html_url":"https://github.com/AndrewJWin","followers_url":"https://api.github.com/users/AndrewJWin/followers","following_url":"https://api.github.com/users/AndrewJWin/following{/other_user}","gists_url":"https://api.github.com/users/AndrewJWin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewJWin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewJWin/subscriptions","organizations_url":"https://api.github.com/users/AndrewJWin/orgs","repos_url":"https://api.github.com/users/AndrewJWin/repos","events_url":"https://api.github.com/users/AndrewJWin/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewJWin/received_events","type":"User","site_admin":false},"repo":{"id":121759819,"name":"Misaki","full_name":"AndrewJWin/Misaki","owner":{"login":"AndrewJWin","id":28762465,"avatar_url":"https://avatars2.githubusercontent.com/u/28762465?v=4","gravatar_id":"","url":"https://api.github.com/users/AndrewJWin","html_url":"https://github.com/AndrewJWin","followers_url":"https://api.github.com/users/AndrewJWin/followers","following_url":"https://api.github.com/users/AndrewJWin/following{/other_user}","gists_url":"https://api.github.com/users/AndrewJWin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewJWin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewJWin/subscriptions","organizations_url":"https://api.github.com/users/AndrewJWin/orgs","repos_url":"https://api.github.com/users/AndrewJWin/repos","events_url":"https://api.github.com/users/AndrewJWin/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewJWin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AndrewJWin/Misaki","description":"Misaki is Discord Bot designed for communities with commands ranging from gif based anime reactions, to head scratching trivia commands.","fork":true,"url":"https://api.github.com/repos/AndrewJWin/Misaki","forks_url":"https://api.github.com/repos/AndrewJWin/Misaki/forks","keys_url":"https://api.github.com/repos/AndrewJWin/Misaki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AndrewJWin/Misaki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AndrewJWin/Misaki/teams","hooks_url":"https://api.github.com/repos/AndrewJWin/Misaki/hooks","issue_events_url":"https://api.github.com/repos/AndrewJWin/Misaki/issues/events{/number}","events_url":"https://api.github.com/repos/AndrewJWin/Misaki/events","assignees_url":"https://api.github.com/repos/AndrewJWin/Misaki/assignees{/user}","branches_url":"https://api.github.com/repos/AndrewJWin/Misaki/branches{/branch}","tags_url":"https://api.github.com/repos/AndrewJWin/Misaki/tags","blobs_url":"https://api.github.com/repos/AndrewJWin/Misaki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AndrewJWin/Misaki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AndrewJWin/Misaki/git/refs{/sha}","trees_url":"https://api.github.com/repos/AndrewJWin/Misaki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AndrewJWin/Misaki/statuses/{sha}","languages_url":"https://api.github.com/repos/AndrewJWin/Misaki/languages","stargazers_url":"https://api.github.com/repos/AndrewJWin/Misaki/stargazers","contributors_url":"https://api.github.com/repos/AndrewJWin/Misaki/contributors","subscribers_url":"https://api.github.com/repos/AndrewJWin/Misaki/subscribers","subscription_url":"https://api.github.com/repos/AndrewJWin/Misaki/subscription","commits_url":"https://api.github.com/repos/AndrewJWin/Misaki/commits{/sha}","git_commits_url":"https://api.github.com/repos/AndrewJWin/Misaki/git/commits{/sha}","comments_url":"https://api.github.com/repos/AndrewJWin/Misaki/comments{/number}","issue_comment_url":"https://api.github.com/repos/AndrewJWin/Misaki/issues/comments{/number}","contents_url":"https://api.github.com/repos/AndrewJWin/Misaki/contents/{+path}","compare_url":"https://api.github.com/repos/AndrewJWin/Misaki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AndrewJWin/Misaki/merges","archive_url":"https://api.github.com/repos/AndrewJWin/Misaki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AndrewJWin/Misaki/downloads","issues_url":"https://api.github.com/repos/AndrewJWin/Misaki/issues{/number}","pulls_url":"https://api.github.com/repos/AndrewJWin/Misaki/pulls{/number}","milestones_url":"https://api.github.com/repos/AndrewJWin/Misaki/milestones{/number}","notifications_url":"https://api.github.com/repos/AndrewJWin/Misaki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AndrewJWin/Misaki/labels{/name}","releases_url":"https://api.github.com/repos/AndrewJWin/Misaki/releases{/id}","deployments_url":"https://api.github.com/repos/AndrewJWin/Misaki/deployments","created_at":"2018-02-16T14:27:56Z","updated_at":"2018-02-16T14:27:57Z","pushed_at":"2018-02-16T14:36:08Z","git_url":"git://github.com/AndrewJWin/Misaki.git","ssh_url":"git@github.com:AndrewJWin/Misaki.git","clone_url":"https://github.com/AndrewJWin/Misaki.git","svn_url":"https://github.com/AndrewJWin/Misaki","homepage":"","size":5288,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"NotAWeebDev:Yukine-Refactor","ref":"Yukine-Refactor","sha":"ac42d0908d3732f1ed3407802918a91ed0eef796","user":{"login":"NotAWeebDev","id":36539619,"avatar_url":"https://avatars3.githubusercontent.com/u/36539619?v=4","gravatar_id":"","url":"https://api.github.com/users/NotAWeebDev","html_url":"https://github.com/NotAWeebDev","followers_url":"https://api.github.com/users/NotAWeebDev/followers","following_url":"https://api.github.com/users/NotAWeebDev/following{/other_user}","gists_url":"https://api.github.com/users/NotAWeebDev/gists{/gist_id}","starred_url":"https://api.github.com/users/NotAWeebDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NotAWeebDev/subscriptions","organizations_url":"https://api.github.com/users/NotAWeebDev/orgs","repos_url":"https://api.github.com/users/NotAWeebDev/repos","events_url":"https://api.github.com/users/NotAWeebDev/events{/privacy}","received_events_url":"https://api.github.com/users/NotAWeebDev/received_events","type":"Organization","site_admin":false},"repo":{"id":115802521,"name":"Misaki","full_name":"NotAWeebDev/Misaki","owner":{"login":"NotAWeebDev","id":36539619,"avatar_url":"https://avatars3.githubusercontent.com/u/36539619?v=4","gravatar_id":"","url":"https://api.github.com/users/NotAWeebDev","html_url":"https://github.com/NotAWeebDev","followers_url":"https://api.github.com/users/NotAWeebDev/followers","following_url":"https://api.github.com/users/NotAWeebDev/following{/other_user}","gists_url":"https://api.github.com/users/NotAWeebDev/gists{/gist_id}","starred_url":"https://api.github.com/users/NotAWeebDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NotAWeebDev/subscriptions","organizations_url":"https://api.github.com/users/NotAWeebDev/orgs","repos_url":"https://api.github.com/users/NotAWeebDev/repos","events_url":"https://api.github.com/users/NotAWeebDev/events{/privacy}","received_events_url":"https://api.github.com/users/NotAWeebDev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NotAWeebDev/Misaki","description":"Misaki is Discord Bot designed for communities with commands ranging from gif based anime reactions, to head scratching trivia commands.","fork":false,"url":"https://api.github.com/repos/NotAWeebDev/Misaki","forks_url":"https://api.github.com/repos/NotAWeebDev/Misaki/forks","keys_url":"https://api.github.com/repos/NotAWeebDev/Misaki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NotAWeebDev/Misaki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NotAWeebDev/Misaki/teams","hooks_url":"https://api.github.com/repos/NotAWeebDev/Misaki/hooks","issue_events_url":"https://api.github.com/repos/NotAWeebDev/Misaki/issues/events{/number}","events_url":"https://api.github.com/repos/NotAWeebDev/Misaki/events","assignees_url":"https://api.github.com/repos/NotAWeebDev/Misaki/assignees{/user}","branches_url":"https://api.github.com/repos/NotAWeebDev/Misaki/branches{/branch}","tags_url":"https://api.github.com/repos/NotAWeebDev/Misaki/tags","blobs_url":"https://api.github.com/repos/NotAWeebDev/Misaki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NotAWeebDev/Misaki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NotAWeebDev/Misaki/git/refs{/sha}","trees_url":"https://api.github.com/repos/NotAWeebDev/Misaki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NotAWeebDev/Misaki/statuses/{sha}","languages_url":"https://api.github.com/repos/NotAWeebDev/Misaki/languages","stargazers_url":"https://api.github.com/repos/NotAWeebDev/Misaki/stargazers","contributors_url":"https://api.github.com/repos/NotAWeebDev/Misaki/contributors","subscribers_url":"https://api.github.com/repos/NotAWeebDev/Misaki/subscribers","subscription_url":"https://api.github.com/repos/NotAWeebDev/Misaki/subscription","commits_url":"https://api.github.com/repos/NotAWeebDev/Misaki/commits{/sha}","git_commits_url":"https://api.github.com/repos/NotAWeebDev/Misaki/git/commits{/sha}","comments_url":"https://api.github.com/repos/NotAWeebDev/Misaki/comments{/number}","issue_comment_url":"https://api.github.com/repos/NotAWeebDev/Misaki/issues/comments{/number}","contents_url":"https://api.github.com/repos/NotAWeebDev/Misaki/contents/{+path}","compare_url":"https://api.github.com/repos/NotAWeebDev/Misaki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NotAWeebDev/Misaki/merges","archive_url":"https://api.github.com/repos/NotAWeebDev/Misaki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NotAWeebDev/Misaki/downloads","issues_url":"https://api.github.com/repos/NotAWeebDev/Misaki/issues{/number}","pulls_url":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls{/number}","milestones_url":"https://api.github.com/repos/NotAWeebDev/Misaki/milestones{/number}","notifications_url":"https://api.github.com/repos/NotAWeebDev/Misaki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NotAWeebDev/Misaki/labels{/name}","releases_url":"https://api.github.com/repos/NotAWeebDev/Misaki/releases{/id}","deployments_url":"https://api.github.com/repos/NotAWeebDev/Misaki/deployments","created_at":"2017-12-30T14:38:48Z","updated_at":"2018-02-16T14:15:28Z","pushed_at":"2018-02-16T14:36:58Z","git_url":"git://github.com/NotAWeebDev/Misaki.git","ssh_url":"git@github.com:NotAWeebDev/Misaki.git","clone_url":"https://github.com/NotAWeebDev/Misaki.git","svn_url":"https://github.com/NotAWeebDev/Misaki","homepage":"","size":5288,"stargazers_count":21,"watchers_count":21,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":17,"open_issues":6,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/62"},"html":{"href":"https://github.com/NotAWeebDev/Misaki/pull/62"},"issue":{"href":"https://api.github.com/repos/NotAWeebDev/Misaki/issues/62"},"comments":{"href":"https://api.github.com/repos/NotAWeebDev/Misaki/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NotAWeebDev/Misaki/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/NotAWeebDev/Misaki/statuses/2b31228374869ced83ef0396543b2e2e8c776157"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"YorkAARGH"}}