From cf78234e3a36da72e55e60364c4bebcadf1ca1cd Mon Sep 17 00:00:00 2001 From: _run Date: Sun, 12 Sep 2021 20:30:32 +0500 Subject: [PATCH] Update README.md --- README.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e92cef9..2204efd 100644 --- a/README.md +++ b/README.md @@ -169,19 +169,6 @@ TeleBot supports the following filters: |commands|list of strings|`True` if `message.content_type == 'text'` and `message.text` starts with a command that is in the list of strings.| |chat_types|list of chat types|`True` if `message.chat.type` in your filter |func|a function (lambda or function reference)|`True` if the lambda or function reference returns `True` - -### Custom filters -Also, you can use built-in custom filters. Or, you can create your own filter. - -[Example of custom filter](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/custom_filters.py) - -Also, we have examples on them. Check this links: - -You can check some built-in filters in source [code](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/telebot/custom_filters.py) - -Example of [filtering by id](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/id_filter_example.py) - -Example of [filtering by text](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/text_filter_example.py) Here are some examples of using the filters and message handlers: @@ -300,6 +287,21 @@ def start(message): assert message.another_text == message.text + ':changed' ``` There are other examples using middleware handler in the [examples/middleware](examples/middleware) directory. + + +### Custom filters +Also, you can use built-in custom filters. Or, you can create your own filter. + +[Example of custom filter](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/custom_filters.py) + +Also, we have examples on them. Check this links: + +You can check some built-in filters in source [code](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/telebot/custom_filters.py) + +Example of [filtering by id](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/id_filter_example.py) + +Example of [filtering by text](https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/text_filter_example.py) + #### TeleBot ```python