mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +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)
|
||||
|
||||
# Less common cases
|
||||
if isinstance(entity, UserEmpty):
|
||||
return InputPeerEmpty()
|
||||
|
||||
if isinstance(entity, InputUser):
|
||||
return InputPeerUser(entity.user_id, entity.access_hash)
|
||||
|
||||
if isinstance(entity, InputChannel):
|
||||
return InputPeerChannel(entity.channel_id, entity.access_hash)
|
||||
|
||||
if isinstance(entity, InputUserSelf):
|
||||
return InputPeerSelf()
|
||||
|
||||
if isinstance(entity, UserEmpty):
|
||||
return InputPeerEmpty()
|
||||
|
||||
if isinstance(entity, UserFull):
|
||||
return get_input_peer(entity.user)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user