From dd2f83b7acc35dcc8beeffb9d66b15398dbf2044 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 18 Feb 2022 19:09:19 +0100 Subject: [PATCH] Add str and repr to ToS --- telethon/types/_custom/tos.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/telethon/types/_custom/tos.py b/telethon/types/_custom/tos.py index 7b4f4c34..43ece84c 100644 --- a/telethon/types/_custom/tos.py +++ b/telethon/types/_custom/tos.py @@ -156,5 +156,11 @@ class TermsOfService: await self._client(_tl.fn.account.DeleteAccount('Decline ToS update')) + def __str__(self): + return self.markdown or '(empty ToS)' + + def __repr__(self): + return f'TermsOfService({self.markdown!r})' + def __bool__(self): return self._tos is not None