Allow to reset bot.me

This commit is contained in:
Alex Root Junior 2017-07-24 23:39:41 +03:00
parent 82826d10b3
commit 3951e25e9f

View file

@ -23,7 +23,7 @@ class Bot(BaseBot):
@property
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`
"""
@ -31,6 +31,16 @@ class Bot(BaseBot):
setattr(self, '_me', await self.get_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,
chunk_size: int = 65536, seek: bool = True) -> io.BytesIO:
"""