Filter to check Text message. .. code-block:: python3 :caption: Example on using this filter: @bot.message_handler(text=['account']) # your function
| 196 | return False |
| 197 | |
| 198 | class TextMatchFilter(AdvancedCustomFilter): |
| 199 | """ |
| 200 | Filter to check Text message. |
| 201 | |
| 202 | .. code-block:: python3 |
| 203 | :caption: Example on using this filter: |
| 204 | |
| 205 | @bot.message_handler(text=['account']) |
| 206 | # your function |
| 207 | """ |
| 208 | |
| 209 | key = 'text' |
| 210 | |
| 211 | def check(self, message, text): |
| 212 | """ |
| 213 | :meta private: |
| 214 | """ |
| 215 | if isinstance(text, TextFilter): |
| 216 | return text.check(message) |
| 217 | elif isinstance(text, list): |
| 218 | return message.text in text |
| 219 | else: |
| 220 | return text == message.text |
| 221 | |
| 222 | |
| 223 | class TextContainsFilter(AdvancedCustomFilter): |
no outgoing calls
no test coverage detected
searching dependent graphs…