Refactor donation notification logic for clarity and efficiency
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled

This commit is contained in:
2025-06-22 17:39:47 +02:00
parent ad18a485a1
commit d79da1b955

View File

@@ -21,24 +21,19 @@ pub async fn send_donation_notification(
.is_some()
{
return Ok(());
} else if !is_need_donate_notifications(message.chat().id, message.chat().is_private()).await? {
CHAT_DONATION_NOTIFICATIONS_CACHE
.insert(message.chat().id, ())
.await;
return Ok(());
}
CHAT_DONATION_NOTIFICATIONS_CACHE
.insert(message.chat().id, ())
.await;
mark_donate_notification_sent(message.chat().id).await?;
match message {
MaybeInaccessibleMessage::Regular(message) => {
if is_need_donate_notifications(message.chat().id, message.chat().is_private()).await? {
mark_donate_notification_sent(message.chat().id).await?;
if let MaybeInaccessibleMessage::Regular(message) = message {
support_command_handler(*message, bot).await?;
}
MaybeInaccessibleMessage::Inaccessible(_) => {}
}
};
Ok(())
}