This commit is contained in:
2024-01-08 03:26:15 +01:00
parent f4511ea2b4
commit 204d812120

View File

@@ -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) {