mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix
This commit is contained in:
@@ -47,6 +47,8 @@ pub fn get_listener() -> (
|
||||
}
|
||||
|
||||
pub async fn set_webhook(bot_data: &BotData) -> bool {
|
||||
log::info!("Set webhook Bot(id={})!", bot_data.id);
|
||||
|
||||
let bot = Bot::new(bot_data.token.clone());
|
||||
|
||||
let token = &bot_data.token;
|
||||
@@ -70,7 +72,7 @@ pub async fn start_bot(bot_data: &BotData) {
|
||||
|
||||
let token = bot.inner().inner().token();
|
||||
|
||||
log::info!("Start bot(id={})", bot_data.id);
|
||||
log::info!("Start Bot(id={})!", bot_data.id);
|
||||
|
||||
let (handler, commands) = crate::bots::get_bot_handler();
|
||||
|
||||
|
||||
@@ -57,7 +57,9 @@ pub static BOTS_ROUTES: Lazy<Cache<String, StopTokenWithSender>> = Lazy::new(||
|
||||
Cache::builder()
|
||||
.time_to_idle(Duration::from_secs(60 * 60))
|
||||
.max_capacity(100)
|
||||
.eviction_listener(|_token, value: StopTokenWithSender, _cause| {
|
||||
.eviction_listener(|token, value: StopTokenWithSender, _cause| {
|
||||
log::info!("Stop Bot(token={})!", token);
|
||||
|
||||
let (stop_token, mut sender) = value;
|
||||
|
||||
stop_token.stop();
|
||||
|
||||
Reference in New Issue
Block a user