webhook: drop duplicate set_webhook, ignore empty env vars

This commit is contained in:
2026-08-04 15:58:32 +08:00
parent 7c5afce0b4
commit 6fd4edb3c5
2 changed files with 10 additions and 3 deletions
+2 -1
View File
@@ -96,7 +96,8 @@ async fn main() {
.webhook_url
.clone()
.expect("WEBHOOK_URL is not set");
bot.set_webhook(url.clone()).await.unwrap();
// `webhooks::axum` calls set_webhook itself (with the full options,
// secret token included) — no explicit registration here.
let listen = CONFIG.webhook_listen.expect("WEBHOOK_LISTEN is not set");
let port = CONFIG.webhook_port.expect("WEBHOOK_PORT is not set");
let mut options = webhooks::Options::new((listen, port).into(), url);