From 0f34a9b3336117aadfc6309d997e7e4a12871d5a Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 8 Mar 2018 10:08:26 +0100 Subject: [PATCH] Fix .get_input_entity error message always showing None --- telethon/telegram_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index 87f57945..937540da 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -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)