From 30f58be0acc01455361f1d87979b6546a850e458 Mon Sep 17 00:00:00 2001 From: jude Date: Tue, 7 Jul 2020 16:32:14 +0100 Subject: [PATCH] added role perm checking --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.rs b/src/main.rs index 216ec36..496c3f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -218,6 +218,16 @@ async fn perform_permission_check(ctx: &Context, msg: &&Message) -> CheckResult return CheckResult::Success } } + + if let Some(roles) = member.roles(ctx).await { + if roles + .iter() + .filter(|r| r.permissions.manage_guild() || r.permissions.administrator() ) + .next() + .is_some() { + return CheckResult::Success + } + } } }