Update donation notification check to include private chats

This commit is contained in:
2024-03-17 00:41:15 +01:00
parent 4f1dbdf9ab
commit aea9dbd96b
2 changed files with 3 additions and 2 deletions

View File

@@ -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;

View File

@@ -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)