mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +01:00
update ngrok_bot example
This commit is contained in:
parent
9892096027
commit
0eb9314c71
1 changed files with 5 additions and 6 deletions
|
@ -20,18 +20,17 @@ use reqwest::{StatusCode, Url};
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
teloxide::enable_logging!();
|
teloxide::enable_logging!();
|
||||||
log::info!("Starting ngrok_ping_pong_bot...");
|
log::info!("Starting heroku_ping_pong_bot...");
|
||||||
|
|
||||||
let bot = Bot::from_env().auto_send();
|
let bot = Bot::from_env().auto_send();
|
||||||
|
|
||||||
let cloned_bot = bot.clone();
|
|
||||||
teloxide::repl_with_listener(
|
teloxide::repl_with_listener(
|
||||||
bot,
|
bot.clone(),
|
||||||
|message| async move {
|
|mes: Message, bot: AutoSend<Bot>| async move {
|
||||||
message.answer("pong").await?;
|
bot.send_message(mes.chat.id, "pong").await?;
|
||||||
respond(())
|
respond(())
|
||||||
},
|
},
|
||||||
webhook(cloned_bot).await,
|
webhook(bot).await,
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue