mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Remove {token}
from webhook url in heroku example
This commit is contained in:
parent
be9c20ef32
commit
78a96381dc
1 changed files with 1 additions and 3 deletions
|
@ -21,7 +21,6 @@
|
|||
use std::env;
|
||||
|
||||
use teloxide::{dispatching::update_listeners::webhooks, prelude::*};
|
||||
use url::Url;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
|
@ -29,7 +28,6 @@ async fn main() {
|
|||
log::info!("Starting Heroku ping-pong bot...");
|
||||
|
||||
let bot = Bot::from_env().auto_send();
|
||||
let token = bot.inner().token();
|
||||
|
||||
// Heroku auto defines a port value
|
||||
let port: u16 = env::var("PORT")
|
||||
|
@ -41,7 +39,7 @@ async fn main() {
|
|||
|
||||
// Heroku host example: "heroku-ping-pong-bot.herokuapp.com"
|
||||
let host = env::var("HOST").expect("HOST env variable is not set");
|
||||
let url = Url::parse(&format!("https://{host}/webhooks/{token}")).unwrap();
|
||||
let url = format!("https://{host}/webhook").parse().unwrap();
|
||||
|
||||
let listener = webhooks::axum(bot.clone(), webhooks::Options::new(addr, url))
|
||||
.await
|
||||
|
|
Loading…
Reference in a new issue