This commit is contained in:
2023-06-21 11:43:44 +02:00
parent 00204bb4c0
commit 5a725eb30c
4 changed files with 5 additions and 3 deletions

1
Cargo.lock generated
View File

@@ -212,6 +212,7 @@ dependencies = [
"sentry", "sentry",
"serde", "serde",
"serde_json", "serde_json",
"smallvec",
"strum", "strum",
"strum_macros", "strum_macros",
"teloxide", "teloxide",

View File

@@ -28,3 +28,4 @@ sentry = "0.31.3"
lazy_static = "1.4.0" lazy_static = "1.4.0"
moka = { version = "0.11.1", features = ["future"] } moka = { version = "0.11.1", features = ["future"] }
axum = "0.6.18" axum = "0.6.18"
smallvec = "1.10.0"

View File

@@ -22,7 +22,7 @@ use super::{ignore_channel_messages, BotCommands, BotHandler, bots_manager::get_
async fn _update_activity( async fn _update_activity(
me: teloxide::types::Me, me: teloxide::types::Me,
user: teloxide::types::User, user: teloxide::types::User,
activity_cache: Cache<UserId, bool>, activity_cache: Cache<UserId, ()>,
user_langs_cache: Cache<UserId, Vec<String>>, user_langs_cache: Cache<UserId, Vec<String>>,
) -> Option<()> { ) -> Option<()> {
if activity_cache.contains_key(&user.id) { if activity_cache.contains_key(&user.id) {
@@ -50,7 +50,7 @@ async fn _update_activity(
} }
if update_result.is_ok() { if update_result.is_ok() {
activity_cache.insert(user.id, true).await; activity_cache.insert(user.id, ()).await;
} }
}); });

View File

@@ -24,7 +24,7 @@ use crate::config;
#[derive(Clone)] #[derive(Clone)]
pub struct AppState { pub struct AppState {
pub user_activity_cache: Cache<UserId, bool>, pub user_activity_cache: Cache<UserId, ()>,
pub user_langs_cache: Cache<UserId, Vec<String>>, pub user_langs_cache: Cache<UserId, Vec<String>>,
pub chat_donation_notifications_cache: Cache<ChatId, ()>, pub chat_donation_notifications_cache: Cache<ChatId, ()>,
} }