mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 10:53:44 +03:00
Let InputPeerChannel be casted automatically into InputChannel
This commit is contained in:
parent
9e88d9d219
commit
83c346ccc5
|
@ -98,6 +98,9 @@ def get_input_channel(entity):
|
|||
if isinstance(entity, Channel) or isinstance(entity, ChannelForbidden):
|
||||
return InputChannel(entity.id, entity.access_hash)
|
||||
|
||||
if isinstance(entity, InputPeerChannel):
|
||||
return InputChannel(entity.channel_id, entity.access_hash)
|
||||
|
||||
raise ValueError('Cannot cast {} to any kind of InputChannel.'
|
||||
.format(type(entity).__name__))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user