mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
docs for CommandFilter
This commit is contained in:
parent
c3c9b92f87
commit
eb430b0487
1 changed files with 10 additions and 0 deletions
|
@ -1,5 +1,15 @@
|
|||
use crate::{dispatching::Filter, types::Message};
|
||||
|
||||
/// Filter which find command in message text
|
||||
///
|
||||
/// *NB:* filter compare only text of message, not caption of media message
|
||||
///
|
||||
/// Examples:
|
||||
/// ```
|
||||
/// use teloxide::dispatching::filters::CommandFilter;
|
||||
/// CommandFilter::new("start"); // return true if text message starts with "/start"
|
||||
/// CommandFilter::with_prefix("!", "ban"); // return true if text message starts with "!ban"
|
||||
/// ```
|
||||
pub struct CommandFilter {
|
||||
command: String,
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue