From a0d6a492b8bd6766bd0eb83f6a7f4dc44ec750a6 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Wed, 20 May 2020 11:29:07 -0500 Subject: [PATCH] Fixed permission check issue + `permission_check` was returning false if a member did not have a certain role, instead of continuing to search --- src/discord/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/discord/mod.rs b/src/discord/mod.rs index ef39613..862e567 100644 --- a/src/discord/mod.rs +++ b/src/discord/mod.rs @@ -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) { for role in roles { 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, Err(_) => false, }; + if has_role { + return true + } } } }