def channel_id_by_name(client, name):
    """ Fetch channel ID for a given channel name. """

    output = client.api_call("channels.list")
    channels = output['channels']

    channel_id = ''
    for channel in channels:
        if channel['name'] == name:
            return channel['id']

    return None