aboutsummaryrefslogtreecommitdiff
path: root/pkg/discord/handler.go
blob: f14388e255af8d17f4f89ca5187b40b8f1d6e47b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package discord

import (
	"github.com/bwmarrin/discordgo"
	"log"
)

func SetupHandler() {
	s.AddHandler(func(s *discordgo.Session, r *discordgo.Ready) {
		log.Println(r.User.Username, "is live!")
	})

	s.AddHandler(func(s *discordgo.Session, i *discordgo.InteractionCreate) {
		if h, ok := commandHandlers[i.ApplicationCommandData().Name]; ok {
			h(s, i)
		}
	})
}