1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

add apihelper.ENABLE_MIDDLEWARE = True to readme

This commit is contained in:
Robin Modisch 2021-01-17 23:22:45 +01:00 committed by GitHub
parent 003a92f466
commit 80c9e17fd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,9 +231,11 @@ def test_callback(call):
A middleware handler is a function that allows you to modify requests or the bot context as they pass through the
Telegram to the bot. You can imagine middleware as a chain of logic connection handled before any other handlers are
executed.
executed. Middleware processing is disabled by default, enable it by setting `apihelper.ENABLE_MIDDLEWARE = True`.
```python
apihelper.ENABLE_MIDDLEWARE = True
@bot.middleware_handler(update_types=['message'])
def modify_message(bot_instance, message):
# modifying the message before it reaches any other handler