Skip to content
Merged
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
7 changes: 7 additions & 0 deletions discord/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ type ReactionCountDetails struct {
Normal int `json:"normal"`
}

type MessageReactionType int

const (
MessageReactionTypeNormal MessageReactionType = iota
MessageReactionTypeBurst
)

// MessageActivityType is the type of MessageActivity https://com/developers/docs/resources/channel#message-object-message-activity-types
type MessageActivityType int

Expand Down
15 changes: 12 additions & 3 deletions rest/channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Channels interface {
BulkDeleteMessages(channelID snowflake.ID, messageIDs []snowflake.ID, opts ...RequestOpt) error
CrosspostMessage(channelID snowflake.ID, messageID snowflake.ID, opts ...RequestOpt) (*discord.Message, error)

GetReactions(channelID snowflake.ID, messageID snowflake.ID, emoji string, opts ...RequestOpt) ([]discord.User, error)
GetReactions(channelID snowflake.ID, messageID snowflake.ID, emoji string, reactionType discord.MessageReactionType, after int, limit int, opts ...RequestOpt) ([]discord.User, error)
AddReaction(channelID snowflake.ID, messageID snowflake.ID, emoji string, opts ...RequestOpt) error
RemoveOwnReaction(channelID snowflake.ID, messageID snowflake.ID, emoji string, opts ...RequestOpt) error
RemoveUserReaction(channelID snowflake.ID, messageID snowflake.ID, emoji string, userID snowflake.ID, opts ...RequestOpt) error
Expand Down Expand Up @@ -180,8 +180,17 @@ func (s *channelImpl) CrosspostMessage(channelID snowflake.ID, messageID snowfla
return
}

func (s *channelImpl) GetReactions(channelID snowflake.ID, messageID snowflake.ID, emoji string, opts ...RequestOpt) (users []discord.User, err error) {
err = s.client.Do(GetReactions.Compile(nil, channelID, messageID, emoji), nil, &users, opts...)
func (s *channelImpl) GetReactions(channelID snowflake.ID, messageID snowflake.ID, emoji string, reactionType discord.MessageReactionType, after int, limit int, opts ...RequestOpt) (users []discord.User, err error) {
values := discord.QueryValues{
"type": reactionType,
}
if after != 0 {
values["after"] = after
}
if limit != 0 {
values["limit"] = limit
}
err = s.client.Do(GetReactions.Compile(values, channelID, messageID, emoji), nil, &users, opts...)
return
}

Expand Down