From ae50e578b97af207f684d7c93701b332a02a409e Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Tue, 25 Jul 2017 00:58:57 +0300 Subject: [PATCH] Move prepare object --- aiogram/bot/bot.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/aiogram/bot/bot.py b/aiogram/bot/bot.py index e5ff6e7f..6972650e 100644 --- a/aiogram/bot/bot.py +++ b/aiogram/bot/bot.py @@ -8,18 +8,6 @@ class Bot(BaseBot): Based on :class:`aiogram.bot.BaseBot` and in this module is realized data serialization. """ - def prepare_object(self, obj, parent=None): - """ - Setup bot instance and objects tree for object - - :param obj: instance of :class:`types.base.Deserializable` - :param parent: first parent object - :return: configured object - """ - obj.bot = self - obj.parent = parent - return obj - @property async def me(self) -> types.User: """ @@ -41,6 +29,18 @@ class Bot(BaseBot): if hasattr(self, '_me'): delattr(self, '_me') + def prepare_object(self, obj, parent=None): + """ + Setup bot instance and objects tree for object + + :param obj: instance of :class:`types.base.Deserializable` + :param parent: first parent object + :return: configured object + """ + obj.bot = self + obj.parent = parent + return obj + 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: """