mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 09:22:03 +00:00
Allow to reset bot.me
This commit is contained in:
parent
82826d10b3
commit
3951e25e9f
1 changed files with 11 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ class Bot(BaseBot):
|
||||||
@property
|
@property
|
||||||
async def me(self) -> types.User:
|
async def me(self) -> types.User:
|
||||||
"""
|
"""
|
||||||
Alias for self.get_me() but with caching.
|
Alias for self.get_me() but lazy and with caching.
|
||||||
|
|
||||||
:return: :class:`aiogram.types.User`
|
:return: :class:`aiogram.types.User`
|
||||||
"""
|
"""
|
||||||
|
|
@ -31,6 +31,16 @@ class Bot(BaseBot):
|
||||||
setattr(self, '_me', await self.get_me())
|
setattr(self, '_me', await self.get_me())
|
||||||
return getattr(self, '_me')
|
return getattr(self, '_me')
|
||||||
|
|
||||||
|
@me.deleter
|
||||||
|
def me(self):
|
||||||
|
"""
|
||||||
|
Reset `me`
|
||||||
|
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
if hasattr(self, '_me'):
|
||||||
|
delattr(self, '_me')
|
||||||
|
|
||||||
async def download_file(self, file_path: str, destination: io.BytesIO or str = None, timeout: int = 30,
|
async def download_file(self, file_path: str, destination: io.BytesIO or str = None, timeout: int = 30,
|
||||||
chunk_size: int = 65536, seek: bool = True) -> io.BytesIO:
|
chunk_size: int = 65536, seek: bool = True) -> io.BytesIO:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue