import os
from rich.console import Console
from rich import print

from src.commands.create.functions.select_template import select_template

from src.commands.create.templates.basic.simple_bot_template import bot as simple_bot_template
from src.commands.create.templates.basic.blank_template import bot as blank_template
from src.commands.create.templates.communs.economy_bot_template import bot as economy_bot_template
from src.commands.create.templates.communs.moderation_bot_template import bot as moderation_bot_template
from src.commands.create.templates.communs.rank_bot_template import bot as rank_bot_template
from src.commands.create.templates.communs.security_bot_template import bot as security_bot_template
from src.commands.create.templates.communs.games.anime_card_game_bot_template import bot as anime_card_game_bot_template
from src.commands.create.templates.communs.games.pokemon_card_game_bot_template import bot as pokemon_card_game_bot_template
from src.commands.create.templates.communs.games.streamers_card_game_bot_template import bot as streamers_card_game_bot_template
from src.commands.create.templates.communs.games.the_magic_game_bot_template import bot as the_magic_game_bot_template
from src.commands.create.templates.communs.games.vtubers_card_game_bot_template import bot as vtubers_card_game_bot_template
from src.commands.create.templates.communs.games.yu_gi_ho_card_game_bot_template import bot as yu_gi_ho_card_game_bot_template
from src.commands.create.templates.market.crypto.market_bot_template import bot as market_bot_template
from src.commands.create.templates.market.nft.notification_sell_bot_template import bot as notification_sell_bot_template
from src.commands.create.templates.market.nft.security_bot_template import bot as security_bot_template
from src.commands.create.templates.market.stock.market_bot_template import bot as market_bot_template



console = Console()
def create_project(project_name):
    try:
      r = console.input(f"[bold blue]Desea crear un bot de Discord llamado {project_name}[/bold blue] ([italic green]Y[/italic green] or [italic red]N[/italic red]): ", emoji=True)
      print(r)
      if(r == "Y" or r == "y"):
        select = select_template()
        print(f"[italic green]Creando proyecto {project_name} con la plantilla {select}[/italic green]")
        simple_bot_template(project_name)
      elif(r == "N" or r == "n"):
        print(f"[italic red]Creacion del proyecto {project_name} [bold red]cancelada[/bold red] [/italic red]")
        return
      else: 
        print("Solo se puede responder con [bold green](Y -> Yes)[/bold green] o [bold red](N -> No)[/bold red]")
        return
        
    except Exception as e:
        print(f"Error al crear el proyecto: {e}")
        print(e)
