From 42913389c01555b1e7438c28939ac093de90d809 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Wed, 24 Oct 2018 22:39:34 +0300 Subject: [PATCH] Resolve decorated callbacks in spec filter --- aiogram/dispatcher/handler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aiogram/dispatcher/handler.py b/aiogram/dispatcher/handler.py index 7be6b3d4..2caf80d8 100644 --- a/aiogram/dispatcher/handler.py +++ b/aiogram/dispatcher/handler.py @@ -14,6 +14,9 @@ class CancelHandler(Exception): def _check_spec(func: callable, kwargs: dict): + while hasattr(func, '__wrapped__'): # Try to resolve decorated callbacks + func = func.__wrapped__ + spec = inspect.getfullargspec(func) if spec.varkw: return kwargs