discordgo
discordgo copied to clipboard
MessageReactionRemove returns a 404?
I'm trying to remove a reaction as soon as it is added, so I am trying this:
func messageReactionAdd(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
err = s.MessageReactionRemove(m.ChannelID, m.MessageID, m.Emoji.ID, m.UserID)
if err != nil {
log.WithFields(log.Fields{"err": err}).Warning("Couldn't remove reaction from message")
}
}
but it returns this:
WARN[Sep 14 06:20:54.821] Couldn't remove reaction from message err="HTTP 404 Not Found, {\"message\": \"404: Not Found\", \"code\": 0}"
Is this normal behavior?
(*Emoji).ID
doesn’t have a valid value on Unicode emojis. See (*Emoji).APIName
, which exists specifically for this use case.
In that case might I suggest changing the signature of:
func (s *Session) MessageReactionRemove(channelID, messageID, emojiID, userID string) error
to:
func (s *Session) MessageReactionRemove(channelID, messageID, emojiAPIName, userID string) error
to make things a bit easier on the uninitiated?
Thank you for the reply, by the way; changing to use .APIName()
worked!