mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
to an option object
This commit is contained in:
@@ -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<undefined>(
|
||||
"delete",
|
||||
userId
|
||||
options?.userId
|
||||
? endpoints.CHANNEL_MESSAGE_REACTION_USER(
|
||||
channelId,
|
||||
messageId,
|
||||
reaction,
|
||||
userId,
|
||||
options.userId,
|
||||
)
|
||||
: endpoints.CHANNEL_MESSAGE_REACTION_ME(channelId, messageId, reaction),
|
||||
);
|
||||
|
||||
@@ -122,7 +122,7 @@ const baseMessage: Partial<DiscordenoMessage> = {
|
||||
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 });
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user