{"action":"created","comment":{"url":"https://api.github.com/repos/serenity-rs/serenity/pulls/comments/196181801","pull_request_review_id":129686401,"id":196181801,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjE4MTgwMQ==","diff_hunk":"@@ -88,6 +88,46 @@ pub fn has_all_requirements(cmd: &Arc<CommandOptions>, msg: &Message) -> bool {\n     !cmd.guild_only\n }\n \n+/// Checks whether a command would be visible, takes permissions, channel sent in,\n+/// and roles into consideration.\n+///\n+/// **Note**: A command is visible when it is either normally displayed or\n+/// strikethrough upon requested help by a user.\n+#[cfg(feature = \"cache\")]\n+pub fn is_command_visible(command_options: &Arc<CommandOptions>, msg: &Message, help_options: &HelpOptions) -> bool {\n+    if !command_options.dm_only && !command_options.guild_only\n+    || command_options.dm_only && msg.is_private()\n+    || command_options.guild_only && !msg.is_private() {\n+\n+        if let Some(guild) = msg.guild() {\n+            let guild = guild.read();\n+\n+            if let Some(member) = guild.members.get(&msg.author.id) {\n+\n+                if command_options.help_available {\n+\n+                    if has_correct_permissions(command_options, msg) {\n+\n+                        if has_correct_roles(command_options, &guild, &member) {\n+                            return true;\n+                        } else {\n+                            return help_options.lacking_role != HelpBehaviour::Hide;\n+                        }\n+                    } else {\n+                        return help_options.lacking_permissions != HelpBehaviour::Hide;\n+                    }\n+                } else {\n+                    return help_options.lacking_permissions != HelpBehaviour::Hide;\n+                }\n+            }\n+        }\n+    } else {\n+        return help_options.wrong_channel != HelpBehaviour::Hide;\n+    }\n+\n+    return false;","path":"src/framework/standard/help_commands.rs","position":66,"original_position":66,"commit_id":"6e1edde4a3fe27d0d90db7ea906ca5f115a2d5fb","original_commit_id":"6e1edde4a3fe27d0d90db7ea906ca5f115a2d5fb","user":{"login":"acdenisSK","id":16745149,"node_id":"MDQ6VXNlcjE2NzQ1MTQ5","avatar_url":"https://avatars2.githubusercontent.com/u/16745149?v=4","gravatar_id":"","url":"https://api.github.com/users/acdenisSK","html_url":"https://github.com/acdenisSK","followers_url":"https://api.github.com/users/acdenisSK/followers","following_url":"https://api.github.com/users/acdenisSK/following{/other_user}","gists_url":"https://api.github.com/users/acdenisSK/gists{/gist_id}","starred_url":"https://api.github.com/users/acdenisSK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acdenisSK/subscriptions","organizations_url":"https://api.github.com/users/acdenisSK/orgs","repos_url":"https://api.github.com/users/acdenisSK/repos","events_url":"https://api.github.com/users/acdenisSK/events{/privacy}","received_events_url":"https://api.github.com/users/acdenisSK/received_events","type":"User","site_admin":false},"body":"At end of function, so this could be changed to an implicit return (just `false`).","created_at":"2018-06-18T18:35:43Z","updated_at":"2018-06-18T18:47:23Z","html_url":"https://github.com/serenity-rs/serenity/pull/337#discussion_r196181801","pull_request_url":"https://api.github.com/repos/serenity-rs/serenity/pulls/337","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/serenity-rs/serenity/pulls/comments/196181801"},"html":{"href":"https://github.com/serenity-rs/serenity/pull/337#discussion_r196181801"},"pull_request":{"href":"https://api.github.com/repos/serenity-rs/serenity/pulls/337"}}},"pull_request":{"url":"https://api.github.com/repos/serenity-rs/serenity/pulls/337","id":195609940,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1NjA5OTQw","html_url":"https://github.com/serenity-rs/serenity/pull/337","diff_url":"https://github.com/serenity-rs/serenity/pull/337.diff","patch_url":"https://github.com/serenity-rs/serenity/pull/337.patch","issue_url":"https://api.github.com/repos/serenity-rs/serenity/issues/337","number":337,"state":"open","locked":false,"title":"Provide help-details for all visible commands","user":{"login":"Lakelezz","id":12222135,"node_id":"MDQ6VXNlcjEyMjIyMTM1","avatar_url":"https://avatars2.githubusercontent.com/u/12222135?v=4","gravatar_id":"","url":"https://api.github.com/users/Lakelezz","html_url":"https://github.com/Lakelezz","followers_url":"https://api.github.com/users/Lakelezz/followers","following_url":"https://api.github.com/users/Lakelezz/following{/other_user}","gists_url":"https://api.github.com/users/Lakelezz/gists{/gist_id}","starred_url":"https://api.github.com/users/Lakelezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lakelezz/subscriptions","organizations_url":"https://api.github.com/users/Lakelezz/orgs","repos_url":"https://api.github.com/users/Lakelezz/repos","events_url":"https://api.github.com/users/Lakelezz/events{/privacy}","received_events_url":"https://api.github.com/users/Lakelezz/received_events","type":"User","site_admin":false},"body":"Before, the help-features did not display further information about a command that was unable to use due to wrong channel (e.g. guild-only-command used via direct message).\r\n\r\nFrom now the behaviour - whether a command is available for further details - will work as following:\r\nWhen the command would be normally displayed or strikethrough, the command will be available for further details via `help command-name`.\r\n\r\nI will need to add this behaviour to `v0.6.x` once the framework is working again and #274 is merged.\r\nOn another note, this might depreciate `has_all_requirements`, since Serenity will no longer use it - might keep it for the utility.","created_at":"2018-06-18T18:28:21Z","updated_at":"2018-06-18T18:47:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1efb45fb414ad37ebdce4bd8cf591e296093e316","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":476385280,"node_id":"MDU6TGFiZWw0NzYzODUyODA=","url":"https://api.github.com/repos/serenity-rs/serenity/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/serenity-rs/serenity/pulls/337/commits","review_comments_url":"https://api.github.com/repos/serenity-rs/serenity/pulls/337/comments","review_comment_url":"https://api.github.com/repos/serenity-rs/serenity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/serenity-rs/serenity/issues/337/comments","statuses_url":"https://api.github.com/repos/serenity-rs/serenity/statuses/6e1edde4a3fe27d0d90db7ea906ca5f115a2d5fb","head":{"label":"Lakelezz:help-for-all-visible-commands","ref":"help-for-all-visible-commands","sha":"6e1edde4a3fe27d0d90db7ea906ca5f115a2d5fb","user":{"login":"Lakelezz","id":12222135,"node_id":"MDQ6VXNlcjEyMjIyMTM1","avatar_url":"https://avatars2.githubusercontent.com/u/12222135?v=4","gravatar_id":"","url":"https://api.github.com/users/Lakelezz","html_url":"https://github.com/Lakelezz","followers_url":"https://api.github.com/users/Lakelezz/followers","following_url":"https://api.github.com/users/Lakelezz/following{/other_user}","gists_url":"https://api.github.com/users/Lakelezz/gists{/gist_id}","starred_url":"https://api.github.com/users/Lakelezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lakelezz/subscriptions","organizations_url":"https://api.github.com/users/Lakelezz/orgs","repos_url":"https://api.github.com/users/Lakelezz/repos","events_url":"https://api.github.com/users/Lakelezz/events{/privacy}","received_events_url":"https://api.github.com/users/Lakelezz/received_events","type":"User","site_admin":false},"repo":{"id":100125152,"node_id":"MDEwOlJlcG9zaXRvcnkxMDAxMjUxNTI=","name":"serenity","full_name":"Lakelezz/serenity","owner":{"login":"Lakelezz","id":12222135,"node_id":"MDQ6VXNlcjEyMjIyMTM1","avatar_url":"https://avatars2.githubusercontent.com/u/12222135?v=4","gravatar_id":"","url":"https://api.github.com/users/Lakelezz","html_url":"https://github.com/Lakelezz","followers_url":"https://api.github.com/users/Lakelezz/followers","following_url":"https://api.github.com/users/Lakelezz/following{/other_user}","gists_url":"https://api.github.com/users/Lakelezz/gists{/gist_id}","starred_url":"https://api.github.com/users/Lakelezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lakelezz/subscriptions","organizations_url":"https://api.github.com/users/Lakelezz/orgs","repos_url":"https://api.github.com/users/Lakelezz/repos","events_url":"https://api.github.com/users/Lakelezz/events{/privacy}","received_events_url":"https://api.github.com/users/Lakelezz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Lakelezz/serenity","description":"A Rust library for the Discord API, maintained by @acdenisSK.","fork":true,"url":"https://api.github.com/repos/Lakelezz/serenity","forks_url":"https://api.github.com/repos/Lakelezz/serenity/forks","keys_url":"https://api.github.com/repos/Lakelezz/serenity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lakelezz/serenity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lakelezz/serenity/teams","hooks_url":"https://api.github.com/repos/Lakelezz/serenity/hooks","issue_events_url":"https://api.github.com/repos/Lakelezz/serenity/issues/events{/number}","events_url":"https://api.github.com/repos/Lakelezz/serenity/events","assignees_url":"https://api.github.com/repos/Lakelezz/serenity/assignees{/user}","branches_url":"https://api.github.com/repos/Lakelezz/serenity/branches{/branch}","tags_url":"https://api.github.com/repos/Lakelezz/serenity/tags","blobs_url":"https://api.github.com/repos/Lakelezz/serenity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lakelezz/serenity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lakelezz/serenity/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lakelezz/serenity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lakelezz/serenity/statuses/{sha}","languages_url":"https://api.github.com/repos/Lakelezz/serenity/languages","stargazers_url":"https://api.github.com/repos/Lakelezz/serenity/stargazers","contributors_url":"https://api.github.com/repos/Lakelezz/serenity/contributors","subscribers_url":"https://api.github.com/repos/Lakelezz/serenity/subscribers","subscription_url":"https://api.github.com/repos/Lakelezz/serenity/subscription","commits_url":"https://api.github.com/repos/Lakelezz/serenity/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lakelezz/serenity/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lakelezz/serenity/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lakelezz/serenity/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lakelezz/serenity/contents/{+path}","compare_url":"https://api.github.com/repos/Lakelezz/serenity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lakelezz/serenity/merges","archive_url":"https://api.github.com/repos/Lakelezz/serenity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lakelezz/serenity/downloads","issues_url":"https://api.github.com/repos/Lakelezz/serenity/issues{/number}","pulls_url":"https://api.github.com/repos/Lakelezz/serenity/pulls{/number}","milestones_url":"https://api.github.com/repos/Lakelezz/serenity/milestones{/number}","notifications_url":"https://api.github.com/repos/Lakelezz/serenity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lakelezz/serenity/labels{/name}","releases_url":"https://api.github.com/repos/Lakelezz/serenity/releases{/id}","deployments_url":"https://api.github.com/repos/Lakelezz/serenity/deployments","created_at":"2017-08-12T16:43:13Z","updated_at":"2018-05-22T17:39:47Z","pushed_at":"2018-06-18T18:26:38Z","git_url":"git://github.com/Lakelezz/serenity.git","ssh_url":"git@github.com:Lakelezz/serenity.git","clone_url":"https://github.com/Lakelezz/serenity.git","svn_url":"https://github.com/Lakelezz/serenity","homepage":"https://docs.rs/serenity","size":4275,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"serenity-rs:master","ref":"master","sha":"a9e8626c4cd642087f828c5b32481bee9e4d368b","user":{"login":"serenity-rs","id":32077193,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMDc3MTkz","avatar_url":"https://avatars1.githubusercontent.com/u/32077193?v=4","gravatar_id":"","url":"https://api.github.com/users/serenity-rs","html_url":"https://github.com/serenity-rs","followers_url":"https://api.github.com/users/serenity-rs/followers","following_url":"https://api.github.com/users/serenity-rs/following{/other_user}","gists_url":"https://api.github.com/users/serenity-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/serenity-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serenity-rs/subscriptions","organizations_url":"https://api.github.com/users/serenity-rs/orgs","repos_url":"https://api.github.com/users/serenity-rs/repos","events_url":"https://api.github.com/users/serenity-rs/events{/privacy}","received_events_url":"https://api.github.com/users/serenity-rs/received_events","type":"Organization","site_admin":false},"repo":{"id":73012103,"node_id":"MDEwOlJlcG9zaXRvcnk3MzAxMjEwMw==","name":"serenity","full_name":"serenity-rs/serenity","owner":{"login":"serenity-rs","id":32077193,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMDc3MTkz","avatar_url":"https://avatars1.githubusercontent.com/u/32077193?v=4","gravatar_id":"","url":"https://api.github.com/users/serenity-rs","html_url":"https://github.com/serenity-rs","followers_url":"https://api.github.com/users/serenity-rs/followers","following_url":"https://api.github.com/users/serenity-rs/following{/other_user}","gists_url":"https://api.github.com/users/serenity-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/serenity-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serenity-rs/subscriptions","organizations_url":"https://api.github.com/users/serenity-rs/orgs","repos_url":"https://api.github.com/users/serenity-rs/repos","events_url":"https://api.github.com/users/serenity-rs/events{/privacy}","received_events_url":"https://api.github.com/users/serenity-rs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serenity-rs/serenity","description":"A Rust library for the Discord API.","fork":false,"url":"https://api.github.com/repos/serenity-rs/serenity","forks_url":"https://api.github.com/repos/serenity-rs/serenity/forks","keys_url":"https://api.github.com/repos/serenity-rs/serenity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serenity-rs/serenity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serenity-rs/serenity/teams","hooks_url":"https://api.github.com/repos/serenity-rs/serenity/hooks","issue_events_url":"https://api.github.com/repos/serenity-rs/serenity/issues/events{/number}","events_url":"https://api.github.com/repos/serenity-rs/serenity/events","assignees_url":"https://api.github.com/repos/serenity-rs/serenity/assignees{/user}","branches_url":"https://api.github.com/repos/serenity-rs/serenity/branches{/branch}","tags_url":"https://api.github.com/repos/serenity-rs/serenity/tags","blobs_url":"https://api.github.com/repos/serenity-rs/serenity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serenity-rs/serenity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serenity-rs/serenity/git/refs{/sha}","trees_url":"https://api.github.com/repos/serenity-rs/serenity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serenity-rs/serenity/statuses/{sha}","languages_url":"https://api.github.com/repos/serenity-rs/serenity/languages","stargazers_url":"https://api.github.com/repos/serenity-rs/serenity/stargazers","contributors_url":"https://api.github.com/repos/serenity-rs/serenity/contributors","subscribers_url":"https://api.github.com/repos/serenity-rs/serenity/subscribers","subscription_url":"https://api.github.com/repos/serenity-rs/serenity/subscription","commits_url":"https://api.github.com/repos/serenity-rs/serenity/commits{/sha}","git_commits_url":"https://api.github.com/repos/serenity-rs/serenity/git/commits{/sha}","comments_url":"https://api.github.com/repos/serenity-rs/serenity/comments{/number}","issue_comment_url":"https://api.github.com/repos/serenity-rs/serenity/issues/comments{/number}","contents_url":"https://api.github.com/repos/serenity-rs/serenity/contents/{+path}","compare_url":"https://api.github.com/repos/serenity-rs/serenity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serenity-rs/serenity/merges","archive_url":"https://api.github.com/repos/serenity-rs/serenity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serenity-rs/serenity/downloads","issues_url":"https://api.github.com/repos/serenity-rs/serenity/issues{/number}","pulls_url":"https://api.github.com/repos/serenity-rs/serenity/pulls{/number}","milestones_url":"https://api.github.com/repos/serenity-rs/serenity/milestones{/number}","notifications_url":"https://api.github.com/repos/serenity-rs/serenity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serenity-rs/serenity/labels{/name}","releases_url":"https://api.github.com/repos/serenity-rs/serenity/releases{/id}","deployments_url":"https://api.github.com/repos/serenity-rs/serenity/deployments","created_at":"2016-11-06T18:59:56Z","updated_at":"2018-06-17T23:00:05Z","pushed_at":"2018-06-18T18:28:22Z","git_url":"git://github.com/serenity-rs/serenity.git","ssh_url":"git@github.com:serenity-rs/serenity.git","clone_url":"https://github.com/serenity-rs/serenity.git","svn_url":"https://github.com/serenity-rs/serenity","homepage":"https://discord.gg/WBdGJCc","size":4310,"stargazers_count":266,"watchers_count":266,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":65,"open_issues":17,"watchers":266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/serenity-rs/serenity/pulls/337"},"html":{"href":"https://github.com/serenity-rs/serenity/pull/337"},"issue":{"href":"https://api.github.com/repos/serenity-rs/serenity/issues/337"},"comments":{"href":"https://api.github.com/repos/serenity-rs/serenity/issues/337/comments"},"review_comments":{"href":"https://api.github.com/repos/serenity-rs/serenity/pulls/337/comments"},"review_comment":{"href":"https://api.github.com/repos/serenity-rs/serenity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/serenity-rs/serenity/pulls/337/commits"},"statuses":{"href":"https://api.github.com/repos/serenity-rs/serenity/statuses/6e1edde4a3fe27d0d90db7ea906ca5f115a2d5fb"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"acdenisSK"}}