Fix Component Button Crash When Used With Commands (!6)

Co-authored-by: Layla <layla@layla.gg>
Reviewed-on: https://gitea.sumulayla.synology.me/layla/birdbot/pulls/6
This commit is contained in:
Layla 2023-06-21 19:45:57 -04:00
parent 6ceceba221
commit ca9a183a52

View File

@ -58,7 +58,7 @@ func (discord *Discord) Run() error {
// Register command handler
discord.session.AddHandler(func(session *discordgo.Session, i *discordgo.InteractionCreate) {
if i.GuildID != discord.guildID {
if i.GuildID != discord.guildID || i.Interaction.Type != discordgo.InteractionApplicationCommand {
return
}