summaryrefslogtreecommitdiff
path: root/handlers/interactionCreateHandler.go
blob: 575c471d15a632758d94cc31fb12f537a2180d12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package handlers

import "github.com/bwmarrin/discordgo"

func InteractionCreateHandler(s *discordgo.Session, i *discordgo.InteractionCreate) {
	switch i.Type {
	case discordgo.InteractionApplicationCommand:
		if handler, ok := SlashCommandHandlers[i.ApplicationCommandData().Name]; ok {
			handler(s, i)
		}

	case discordgo.InteractionApplicationCommandAutocomplete:
		if handler, ok := AutocompleteHandlers[i.ApplicationCommandData().Name]; ok {
			handler(s, i)
		}
	}
}