Fixed permission check issue

+ `permission_check` was returning false if a member did not have a certain role, instead of continuing to search
master
Joey Hines 2020-05-20 11:29:07 -05:00
parent 46703f9509
commit a0d6a492b8
1 changed files with 4 additions and 1 deletions

View File

@ -175,10 +175,13 @@ pub fn permission_check(ctx: &mut Context, msg: &Message, _command_name: &str) -
if let Ok(roles) = ctx.http.get_guild_roles(guild_id.0) { if let Ok(roles) = ctx.http.get_guild_roles(guild_id.0) {
for role in roles { for role in roles {
if config.event_roles.contains(&role.id.0) { if config.event_roles.contains(&role.id.0) {
return match msg.author.has_role(ctx, guild_id, role) { let has_role = match msg.author.has_role(&ctx, guild_id, role) {
Ok(has_role) => has_role, Ok(has_role) => has_role,
Err(_) => false, Err(_) => false,
}; };
if has_role {
return true
}
} }
} }
} }