From 4bdc726536658df892e7e9b56d14b64a319dbad9 Mon Sep 17 00:00:00 2001 From: Gabben <43146729+gabbhack@users.noreply.github.com> Date: Mon, 18 May 2020 22:17:25 +0500 Subject: [PATCH] staticmethod to classmethod --- aiogram/api/client/bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aiogram/api/client/bot.py b/aiogram/api/client/bot.py index 9f6359c4..96061c24 100644 --- a/aiogram/api/client/bot.py +++ b/aiogram/api/client/bot.py @@ -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: