def get_input_channel(entity):
    """Similar to :meth:`get_input_peer`, but for :tl:`InputChannel`'s alone."""
    try:
        if entity.SUBCLASS_OF_ID == 0x40f202fd:  # crc32(b'InputChannel')
            return entity
    except AttributeError:
        _raise_cast_fail(entity, 'InputChannel')

    if isinstance(entity, (types.Channel, types.ChannelForbidden)):
        return types.InputChannel(entity.id, entity.access_hash or 0)

    if isinstance(entity, types.InputPeerChannel):
        return types.InputChannel(entity.channel_id, entity.access_hash)

    _raise_cast_fail(entity, 'InputChannel')
def get_input_channel ( entity ) : try : if entity . SUBCLASS_OF_ID == 0x40f202fd : return entity except AttributeError : _raise_cast_fail ( entity , 'InputChannel' ) if isinstance ( entity , ( types . Channel , types . ChannelForbidden ) ) : return types . InputChannel ( entity . id , entity . access_hash or 0 ) if isinstance ( entity , types . InputPeerChannel ) : return types . InputChannel ( entity . channel_id , entity . access_hash ) _raise_cast_fail ( entity , 'InputChannel' )
Similar to :meth:`get_input_peer`, but for :tl:`InputChannel`'s alone.