mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Fixed bug when message has next step handler and exec command handlers.
This commit is contained in:
parent
35d7293ebd
commit
d8587419e1
@ -1259,10 +1259,13 @@ class TeleBot:
|
|||||||
|
|
||||||
def _notify_command_handlers(self, handlers, new_messages):
|
def _notify_command_handlers(self, handlers, new_messages):
|
||||||
for message in new_messages:
|
for message in new_messages:
|
||||||
for message_handler in handlers:
|
# if message has next step handler, dont exec command handlers
|
||||||
if self._test_message_handler(message_handler, message):
|
if (isinstance(message, types.CallbackQuery)) or \
|
||||||
self._exec_task(message_handler['function'], message)
|
(isinstance(message, types.Message) and (message.chat.id not in self.message_subscribers_next_step)):
|
||||||
break
|
for message_handler in handlers:
|
||||||
|
if self._test_message_handler(message_handler, message):
|
||||||
|
self._exec_task(message_handler['function'], message)
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
class AsyncTeleBot(TeleBot):
|
class AsyncTeleBot(TeleBot):
|
||||||
|
Loading…
Reference in New Issue
Block a user