from bin.fillsql import fillsql
from bin.initialization import Initialization
from bin.selectobjects import *

options = ["Exit", "Create Bot", "Run Bot"]
runthrough = True
print("Options:")
j = 1
for i in options:
    print(j, ')', i)
    j += 1
choice = ''

# Get user input to decide what path to take (from options)
while runthrough:
    choice = ((input("\nWhat do you want to do?\nChoice: ")).strip().lower())

    try:
        choice = int(choice)
    except ValueError:
        choice = choice

    for i in options:
        if i.lower() == choice:
            runthrough = False
        if type(choice) == int:
            if choice > 0 and choice < len(options)+1:
                runthrough = False

if choice == "exit" or choice == 1:
    raise SystemExit
elif choice == "create bot" or choice == 2:
    creator = BotCreator()
    creator.create()
    answer = None
    while answer != 'y' and answer != 'n':
        answer = input("Do you want to run a bot now? (y/n): ").strip().lower()
    if answer == 'y':
        Initialization.runbot(True)
    elif answer == 'n':
        raise SystemExit
elif choice == "run bot" or choice == 3:
    Initialization.runbot(True)
# elif choice == "fill sql" or choice == 4:
#     fillsql.fill(None)
