diff --git a/aiogram/utils/deprecated.py b/aiogram/utils/deprecated.py index ecb66e6a..8a527420 100644 --- a/aiogram/utils/deprecated.py +++ b/aiogram/utils/deprecated.py @@ -40,7 +40,7 @@ def deprecated(reason): return decorator - elif inspect.isclass(reason) or inspect.isfunction(reason): + if inspect.isclass(reason) or inspect.isfunction(reason): # The @deprecated is used without any 'reason'. # @@ -64,8 +64,7 @@ def deprecated(reason): return wrapper1 - else: - raise TypeError(repr(type(reason))) + raise TypeError(repr(type(reason))) def warn_deprecated(message, warning=DeprecationWarning, stacklevel=2): diff --git a/examples/webhook_example.py b/examples/webhook_example.py index 0f6ae3cd..ca8028fd 100644 --- a/examples/webhook_example.py +++ b/examples/webhook_example.py @@ -62,7 +62,7 @@ async def cmd_about(message: types.Message): async def cancel(message: types.Message): # Get current state context - state = dp.current_state(chat=message.chat.id, user=message.from_user.id) + state = dp.current_state(chat_id=message.chat.id, user_id=message.from_user.id) # If current user in any state - cancel it. if await state.get_state() is not None: