added role perm checking
This commit is contained in:
parent
f46b0e4021
commit
30f58be0ac
10
src/main.rs
10
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user