diff --git a/discord/message.go b/discord/message.go index 93ef3818..e25a710e 100644 --- a/discord/message.go +++ b/discord/message.go @@ -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 diff --git a/rest/channels.go b/rest/channels.go index 1ae7dee4..f864a7d3 100644 --- a/rest/channels.go +++ b/rest/channels.go @@ -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 @@ -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 }