mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-13 16:05:49 +03:00
Fix .get_input_entity error message always showing None
This commit is contained in:
parent
ce0dee63b1
commit
0f34a9b333
|
@ -2272,6 +2272,7 @@ class TelegramClient(TelegramBareClient):
|
||||||
return InputPeerSelf()
|
return InputPeerSelf()
|
||||||
return utils.get_input_peer(self._get_entity_from_string(peer))
|
return utils.get_input_peer(self._get_entity_from_string(peer))
|
||||||
|
|
||||||
|
original_peer = peer
|
||||||
if not isinstance(peer, int):
|
if not isinstance(peer, int):
|
||||||
try:
|
try:
|
||||||
if peer.SUBCLASS_OF_ID != 0x2d45687: # crc32(b'Peer')
|
if peer.SUBCLASS_OF_ID != 0x2d45687: # crc32(b'Peer')
|
||||||
|
@ -2281,7 +2282,7 @@ class TelegramClient(TelegramBareClient):
|
||||||
|
|
||||||
if not peer:
|
if not peer:
|
||||||
raise TypeError(
|
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)
|
# Add the mark to the peers if the user passed a Peer (not an int)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user