Add missing InputChannel case on .get_input_peer()

This commit is contained in:
Lonami Exo 2018-01-20 19:29:05 +01:00
parent 644105d038
commit 86816a3bdf

View File

@ -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)