def get_list_id(mastodon, rest):
    """Get the ID for a list"""
    if not rest:
        return -1
    try:
        return int(rest)
    except ValueError:
        pass
    rest = rest.strip()
    lists = mastodon.lists()
    for item in lists:
        if item['title'].lower() == rest.lower():
            return item['id']
