mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +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]
|
||||
async fn main() {
|
||||
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 cloned_bot = bot.clone();
|
||||
teloxide::repl_with_listener(
|
||||
bot,
|
||||
|message| async move {
|
||||
message.answer("pong").await?;
|
||||
bot.clone(),
|
||||
|mes: Message, bot: AutoSend<Bot>| async move {
|
||||
bot.send_message(mes.chat.id, "pong").await?;
|
||||
respond(())
|
||||
},
|
||||
webhook(cloned_bot).await,
|
||||
webhook(bot).await,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue