mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
Update donation notification check to include private chats
This commit is contained in:
@@ -21,7 +21,7 @@ pub async fn send_donation_notification(
|
||||
.is_some()
|
||||
{
|
||||
return Ok(());
|
||||
} else if !is_need_donate_notifications(message.chat.id).await? {
|
||||
} else if !is_need_donate_notifications(message.chat.id, message.chat.is_private()).await? {
|
||||
CHAT_DONATION_NOTIFICATIONS_CACHE
|
||||
.insert(message.chat.id, ())
|
||||
.await;
|
||||
|
||||
@@ -118,10 +118,11 @@ pub async fn update_user_activity(
|
||||
|
||||
pub async fn is_need_donate_notifications(
|
||||
chat_id: ChatId,
|
||||
is_private: bool,
|
||||
) -> Result<bool, Box<dyn std::error::Error + Send + Sync>> {
|
||||
let response = reqwest::Client::new()
|
||||
.get(format!(
|
||||
"{}/donate_notifications/{chat_id}/is_need_send",
|
||||
"{}/donate_notifications/{chat_id}/is_need_send?is_private={is_private}",
|
||||
&config::CONFIG.user_settings_url
|
||||
))
|
||||
.header("Authorization", &config::CONFIG.user_settings_api_key)
|
||||
|
||||
Reference in New Issue
Block a user