mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Update webhook checker
Some checks are pending
Build docker image / Build-Docker-Image (push) Waiting to run
Some checks are pending
Build docker image / Build-Docker-Image (push) Waiting to run
This commit is contained in:
@@ -16,6 +16,7 @@ use url::Url;
|
|||||||
|
|
||||||
use std::convert::Infallible;
|
use std::convert::Infallible;
|
||||||
|
|
||||||
|
use crate::bots_manager::bot_manager_client::delete_bot;
|
||||||
use crate::bots_manager::BOTS_ROUTES;
|
use crate::bots_manager::BOTS_ROUTES;
|
||||||
use crate::config;
|
use crate::config;
|
||||||
|
|
||||||
@@ -64,10 +65,10 @@ pub async fn set_webhook(bot_data: &BotData) -> bool {
|
|||||||
match bot.set_webhook(url.clone()).await {
|
match bot.set_webhook(url.clone()).await {
|
||||||
Ok(_) => true,
|
Ok(_) => true,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
if let teloxide::RequestError::Api(ref _err) = err {
|
if let teloxide::RequestError::Api(ref err) = err {
|
||||||
// if err == &teloxide::ApiError::NotFound {
|
if err == &teloxide::ApiError::InvalidToken {
|
||||||
// let _ = delete_bot(bot_data.id).await;
|
let _ = delete_bot(bot_data.id).await;
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log::error!("Webhook set error: {}", err);
|
log::error!("Webhook set error: {}", err);
|
||||||
|
|||||||
Reference in New Issue
Block a user