mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 15:01:45 +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>;
|
N: Into<String>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type PrefixedBotCommand = String;
|
||||||
|
pub type BotName = String;
|
||||||
|
|
||||||
/// Errors returned from [`BotCommand::parse`].
|
/// Errors returned from [`BotCommand::parse`].
|
||||||
///
|
///
|
||||||
/// [`BotCommand::parse`]: crate::utils::command::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
|
/// [`FromStr::from_str`]: https://doc.rust-lang.org/std/str/trait.FromStr.html#tymethod.from_str
|
||||||
IncorrectFormat,
|
IncorrectFormat,
|
||||||
|
|
||||||
UnknownCommand(String),
|
UnknownCommand(PrefixedBotCommand),
|
||||||
WrongBotName(String),
|
WrongBotName(BotName),
|
||||||
|
|
||||||
/// A custom error which you can return from your custom parser.
|
/// A custom error which you can return from your custom parser.
|
||||||
Custom(Box<dyn Error>),
|
Custom(Box<dyn Error>),
|
||||||
|
|
Loading…
Reference in a new issue