mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-09 08:00:53 +03:00
Add missing InputChannel case on .get_input_peer()
This commit is contained in:
parent
644105d038
commit
86816a3bdf
|
@ -97,15 +97,18 @@ def get_input_peer(entity, allow_self=True):
|
||||||
return InputPeerChannel(entity.id, entity.access_hash or 0)
|
return InputPeerChannel(entity.id, entity.access_hash or 0)
|
||||||
|
|
||||||
# Less common cases
|
# Less common cases
|
||||||
if isinstance(entity, UserEmpty):
|
|
||||||
return InputPeerEmpty()
|
|
||||||
|
|
||||||
if isinstance(entity, InputUser):
|
if isinstance(entity, InputUser):
|
||||||
return InputPeerUser(entity.user_id, entity.access_hash)
|
return InputPeerUser(entity.user_id, entity.access_hash)
|
||||||
|
|
||||||
|
if isinstance(entity, InputChannel):
|
||||||
|
return InputPeerChannel(entity.channel_id, entity.access_hash)
|
||||||
|
|
||||||
if isinstance(entity, InputUserSelf):
|
if isinstance(entity, InputUserSelf):
|
||||||
return InputPeerSelf()
|
return InputPeerSelf()
|
||||||
|
|
||||||
|
if isinstance(entity, UserEmpty):
|
||||||
|
return InputPeerEmpty()
|
||||||
|
|
||||||
if isinstance(entity, UserFull):
|
if isinstance(entity, UserFull):
|
||||||
return get_input_peer(entity.user)
|
return get_input_peer(entity.user)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user