mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Some fixing stuff lol
This commit is contained in:
parent
18651a8253
commit
5000c4cec4
3 changed files with 6 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
use std::{error::Error, str::FromStr};
|
||||
|
||||
use chrono::Duration;
|
||||
use teloxide::{prelude::*, types::ChatPermissions, utils::command::BotCommand};
|
||||
use teloxide::{prelude::*, types::ChatPermissions, utils::command::BotCommands};
|
||||
|
||||
// Derive BotCommands to parse text with a command into this enumeration.
|
||||
//
|
||||
|
@ -72,7 +72,7 @@ async fn action(
|
|||
) -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
match command {
|
||||
Command::Help => {
|
||||
bot.send_message(msg.chat.id, Command::descriptions()).await?;
|
||||
bot.send_message(msg.chat.id, Command::descriptions().to_string()).await?;
|
||||
}
|
||||
Command::Kick => kick_user(bot, msg).await?,
|
||||
Command::Ban { time, unit } => ban_user(bot, msg, calc_restrict_time(time, unit)).await?,
|
||||
|
|
|
@ -6,7 +6,7 @@ use rand::Rng;
|
|||
use teloxide::{
|
||||
prelude::*,
|
||||
types::{Dice, Update},
|
||||
utils::command::BotCommand,
|
||||
utils::command::BotCommands,
|
||||
};
|
||||
|
||||
#[tokio::main]
|
||||
|
@ -122,7 +122,7 @@ async fn simple_commands_handler(
|
|||
bot: AutoSend<Bot>,
|
||||
cmd: SimpleCommand,
|
||||
cfg: ConfigParameters,
|
||||
me: Me,
|
||||
me: teloxide::types::Me,
|
||||
) -> Result<(), teloxide::RequestError> {
|
||||
let text = match cmd {
|
||||
SimpleCommand::Help => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use teloxide::{prelude::*, utils::command::BotCommand};
|
||||
use teloxide::{prelude::*, utils::command::BotCommands};
|
||||
|
||||
use std::error::Error;
|
||||
|
||||
|
@ -12,7 +12,7 @@ async fn main() {
|
|||
teloxide::commands_repl(bot, answer, Command::ty()).await;
|
||||
}
|
||||
|
||||
#[derive(BotCommand, Clone)]
|
||||
#[derive(BotCommands, Clone)]
|
||||
#[command(rename = "lowercase", description = "These commands are supported:")]
|
||||
enum Command {
|
||||
#[command(description = "display this text.")]
|
||||
|
|
Loading…
Reference in a new issue