mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #801 from bedilbek/fix-middleware-invocations
Fix not needed invocations on typed middleware handlers
This commit is contained in:
commit
7966def331
@ -380,7 +380,7 @@ class TeleBot:
|
|||||||
|
|
||||||
def process_middlewares(self, update):
|
def process_middlewares(self, update):
|
||||||
for update_type, middlewares in self.typed_middleware_handlers.items():
|
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:
|
for typed_middleware_handler in middlewares:
|
||||||
typed_middleware_handler(self, getattr(update, update_type))
|
typed_middleware_handler(self, getattr(update, update_type))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user