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

Fix all the time invocations on typed_middleware handlers even if update did not have that update_type message

This commit is contained in:
bedilbek 2020-04-20 11:30:03 +05:00
parent 646bbb8330
commit aab560b4ee

View File

@ -380,7 +380,7 @@ class TeleBot:
def process_middlewares(self, update):
for update_type, middlewares in self.typed_middleware_handlers.items():
if hasattr(update, update_type):
if getattr(update, update_type) is not None:
for typed_middleware_handler in middlewares:
typed_middleware_handler(self, getattr(update, update_type))