Skip to content

Commit

Permalink
fix: Message handler should look for the User of the Message not Inte…
Browse files Browse the repository at this point in the history
…raction
  • Loading branch information
lcox74 committed Apr 10, 2024
1 parent 0414b32 commit f0d21e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion applications/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (pc PingCommand) OnCommand(ctx framework.CommandContext) {
Emoji: &discordgo.ComponentEmoji{
Name: "🏓",
},
CustomID: "ping.button:ping",
CustomID: "ping:ping",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions framework/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (b *Bot) registerDiscordApplicationCommands() {

// Check for errors
if err != nil {
b.lg.Errorf("Error creating command: %s", err)
b.lg.WithField("app", app.GetDefinition().Name).Errorf("Error creating command: %s", err)
continue
}

Expand Down Expand Up @@ -172,9 +172,9 @@ func (b *Bot) messageCreateHandler() func(s *discordgo.Session, m *discordgo.Mes
}

// Get the user from the message creation
user := m.Interaction.Member.User
user := m.Message.Author
if user == nil {
user = m.Interaction.User
user = m.Message.Member.User
}

// Create a new context for the route
Expand Down

0 comments on commit f0d21e7

Please sign in to comment.