mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Fix some places with remaining BotCommand
(w/o s
)
This commit is contained in:
parent
91bea5be5e
commit
6922128cb6
3 changed files with 5 additions and 5 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -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()
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue