diff --git a/src/helpers/messages/remove_reaction.ts b/src/helpers/messages/remove_reaction.ts index 1be275af9..36866d010 100644 --- a/src/helpers/messages/remove_reaction.ts +++ b/src/helpers/messages/remove_reaction.ts @@ -7,9 +7,9 @@ export async function removeReaction( channelId: string, messageId: string, reaction: string, - userId?: string, + options?: { userId?: string }, ) { - if (userId) { + if (options?.userId) { await requireBotChannelPermissions(channelId, ["MANAGE_MESSAGES"]); } @@ -21,12 +21,12 @@ export async function removeReaction( return await rest.runMethod( "delete", - userId + options?.userId ? endpoints.CHANNEL_MESSAGE_REACTION_USER( channelId, messageId, reaction, - userId, + options.userId, ) : endpoints.CHANNEL_MESSAGE_REACTION_ME(channelId, messageId, reaction), ); diff --git a/src/structures/message.ts b/src/structures/message.ts index 6e8f22bdf..014e6ea37 100644 --- a/src/structures/message.ts +++ b/src/structures/message.ts @@ -122,7 +122,7 @@ const baseMessage: Partial = { return removeReactionEmoji(this.channelId!, this.id!, reaction); }, removeReaction(reaction, userId) { - return removeReaction(this.channelId!, this.id!, reaction, userId); + return removeReaction(this.channelId!, this.id!, reaction, { userId }); }, }; diff --git a/tests/messages/remove_reaction.ts b/tests/messages/remove_reaction.ts index 722631769..0d02e83ef 100644 --- a/tests/messages/remove_reaction.ts +++ b/tests/messages/remove_reaction.ts @@ -31,7 +31,7 @@ async function ifItFailsBlameWolf(type: "getter" | "raw", user = false) { message.channelId, message.id, "❤", - user ? message.author.id : undefined, + user ? { userId: message.author.id } : undefined, ); } else { await message.removeReaction("❤", user ? message.author.id : undefined);