From 56c1c55f881776f4452398c9920e5552ef3993c0 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Sat, 2 Apr 2022 15:51:59 +0600 Subject: [PATCH] Update `README.md` --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e3620ef3..83ebe7d8 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ Commands are strongly typed and defined declaratively, similar to how we define ([Full](examples/simple_commands.rs)) ```rust,no_run -use teloxide::{prelude::*, utils::command::BotCommand}; +use teloxide::{prelude::*, utils::command::BotCommands}; use std::error::Error; @@ -139,7 +139,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.")] @@ -156,7 +156,9 @@ async fn answer( command: Command, ) -> Result<(), Box> { match command { - Command::Help => bot.send_message(message.chat.id, Command::descriptions().to_string()).await?, + Command::Help => { + bot.send_message(message.chat.id, Command::descriptions().to_string()).await? + } Command::Username(username) => { bot.send_message(message.chat.id, format!("Your username is @{}.", username)).await? }