1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! Filters are main part of the library used to filter incoming updates and allow call handlers by their data
//! (text, chat, user, command, state, db, etc.) and other conditions.
//!
//! [`Filter`] is a trait that accepts [`Request`] and returns `true` if the filter passes, otherwise `false`.
//! You can use [`Filter`] trait to create your own filters or use one of the ready-made implementations.
//! Most likely you will have to write your filters, so we recommend you to check out the `examples/text_case_filter` to see how to create your own filters
//! and check ready-made implementations.
//!
//! Filters can be combined with logical operators [`And`] and [`Or`] and inverted with [`Invert`].
//! Each filter has a method [`Filter::invert`], [`Filter::and`] and [`Filter::or`] to create [`Invert`], [`And`] and [`Or`] filters respectively.
//!
//! Ready-made implementations:
//! * [`ChatMemberUpdated`]:
//! Filter for checking chat member status updates.
//! Allows matching transitions between old and new [`ChatMemberType`].
//!
//! You can specify only the new status or both (old and new) to match an exact transition.
//! If the old status is not specified, the filter will match any transition to the given new status.
//!
//! Created with `new` and can be further restricted by specifying
//! the old status via `old`.
//! * [`SmartFilter`]:
//! Filter for most common cases.
//! Used to check if the update meets the necessary conditions.
//! * [`ChatType`]:
//! Filter for checking the type of chat.
//! Usually used with [`ChatTypeEnum`] (or its string representation) to check the type of chat.
//! Creates with `one` or `many` methods.
//! * [`Command`]:
//! This filter checks if the message is a command.
//! Filter accepts [`command pattern type`] that represents a command pattern type for verification,
//! for example, text, [`BotCommand`] (just alias to text of command) or [`Regex`].
//! You can create a filter with `new` method with transferring all necessary data at once, or use [`CommandBuilder`] to create a filter step by step.
//! Instead of [`CommandBuilder`] you can use [`Command`] `one`, `one_with_prefix`, `many`, `many_with_prefix` methods.
//! * [`MessageType`]:
//! Filter for checking the type of the message content.
//! Usually used with [`enums::MessageType`] (or its string representation) to check the type of content.
//! Creates with `one` or `many` methods.
//! * [`State`]:
//! Filter for checking the state of the user/chat/etc.
//! Filter accepts a state mode represented by [`State`] variants,
//! for example, equal, any or none.
//! You can create a filter with `one` or `many` if you want to check the state with the exact value
//! or use `any` or `none` if you want to check the state with any value or without state, respectively.
//! * [`Text`]:
//! This filter checks if the text matches the specified pattern.
//! Gets the text from the update: the text of the message, the text of the inline query, the data of the callback query, etc.
//! Filter accepts [`text pattern type`] that represents a text pattern type to check for equality, so you can use [`Regex`] or [`Cow`] to check the text.
//! You can create a filter with `one` or `many` if you want to check the text with the exact value.
//! If you want to check the text with `contains`, `starts_with` or `ends_with` methods that accept only [`Cow`],
//! you can create a filter with `contains_single`, `contains`, `starts_with_single`, `starts_with`, `ends_with_single`, or `ends_with` methods,
//! or use [`TextBuilder`] to create a filter step by step.
//! * [`User`]:
//! Filter for checking the user.
//! This filter checks if the user username, first name, last name, language code or ID is equal to one of the specified.
//! You can create a filter with `new` method with transferring all necessary data at once, or use [`UserBuilder`] to create a filter step by step.
//! Instead of [`UserBuilder`] you can use [`User`] `username`, `usernames`, `first_name`, `first_names`, `last_name`, `last_names`,
//! `language_code`, `language_codes`, `id` or `ids` methods.
//! This filter checks user data step by step using the logical operator `or`,
//! so if at least one check is successful, the filter will return the value `true`.
//!
//! [`Cow`]: std::borrow::Cow
//! [`Regex`]: regex::Regex
//! [`ChatTypeEnum`]: telers::enums::ChatType
//! [`enums::MessageType`]: telers::enums::MessageType
//! [`BotCommand`]: telers::types::BotCommand
//! [`Regex`]: regex::Regex
//! [`Request`]: telers::Request
//! [`context`]: telers::context::Context
//! [`command pattern type`]: command::PatternType
//! [`text pattern type`]: text::PatternType
pub use ;
pub use ChatMemberUpdated;
pub use ChatType;
pub use ;
pub use ;
pub use MessageType;
pub use SmartFilter;
pub use State;
pub use ;
pub use ;