From 59409b3eef598555aed32465043e5865de088d07 Mon Sep 17 00:00:00 2001 From: Manuel Raimo <10187614+TheTipo01@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:37:10 +0100 Subject: [PATCH] Forgot interactionCreate handler --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index 635fcf7..7b2d7ef 100644 --- a/main.go +++ b/main.go @@ -95,12 +95,21 @@ func main() { return } + // Add events handler dg.AddHandler(messageCreate) dg.AddHandler(messageDelete) dg.AddHandler(messageUpdate) dg.AddHandler(guildCreate) dg.AddHandler(ready) + // Add commands handler + dg.AddHandler(func(s *discordgo.Session, i *discordgo.InteractionCreate) { + if h, ok := commandHandlers[i.Data.Name]; ok { + h(s, i) + } + }) + + // Initialize intents that we use dg.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsGuildMessages | discordgo.IntentsGuilds) // Open a websocket connection to Discord and begin listening.