mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 05:19:41 +00:00
Add missing InputChannel case on .get_input_peer()
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user