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:
@@ -57,11 +57,13 @@ pub async fn set_webhook(bot_data: &BotData) -> bool {
|
|||||||
let url = Url::parse(&format!("{host}/{token}/"))
|
let url = Url::parse(&format!("{host}/{token}/"))
|
||||||
.unwrap_or_else(|_| panic!("Can't parse webhook url!"));
|
.unwrap_or_else(|_| panic!("Can't parse webhook url!"));
|
||||||
|
|
||||||
if bot.set_webhook(url.clone()).await.is_err() {
|
match bot.set_webhook(url.clone()).await {
|
||||||
return false;
|
Ok(_) => true,
|
||||||
|
Err(err) => {
|
||||||
|
log::error!("Webhook set error: {}", err);
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn start_bot(bot_data: &BotData) {
|
pub async fn start_bot(bot_data: &BotData) {
|
||||||
|
|||||||
Reference in New Issue
Block a user