This commit is contained in:
2024-01-08 03:04:22 +01:00
parent 7b6b43ca81
commit 91fe59b215
2 changed files with 6 additions and 2 deletions

View File

@@ -47,6 +47,8 @@ pub fn get_listener() -> (
} }
pub async fn set_webhook(bot_data: &BotData) -> bool { 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 bot = Bot::new(bot_data.token.clone());
let token = &bot_data.token; let token = &bot_data.token;
@@ -70,7 +72,7 @@ pub async fn start_bot(bot_data: &BotData) {
let token = bot.inner().inner().token(); 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(); let (handler, commands) = crate::bots::get_bot_handler();

View File

@@ -57,7 +57,9 @@ pub static BOTS_ROUTES: Lazy<Cache<String, StopTokenWithSender>> = Lazy::new(||
Cache::builder() Cache::builder()
.time_to_idle(Duration::from_secs(60 * 60)) .time_to_idle(Duration::from_secs(60 * 60))
.max_capacity(100) .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; let (stop_token, mut sender) = value;
stop_token.stop(); stop_token.stop();