diff --git a/examples/admin.rs b/examples/admin.rs index 4295b0a8..90f95255 100644 --- a/examples/admin.rs +++ b/examples/admin.rs @@ -3,7 +3,7 @@ use std::{error::Error, str::FromStr}; use chrono::Duration; use teloxide::{prelude2::*, types::ChatPermissions, utils::command::BotCommands}; -// Derive BotCommand to parse text with a command into this enumeration. +// Derive BotCommands to parse text with a command into this enumeration. // // 1. rename = "lowercase" turns all the commands into lowercase letters. // 2. `description = "..."` specifies a text before all the commands. diff --git a/src/utils/command.rs b/src/utils/command.rs index ee77b11e..943acfb2 100644 --- a/src/utils/command.rs +++ b/src/utils/command.rs @@ -209,7 +209,7 @@ pub use teloxide_macros::BotCommands; /// specific variant. /// /// [`FromStr`]: https://doc.rust-lang.org/std/str/trait.FromStr.html -/// [`BotCommand`]: crate::utils::command::BotCommand +/// [`BotCommands`]: crate::utils::command::BotCommands pub trait BotCommands: Sized { /// Parses a command. /// diff --git a/tests/command.rs b/tests/command.rs index 0176c749..a522b2a3 100644 --- a/tests/command.rs +++ b/tests/command.rs @@ -200,7 +200,7 @@ fn descriptions_off() { #[test] #[cfg(feature = "macros")] fn rename_rules() { - #[derive(BotCommand, Debug, PartialEq)] + #[derive(BotCommands, Debug, PartialEq)] enum DefaultCommands { #[command(rename = "lowercase")] AaaAaa, @@ -230,7 +230,7 @@ fn rename_rules() { assert_eq!(DefaultCommands::HhhHhh, DefaultCommands::parse("/HHH-HHH", "").unwrap()); assert_eq!( - "/aaaaaa\n/BBBBBB\n/CccCcc\n/dddDdd\n/eee_eee\n/FFF_FFF\n/ggg-ggg\n/HHH-HHH\n", - DefaultCommands::descriptions() + "/aaaaaa\n/BBBBBB\n/CccCcc\n/dddDdd\n/eee_eee\n/FFF_FFF\n/ggg-ggg\n/HHH-HHH", + DefaultCommands::descriptions().to_string() ); }