mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
refactoring
This commit is contained in:
parent
5f27eaf6d1
commit
5e276d65f4
1 changed files with 5 additions and 2 deletions
|
@ -194,6 +194,9 @@ pub trait BotCommand: Sized {
|
|||
N: Into<String>;
|
||||
}
|
||||
|
||||
pub type PrefixedBotCommand = String;
|
||||
pub type BotName = String;
|
||||
|
||||
/// Errors returned from [`BotCommand::parse`].
|
||||
///
|
||||
/// [`BotCommand::parse`]: crate::utils::command::BotCommand::parse
|
||||
|
@ -215,8 +218,8 @@ pub enum ParseError {
|
|||
/// [`FromStr::from_str`]: https://doc.rust-lang.org/std/str/trait.FromStr.html#tymethod.from_str
|
||||
IncorrectFormat,
|
||||
|
||||
UnknownCommand(String),
|
||||
WrongBotName(String),
|
||||
UnknownCommand(PrefixedBotCommand),
|
||||
WrongBotName(BotName),
|
||||
|
||||
/// A custom error which you can return from your custom parser.
|
||||
Custom(Box<dyn Error>),
|
||||
|
|
Loading…
Reference in a new issue