mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
make utils.get_peer_id raise with message about InputPeerSelf
This commit is contained in:
parent
9362f03fd5
commit
5b2cfffedc
|
@ -728,6 +728,10 @@ def get_peer_id(peer, add_mark=True):
|
||||||
if isinstance(peer, int):
|
if isinstance(peer, int):
|
||||||
return peer if add_mark else resolve_id(peer)[0]
|
return peer if add_mark else resolve_id(peer)[0]
|
||||||
|
|
||||||
|
# Tell the user to use their client to resolve InputPeerSelf if we got one
|
||||||
|
if isinstance(peer, types.InputPeerSelf):
|
||||||
|
_raise_cast_fail(peer, 'int (you might want to use client.get_peer_id)')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
peer = get_peer(peer)
|
peer = get_peer(peer)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user