diff --git a/telethon/_updates/messagebox.py b/telethon/_updates/messagebox.py index 54ab082e..c871880a 100644 --- a/telethon/_updates/messagebox.py +++ b/telethon/_updates/messagebox.py @@ -56,7 +56,8 @@ def next_updates_deadline(): class GapError(ValueError): - pass + def __repr__(self): + return 'GapError()' # Represents the information needed to correctly handle a specific `tl::enums::Update`. @@ -91,6 +92,15 @@ class PtsInfo: return None + def __repr__(self): + if self.entry is ENTRY_ACCOUNT: + entry = 'ENTRY_ACCOUNT' + elif self.entry is ENTRY_SECRET: + entry = 'ENTRY_SECRET' + else: + entry = self.entry + return f'PtsInfo(pts={self.pts}, pts_count={self.pts_count}, entry={entry})' + # The state of a particular entry in the message box. class State: @@ -106,6 +116,9 @@ class State: self.pts = pts self.deadline = deadline + def __repr__(self): + return f'State(pts={self.pts}, deadline={self.deadline})' + # > ### Recovering gaps # > […] Manually obtaining updates is also required in the following situations: @@ -127,6 +140,9 @@ class PossibleGap: self.deadline = deadline self.updates = updates + def __repr__(self): + return f'PossibleGap(deadline={self.deadline}, update_count={len(self.updates)})' + # Represents a "message box" (event `pts` for a specific entry). #