MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / TextMatchFilter

Class TextMatchFilter

telebot/custom_filters.py:198–220  ·  view source on GitHub ↗

Filter to check Text message. .. code-block:: python3 :caption: Example on using this filter: @bot.message_handler(text=['account']) # your function

Source from the content-addressed store, hash-verified

196 return False
197
198class 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
223class TextContainsFilter(AdvancedCustomFilter):

Callers 2

main.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…