fix: member not in guild crashed birthday party

This commit is contained in:
Ladislav Hano 2024-10-02 22:09:45 +02:00
parent 54b4dc9a13
commit 9ef41fdfec

View file

@ -138,9 +138,12 @@ async fn notice(http: Arc<Http>) -> 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<Http>) -> 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;
}
}