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

Merge pull request #410 from 0xVK/fix-exec-handlers

#405 - Message has callback function but it exec command handlers too.
This commit is contained in:
FrankWang 2017-11-04 21:28:21 +08:00 committed by GitHub
commit c327be5a03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1259,6 +1259,9 @@ class TeleBot:
def _notify_command_handlers(self, handlers, new_messages):
for message in new_messages:
# if message has next step handler, dont exec command handlers
if (isinstance(message, types.CallbackQuery)) or \
(isinstance(message, types.Message) and (message.chat.id not in self.message_subscribers_next_step)):
for message_handler in handlers:
if self._test_message_handler(message_handler, message):
self._exec_task(message_handler['function'], message)