From 18afd9a95e3bd4a49a2e0aa262add931f9bc5693 Mon Sep 17 00:00:00 2001 From: p0lunin Date: Wed, 5 Jan 2022 20:19:39 +0200 Subject: [PATCH] update heroku_ping_pong example --- examples/heroku_ping_pong_bot/src/main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/heroku_ping_pong_bot/src/main.rs b/examples/heroku_ping_pong_bot/src/main.rs index 2ce69955..508bcafc 100644 --- a/examples/heroku_ping_pong_bot/src/main.rs +++ b/examples/heroku_ping_pong_bot/src/main.rs @@ -24,14 +24,13 @@ async fn main() { 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| async move { + bot.send_message(mes.chat.id, "pong").await?; respond(()) }, - webhook(cloned_bot).await, + webhook(bot).await, ) .await; }