Fix .get_input_entity error message always showing None

This commit is contained in:
Lonami Exo 2018-03-08 10:08:26 +01:00
parent ce0dee63b1
commit 0f34a9b333

View File

@ -2272,6 +2272,7 @@ class TelegramClient(TelegramBareClient):
return InputPeerSelf()
return utils.get_input_peer(self._get_entity_from_string(peer))
original_peer = peer
if not isinstance(peer, int):
try:
if peer.SUBCLASS_OF_ID != 0x2d45687: # crc32(b'Peer')
@ -2281,7 +2282,7 @@ class TelegramClient(TelegramBareClient):
if not peer:
raise TypeError(
'Cannot turn "{}" into an input entity.'.format(peer)
'Cannot turn "{}" into an input entity.'.format(original_peer)
)
# Add the mark to the peers if the user passed a Peer (not an int)