Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented MESSAGE_REACTION_REMOVE_EMOJI event type #1543

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions eventhandlers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion events.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,28 @@ func (m *MessageDelete) UnmarshalJSON(b []byte) error {
// MessageReactionAdd is the data for a MessageReactionAdd event.
type MessageReactionAdd struct {
*MessageReaction
Member *Member `json:"member,omitempty"`
UserID string `json:"user_id"`
Member *Member `json:"member,omitempty"`
Emoji Emoji `json:"emoji"`
MessageAuthorID string `json:"message_author_id,omitempty"`
Burst bool `json:"burst"`
BurstColors []string `json:"burst_colors,omitempty"`
Type MessageReactionType `json:"type"`
}

// MessageReactionRemove is the data for a MessageReactionRemove event.
type MessageReactionRemove struct {
*MessageReaction
UserID string `json:"user_id"`
Emoji Emoji `json:"emoji"`
Burst bool `json:"burst"`
Type MessageReactionType `json:"type"`
}

// MessageReactionRemoveEmoji is the data for a MessageReactionRemoveEmoji event.
type MessageReactionRemoveEmoji struct {
*MessageReaction
Emoji Emoji `json:"emoji"`
}

// MessageReactionRemoveAll is the data for a MessageReactionRemoveAll event.
Expand Down
13 changes: 10 additions & 3 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2153,11 +2153,18 @@ type APIErrorMessage struct {
Message string `json:"message"`
}

// MessageReaction stores the data for a message reaction.
// MessageReactionType is the type of reaction. Burst-type reactions are Super Reactions.
type MessageReactionType int

// Block contains all known MessageReactionType values.
const (
MessageReactionTypeNormal MessageReactionType = 0
MessageReactionTypeBurst MessageReactionType = 1
)

// MessageReaction stores partial data for a message reaction.
type MessageReaction struct {
UserID string `json:"user_id"`
MessageID string `json:"message_id"`
Emoji Emoji `json:"emoji"`
ChannelID string `json:"channel_id"`
GuildID string `json:"guild_id,omitempty"`
}
Expand Down
Loading