aboutsummaryrefslogtreecommitdiff
path: root/src/framework/standard/help_commands.rs
diff options
context:
space:
mode:
authorLakelezz <[email protected]>2017-09-10 05:19:05 +0200
committerZeyla Hellyer <[email protected]>2017-09-09 20:19:05 -0700
commit2fb12e2b3782fff211a41cb27cd316afc4320a7b (patch)
tree292cd3ea28b9b83388acdfa38e614836b25699cb /src/framework/standard/help_commands.rs
parentHandle channel category deletion (diff)
downloadserenity-2fb12e2b3782fff211a41cb27cd316afc4320a7b.tar.xz
serenity-2fb12e2b3782fff211a41cb27cd316afc4320a7b.zip
Fixed admin bypass perm to framework allowed_roles
This makes those with the "Administrator" permission able to bypass the `allowed_roles` check. Additionally change a usage of `len() > 0` to `is_empty()`.
Diffstat (limited to 'src/framework/standard/help_commands.rs')
-rw-r--r--src/framework/standard/help_commands.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/framework/standard/help_commands.rs b/src/framework/standard/help_commands.rs
index c7004d5..72e0468 100644
--- a/src/framework/standard/help_commands.rs
+++ b/src/framework/standard/help_commands.rs
@@ -51,7 +51,7 @@ fn remove_aliases(cmds: &HashMap<String, CommandOrAlias>) -> HashMap<&String, &I
}
fn right_roles(cmd: &Command, guild: &Guild, member: &Member) -> bool {
- if cmd.allowed_roles.len() > 0 {
+ if !cmd.allowed_roles.is_empty() {
cmd.allowed_roles
.iter()
.flat_map(|r| guild.role_by_name(&r))