feat: replace owner by administrator right

This commit is contained in:
Max batleforc 2024-06-28 15:31:48 +02:00
parent be6c76c00f
commit 6fd51ef7d8
No known key found for this signature in database
GPG Key ID: 25D243AB4B6AC9E7

View File

@ -34,6 +34,12 @@ pub async fn check_if_server_enable_and_user_admin(
match guild.member(http, UserId::new(user_id)).await {
Ok(member) => {
info!("Checking if user is admin");
if let Some(perm) = member.permissions {
if perm.administrator() {
info!("User has administarator permission");
return Ok((true, Some(server_config)));
}
}
if member
.permissions
.into_iter()