Skip to content

Commit

Permalink
Forgot interactionCreate handler
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTipo01 committed Mar 27, 2021
1 parent 71a52fb commit 59409b3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 59409b3

Please sign in to comment.