Add donation notifications

This commit is contained in:
2023-05-24 21:30:21 +02:00
parent f9723361a0
commit 10b063ac25
6 changed files with 86 additions and 16 deletions

View File

@@ -25,6 +25,7 @@ use self::bot_manager_client::get_bots;
pub struct AppState {
pub user_activity_cache: Cache<UserId, bool>,
pub user_langs_cache: Cache<UserId, Vec<String>>,
pub chat_donation_notifications_cache: Cache<ChatId, bool>,
}
pub struct BotsManager {
@@ -41,12 +42,16 @@ impl BotsManager {
app_state: AppState {
user_activity_cache: Cache::builder()
.time_to_live(Duration::from_secs(5 * 60))
.max_capacity(4096)
.max_capacity(16384)
.build(),
user_langs_cache: Cache::builder()
.time_to_live(Duration::from_secs(5 * 60))
.max_capacity(4096)
.max_capacity(16384)
.build(),
chat_donation_notifications_cache: Cache::builder()
.time_to_live(Duration::from_secs(24 * 60 * 60))
.max_capacity(32768)
.build()
},
next_port: 8000,
bot_port_map: HashMap::new(),