mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #516 from Badiboy/master
_notify_next_handlers drops messages if empty handler list
This commit is contained in:
commit
3d5ef5b1d8
@ -1153,12 +1153,16 @@ class TeleBot:
|
||||
while i < len(new_messages):
|
||||
message = new_messages[i]
|
||||
chat_id = message.chat.id
|
||||
was_poped = False
|
||||
if chat_id in self.next_step_handlers.keys():
|
||||
handlers = self.next_step_handlers[chat_id]
|
||||
if (handlers):
|
||||
for handler in handlers:
|
||||
self._exec_task(handler["callback"], message, *handler["args"], **handler["kwargs"])
|
||||
self.next_step_handlers.pop(chat_id, None)
|
||||
new_messages.pop(i) # removing message that detects with next_step_handler
|
||||
was_poped = True
|
||||
self.next_step_handlers.pop(chat_id, None)
|
||||
if (not was_poped):
|
||||
i += 1
|
||||
|
||||
@staticmethod
|
||||
|
Loading…
x
Reference in New Issue
Block a user