mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 09:22:03 +00:00
Merge pull request #196 from Birdi7/fix-rename-stacklevel
Fix stacklevel arguments in renamed arguments in the dispatcher
This commit is contained in:
commit
172d834e3c
1 changed files with 5 additions and 5 deletions
|
|
@ -915,7 +915,7 @@ class Dispatcher(DataMixin, ContextInstanceMixin):
|
||||||
|
|
||||||
return FSMContext(storage=self.storage, chat=chat, user=user)
|
return FSMContext(storage=self.storage, chat=chat, user=user)
|
||||||
|
|
||||||
@renamed_argument(old_name='user', new_name='user_id', until_version='3.0', stacklevel=4)
|
@renamed_argument(old_name='user', new_name='user_id', until_version='3.0', stacklevel=3)
|
||||||
@renamed_argument(old_name='chat', new_name='chat_id', until_version='3.0', stacklevel=4)
|
@renamed_argument(old_name='chat', new_name='chat_id', until_version='3.0', stacklevel=4)
|
||||||
async def throttle(self, key, *, rate=None, user_id=None, chat_id=None, no_error=None) -> bool:
|
async def throttle(self, key, *, rate=None, user_id=None, chat_id=None, no_error=None) -> bool:
|
||||||
"""
|
"""
|
||||||
|
|
@ -974,8 +974,8 @@ class Dispatcher(DataMixin, ContextInstanceMixin):
|
||||||
raise Throttled(key=key, chat=chat_id, user=user_id, **data)
|
raise Throttled(key=key, chat=chat_id, user=user_id, **data)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@renamed_argument('user', 'user_id', '3.0')
|
@renamed_argument(old_name='user', new_name='user_id', until_version='3.0', stacklevel=3)
|
||||||
@renamed_argument('chat', 'chat_id', '3.0')
|
@renamed_argument(old_name='chat', new_name='chat_id', until_version='3.0', stacklevel=4)
|
||||||
async def check_key(self, key, chat_id=None, user_id=None):
|
async def check_key(self, key, chat_id=None, user_id=None):
|
||||||
"""
|
"""
|
||||||
Get information about key in bucket
|
Get information about key in bucket
|
||||||
|
|
@ -996,8 +996,8 @@ class Dispatcher(DataMixin, ContextInstanceMixin):
|
||||||
data = bucket.get(key, {})
|
data = bucket.get(key, {})
|
||||||
return Throttled(key=key, chat=chat_id, user=user_id, **data)
|
return Throttled(key=key, chat=chat_id, user=user_id, **data)
|
||||||
|
|
||||||
@renamed_argument('user', 'user_id', '3.0')
|
@renamed_argument(old_name='user', new_name='user_id', until_version='3.0', stacklevel=3)
|
||||||
@renamed_argument('chat', 'chat_id', '3.0')
|
@renamed_argument(old_name='chat', new_name='chat_id', until_version='3.0', stacklevel=4)
|
||||||
async def release_key(self, key, chat_id=None, user_id=None):
|
async def release_key(self, key, chat_id=None, user_id=None):
|
||||||
"""
|
"""
|
||||||
Release blocked key
|
Release blocked key
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue