diff --git a/aiogram/types/base.py b/aiogram/types/base.py index 3f8cda60..5bb29472 100644 --- a/aiogram/types/base.py +++ b/aiogram/types/base.py @@ -211,6 +211,15 @@ class TelegramObject(ContextInstanceMixin, metaclass=MetaTelegramObject): """ return self.as_json() + def __repr__(self) -> str: + """ + Return object readable representation. + + Example: + :return: object class name and object data as a string + """ + return f"<{type(self).__name__} {self}>" + def __getitem__(self, item: typing.Union[str, int]) -> typing.Any: """ Item getter (by key)