mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Fix examples/admin_bot
, examples/simple_commands_bot
This commit is contained in:
parent
2058395d54
commit
0a6487c23c
2 changed files with 3 additions and 13 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue