mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Refactor donation notification logic for clarity and efficiency
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled
This commit is contained in:
@@ -21,24 +21,19 @@ pub async fn send_donation_notification(
|
|||||||
.is_some()
|
.is_some()
|
||||||
{
|
{
|
||||||
return Ok(());
|
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
|
CHAT_DONATION_NOTIFICATIONS_CACHE
|
||||||
.insert(message.chat().id, ())
|
.insert(message.chat().id, ())
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
if is_need_donate_notifications(message.chat().id, message.chat().is_private()).await? {
|
||||||
mark_donate_notification_sent(message.chat().id).await?;
|
mark_donate_notification_sent(message.chat().id).await?;
|
||||||
|
|
||||||
match message {
|
if let MaybeInaccessibleMessage::Regular(message) = message {
|
||||||
MaybeInaccessibleMessage::Regular(message) => {
|
|
||||||
support_command_handler(*message, bot).await?;
|
support_command_handler(*message, bot).await?;
|
||||||
}
|
}
|
||||||
MaybeInaccessibleMessage::Inaccessible(_) => {}
|
};
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user