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

Update _notify_next_handlers and _notify_reply_handlers methods:

Now if there wasn't any handler updates, timer willn't start.
This commit is contained in:
Waffle 2018-05-25 09:07:59 +03:00
parent b1d5cb2129
commit 4bcfc34a50

View File

@ -1191,7 +1191,7 @@ class TeleBot:
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"])
self.reply_handlers.pop(reply_msg_id) self.reply_handlers.pop(reply_msg_id)
self.reply_saver.start_save_timer() self.reply_saver.start_save_timer()
def register_next_step_handler(self, message, callback, *args, **kwargs): def register_next_step_handler(self, message, callback, *args, **kwargs):
""" """
@ -1270,9 +1270,9 @@ class TeleBot:
self._exec_task(handler["callback"], message, *handler["args"], **handler["kwargs"]) self._exec_task(handler["callback"], message, *handler["args"], **handler["kwargs"])
self.next_step_handlers.pop(chat_id, None) self.next_step_handlers.pop(chat_id, None)
new_messages.pop(i) # removing message that detects with next_step_handler new_messages.pop(i) # removing message that detects with next_step_handler
self.next_step_saver.start_save_timer()
i += 1 i += 1
self.next_step_saver.start_save_timer()
@staticmethod @staticmethod
def _build_handler_dict(handler, **filters): def _build_handler_dict(handler, **filters):