Allow auto-casting custom.Dialog into input_entity

This commit is contained in:
Lonami Exo
2018-04-06 19:11:31 +02:00
parent baa6976a0b
commit 0cd44b245c
2 changed files with 8 additions and 4 deletions

View File

@@ -2463,9 +2463,10 @@ class TelegramClient(TelegramBareClient):
original_peer = peer
if not isinstance(peer, int):
try:
if peer.SUBCLASS_OF_ID != 0x2d45687: # crc32(b'Peer')
if getattr(peer, 'SUBCLASS_OF_ID', 0) != 0x2d45687:
# 0x2d45687 == crc32(b'Peer')
return utils.get_input_peer(peer)
except (AttributeError, TypeError):
except TypeError:
peer = None
if not peer: