mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
_notify_next_handlers skips sequential messages
Is there are several sequential messages and next_step_handlers are set, the _notify_next_handlers will process only every even message dew to execute both .pop(i) and i+=1
This commit is contained in:
parent
78afd045d8
commit
776a699a8d
@ -1153,13 +1153,16 @@ class TeleBot:
|
|||||||
while i < len(new_messages):
|
while i < len(new_messages):
|
||||||
message = new_messages[i]
|
message = new_messages[i]
|
||||||
chat_id = message.chat.id
|
chat_id = message.chat.id
|
||||||
|
was_poped = False
|
||||||
if chat_id in self.next_step_handlers.keys():
|
if chat_id in self.next_step_handlers.keys():
|
||||||
handlers = self.next_step_handlers[chat_id]
|
handlers = self.next_step_handlers[chat_id]
|
||||||
if (handlers):
|
if (handlers):
|
||||||
for handler in handlers:
|
for handler in handlers:
|
||||||
self._exec_task(handler["callback"], message, *handler["args"], **handler["kwargs"])
|
self._exec_task(handler["callback"], message, *handler["args"], **handler["kwargs"])
|
||||||
new_messages.pop(i) # removing message that detects with next_step_handler
|
new_messages.pop(i) # removing message that detects with next_step_handler
|
||||||
|
was_poped = True
|
||||||
self.next_step_handlers.pop(chat_id, None)
|
self.next_step_handlers.pop(chat_id, None)
|
||||||
|
if (not was_poped):
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user