From 9acddfbebf11f4a902f9116d06c76dea7de9628c Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:07:19 +0800 Subject: [PATCH] fix: allow guild missing from cache --- src/handlers/intelligence.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/handlers/intelligence.rs b/src/handlers/intelligence.rs index e2f6e3f..89fe149 100644 --- a/src/handlers/intelligence.rs +++ b/src/handlers/intelligence.rs @@ -28,7 +28,9 @@ pub async fn handle(ctx: &serenity::Context, message: &serenity::Message) -> Res } if let Ok(member) = message.member(&ctx).await { - if !member.permissions(&ctx.cache)?.administrator() + if !member + .permissions(&ctx.cache) + .is_ok_and(|p| p.administrator()) && !member .roles .iter()