mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-10 16:12:22 +03:00
Fix get_peer_id not working with InputPeerSelf
This commit is contained in:
parent
3b4d00564d
commit
1007e19172
|
@ -365,13 +365,12 @@ class UserMethods(TelegramBaseClient):
|
||||||
return utils.get_peer_id(peer, add_mark=add_mark)
|
return utils.get_peer_id(peer, add_mark=add_mark)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if peer.SUBCLASS_OF_ID in (0x2d45687, 0xc91c90b6):
|
if peer.SUBCLASS_OF_ID not in (0x2d45687, 0xc91c90b6):
|
||||||
# 0x2d45687, 0xc91c90b6 == crc32(b'Peer') and b'InputPeer'
|
# 0x2d45687, 0xc91c90b6 == crc32(b'Peer') and b'InputPeer'
|
||||||
return utils.get_peer_id(peer)
|
peer = await self.get_input_entity(peer)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
peer = await self.get_input_entity(peer)
|
||||||
|
|
||||||
peer = await self.get_input_entity(peer)
|
|
||||||
if isinstance(peer, types.InputPeerSelf):
|
if isinstance(peer, types.InputPeerSelf):
|
||||||
peer = await self.get_me(input_peer=True)
|
peer = await self.get_me(input_peer=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user