package commands import ( "velox-bot/internal/commands/fun" "github.com/bwmarrin/discordgo" ) var AllCommands = []*discordgo.ApplicationCommand{ fun.PingCommand, } var handlers = map[string]func(s *discordgo.Session, i *discordgo.InteractionCreate){ "ping": fun.HandlePing, } func HandleInteraction(s *discordgo.Session, i *discordgo.InteractionCreate) { if h, ok := handlers[i.ApplicationCommandData().Name]; ok { h(s, i) } }