package config

import (
	"velox-bot/internal/commands/level/shared"

	"github.com/bwmarrin/discordgo"
)

var Slvl = &discordgo.ApplicationCommand{
	Name:        "slvl",
	Description: "Leveling System",
	Options: []*discordgo.ApplicationCommandOption{
		slvlToggleOption(),
		slvlSetLevelOption(),
		slvlSetChannelOption(),
		slvlSetMessageOption(),
		slvlSetRewardOption(),
	},
}

func SlvlHandler(s *discordgo.Session, i *discordgo.InteractionCreate) {
	data := i.ApplicationCommandData()
	if len(data.Options) == 0 {
		return
	}
	switch data.Options[0].Name {
	case "toggle":
		slvlToggleHandler(s, i)
	case "set":
		slvlSetLevelHandler(s, i)
	case "set-channel":
		slvlSetChannelHandler(s, i)
	case "set-message":
		slvlSetMessageHandler(s, i)
	case "set-reward":
		slvlSetRewardHandler(s, i)
	default:
		shared.RespondEphemeral(s, i, "Invalid subcommand.")
	}
}

