added role perm checking

This commit is contained in:
jude 2020-07-07 16:32:14 +01:00
parent f46b0e4021
commit 30f58be0ac

View File

@ -218,6 +218,16 @@ async fn perform_permission_check(ctx: &Context, msg: &&Message) -> CheckResult
return CheckResult::Success 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
}
}
} }
} }