def traverse_conversations(driver, year=None):
    """
    Remove all conversations within a specified range
    """

    driver.get("https://mobile.facebook.com/messages/?pageNum=1&selectable&see_older_newer=1")

    convos = get_conversations(driver)

    with archiver("conversations") as archive_convo:
        for convo in convos:
            # If the year is set and there is a date
            # Then we want to only look at convos from this year

            if year and convo.date:
                if convo.date.year == int(year):
                    extract_convo(driver, convo)

                    if settings["ARCHIVE"]:
                        archive_convo.archive(convo)

                    delete_conversation(driver, convo)

            # Otherwise we're looking at all convos
            elif not year:
                extract_convo(driver, convo)

                if settings["ARCHIVE"]:
                    archive_convo.archive(convo)

                delete_conversation(driver, convo)

    Remove all conversations within a specified range
    
deletefb/tools/conversations.py