From 3371717f10c4b790dec265e56ec5153d57626816 Mon Sep 17 00:00:00 2001 From: sabby Date: Sat, 3 Oct 2020 15:00:33 +0530 Subject: [PATCH] Unwrap handler before awaitable check --- aiogram/dispatcher/event/handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aiogram/dispatcher/event/handler.py b/aiogram/dispatcher/event/handler.py index 6c2a5e57..f19f44dd 100644 --- a/aiogram/dispatcher/event/handler.py +++ b/aiogram/dispatcher/event/handler.py @@ -61,7 +61,8 @@ class HandlerObject(CallableMixin): def __post_init__(self) -> None: super(HandlerObject, self).__post_init__() - if inspect.isclass(self.callback) and issubclass(self.callback, BaseHandler): # type: ignore + callback = inspect.unwrap(self.callback) + if inspect.isclass(callback) and issubclass(callback, BaseHandler): # type: ignore self.awaitable = True async def check(self, *args: Any, **kwargs: Any) -> Tuple[bool, Dict[str, Any]]: