diff --git a/track/__main__.py b/track/__main__.py index 5860a29..3977c33 100644 --- a/track/__main__.py +++ b/track/__main__.py @@ -49,7 +49,13 @@ client.start() online = None last_offline = None while True: - contact = client.get_entity(contact_id) + if contact_id in ['me', 'self']: + # Workaround for the regression in Telethon that breaks get_entity('me'): + # https://github.com/LonamiWebs/Telethon/issues/1024 + contact = client.get_me() + else: + contact = client.get_entity(contact_id) + if isinstance(contact.status, UserStatusOffline): if online != False: online = False