Add a workaround to make 'me' work again

This commit is contained in:
Maxim Mikityanskiy 2018-10-18 23:28:44 +03:00
commit f9b76e45f2

View file

@ -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