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; }