From 9ef41fdfec72ede9ac03f83c42f24746c8557209 Mon Sep 17 00:00:00 2001 From: Ladislav Hano Date: Wed, 2 Oct 2024 22:09:45 +0200 Subject: [PATCH] fix: member not in guild crashed birthday party --- src/other/notice.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/other/notice.rs b/src/other/notice.rs index 3b07c4c..7ddbc4d 100644 --- a/src/other/notice.rs +++ b/src/other/notice.rs @@ -138,9 +138,12 @@ async fn notice(http: Arc) -> anyhow::Result<()> { for bd in &birtdays { let user_id = UserId::new(bd.id); - guild_id.member(http.clone(), user_id).await?; + match guild_id.member(http.clone(), user_id).await { + Ok(_) => (), + Err(_) => continue + }; - celebrate_birthday(guild_id, user_id, bd.nick.as_str(), http.clone()).await?; + let _ = celebrate_birthday(guild_id, user_id, bd.nick.as_str(), http.clone()).await; } // TODO if has year delete it from announce and delete @@ -150,7 +153,7 @@ async fn notice(http: Arc) -> anyhow::Result<()> { continue; } - announce_event(guild_id, e.name.as_str(), e.special_message.as_str(), http.clone()).await?; + let _ = announce_event(guild_id, e.name.as_str(), e.special_message.as_str(), http.clone()).await; } }