Skip to content

Commit

Permalink
check interaction type in handler
Browse files Browse the repository at this point in the history
  • Loading branch information
zekro committed Aug 15, 2022
1 parent 6a789f5 commit c025e67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ken.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ func (k *Ken) onReady(s *discordgo.Session, e *discordgo.Ready) {
}

func (k *Ken) onInteractionCreate(s *discordgo.Session, e *discordgo.InteractionCreate) {
if e.Type != discordgo.InteractionApplicationCommand {
return
}

k.cmdsLock.RLock()
cmd := k.cmds[e.ApplicationCommandData().Name]
k.cmdsLock.RUnlock()
Expand Down

0 comments on commit c025e67

Please sign in to comment.