mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
staticmethod to classmethod
This commit is contained in:
parent
396e805a07
commit
4bdc726536
1 changed files with 4 additions and 4 deletions
|
|
@ -181,9 +181,9 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
"""
|
||||
await self.session.close()
|
||||
|
||||
@staticmethod
|
||||
@classmethod
|
||||
async def __download_file_binary_io(
|
||||
destination: BinaryIO, seek: bool, stream: AsyncGenerator[bytes, None]
|
||||
cls, destination: BinaryIO, seek: bool, stream: AsyncGenerator[bytes, None]
|
||||
) -> BinaryIO:
|
||||
async for chunk in stream:
|
||||
destination.write(chunk)
|
||||
|
|
@ -192,9 +192,9 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
destination.seek(0)
|
||||
return destination
|
||||
|
||||
@staticmethod
|
||||
@classmethod
|
||||
async def __download_file(
|
||||
destination: Union[str, pathlib.Path], stream: AsyncGenerator[bytes, None]
|
||||
cls, destination: Union[str, pathlib.Path], stream: AsyncGenerator[bytes, None]
|
||||
) -> None:
|
||||
async with aiofiles.open(destination, "wb") as f:
|
||||
async for chunk in stream:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue