def retrieve_channel(Client, UseNameOrId, Identifier):
    """Returns a channel object based or either name or Id.
    """
    text_channel_object = None
    for channel in Client.get_all_channels():
        if UseNameOrId == 'id':
            if channel.id == Identifier:
                text_channel_object = channel
                break
        else:
            if channel.name == Identifier:
                text_channel_object = channel
                break
    return text_channel_object