import click


def check_integer_known(value, possibles):
    """Converts and checks if the integer from the prompt is in gives possibilities."""
    try:
        value = int(value)
    except ValueError:
        raise click.BadParameter(f"{value} is not a valid integer", param=value)
    if value in possibles:
        return value
    raise click.BadParameter(f"{value} is not known")