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

Merge pull request #1154 from Badiboy/master

Change message handler filtering order
This commit is contained in:
Badiboy 2021-05-11 23:27:54 +03:00 committed by GitHub
commit 3d26a0ce0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1898,7 +1898,7 @@ class TeleBot:
:param commands: Optional list of strings (commands to handle).
:param regexp: Optional regular expression.
:param func: Optional lambda function. The lambda receives the message to test as the first parameter. It must return True if the command should handle the message.
:param content_types: This commands' supported content types. Must be a list. Defaults to ['text'].
:param content_types: Supported message content types. Must be a list. Defaults to ['text'].
"""
if content_types is None:
@ -1906,10 +1906,10 @@ class TeleBot:
def decorator(handler):
handler_dict = self._build_handler_dict(handler,
content_types=content_types,
commands=commands,
regexp=regexp,
func=func,
content_types=content_types,
**kwargs)
self.add_message_handler(handler_dict)
return handler