mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +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()
|
.is_some()
|
||||||
{
|
{
|
||||||
return Ok(());
|
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
|
CHAT_DONATION_NOTIFICATIONS_CACHE
|
||||||
.insert(message.chat.id, ())
|
.insert(message.chat.id, ())
|
||||||
.await;
|
.await;
|
||||||
|
|||||||
@@ -118,10 +118,11 @@ pub async fn update_user_activity(
|
|||||||
|
|
||||||
pub async fn is_need_donate_notifications(
|
pub async fn is_need_donate_notifications(
|
||||||
chat_id: ChatId,
|
chat_id: ChatId,
|
||||||
|
is_private: bool,
|
||||||
) -> Result<bool, Box<dyn std::error::Error + Send + Sync>> {
|
) -> Result<bool, Box<dyn std::error::Error + Send + Sync>> {
|
||||||
let response = reqwest::Client::new()
|
let response = reqwest::Client::new()
|
||||||
.get(format!(
|
.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
|
&config::CONFIG.user_settings_url
|
||||||
))
|
))
|
||||||
.header("Authorization", &config::CONFIG.user_settings_api_key)
|
.header("Authorization", &config::CONFIG.user_settings_api_key)
|
||||||
|
|||||||
Reference in New Issue
Block a user