diff --git a/src/constants/discord.ts b/src/constants/discord.ts index b9112026a..d7b647829 100644 --- a/src/constants/discord.ts +++ b/src/constants/discord.ts @@ -34,6 +34,13 @@ export const endpoints = { emoji: string, ) => `${baseEndpoints.BASE_URL}/channels/${id}/messages/${messageID}/reactions/${emoji}/@me`, + CHANNEL_MESSAGE_REACTION_USER: ( + id: string, + messageID: string, + emoji: string, + userId: string, + ) => + `${baseEndpoints.BASE_URL}/channels/${id}/messages/${messageID}/reactions/${emoji}/${userId}`, CHANNEL_MESSAGE_REACTIONS: (id: string, messageID: string) => `${baseEndpoints.BASE_URL}/channels/${id}/messages/${messageID}/reactions`, CHANNEL_MESSAGE_REACTION: (id: string, messageID: string, emoji: string) => diff --git a/src/handlers/message.ts b/src/handlers/message.ts index 658d510d7..82caab6d2 100644 --- a/src/handlers/message.ts +++ b/src/handlers/message.ts @@ -109,6 +109,23 @@ export function removeReaction( ); } +/** Removes a reaction from the specified user on this message. Reaction takes the form of **name:id** for custom guild emoji, or Unicode characters. */ +export function removeUserReaction( + channelID: string, + messageID: string, + reaction: string, + userID: string, +) { + RequestManager.delete( + endpoints.CHANNEL_MESSAGE_REACTION_USER( + channelID, + messageID, + reaction, + userID, + ), + ); +} + /** Removes all reactions for all emojis on this message. */ export function removeAllReactions(channelID: string, messageID: string) { if (