diff --git a/examples/admin_bot/src/main.rs b/examples/admin_bot/src/main.rs index 9d2e9a78..c5f77a7a 100644 --- a/examples/admin_bot/src/main.rs +++ b/examples/admin_bot/src/main.rs @@ -1,11 +1,7 @@ use std::{error::Error, str::FromStr}; use chrono::{DateTime, Duration, NaiveDateTime, Utc}; -use teloxide::{ - prelude2::*, - types::{ChatPermissions, Me}, - utils::command::BotCommand, -}; +use teloxide::{prelude2::*, types::ChatPermissions, utils::command::BotCommand}; // Derive BotCommand to parse text with a command into this enumeration. // @@ -160,7 +156,5 @@ async fn main() { let bot = Bot::from_env().auto_send(); - let Me { user: bot_user, .. } = bot.get_me().await.unwrap(); - let bot_name = bot_user.username.expect("Bots must have usernames"); - teloxide::repls2::commands_repl(bot, bot_name, action, Command::ty()).await; + teloxide::repls2::commands_repl(bot, action, Command::ty()).await; } diff --git a/examples/simple_commands_bot/src/main.rs b/examples/simple_commands_bot/src/main.rs index f3dfb30b..f18953e4 100644 --- a/examples/simple_commands_bot/src/main.rs +++ b/examples/simple_commands_bot/src/main.rs @@ -1,7 +1,6 @@ use teloxide::{prelude2::*, utils::command::BotCommand}; use std::error::Error; -use teloxide::types::Me; #[derive(BotCommand, Clone)] #[command(rename = "lowercase", description = "These commands are supported:")] @@ -43,8 +42,5 @@ async fn main() { let bot = Bot::from_env().auto_send(); - let Me { user: bot_user, .. } = bot.get_me().await.unwrap(); - let bot_name = bot_user.username.expect("Bots must have usernames"); - - teloxide::repls2::commands_repl(bot, bot_name, answer, Command::ty()).await; + teloxide::repls2::commands_repl(bot, answer, Command::ty()).await; }