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,
|
channelId: string,
|
||||||
messageId: string,
|
messageId: string,
|
||||||
reaction: string,
|
reaction: string,
|
||||||
userId?: string,
|
options?: { userId?: string },
|
||||||
) {
|
) {
|
||||||
if (userId) {
|
if (options?.userId) {
|
||||||
await requireBotChannelPermissions(channelId, ["MANAGE_MESSAGES"]);
|
await requireBotChannelPermissions(channelId, ["MANAGE_MESSAGES"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,12 +21,12 @@ export async function removeReaction(
|
|||||||
|
|
||||||
return await rest.runMethod<undefined>(
|
return await rest.runMethod<undefined>(
|
||||||
"delete",
|
"delete",
|
||||||
userId
|
options?.userId
|
||||||
? endpoints.CHANNEL_MESSAGE_REACTION_USER(
|
? endpoints.CHANNEL_MESSAGE_REACTION_USER(
|
||||||
channelId,
|
channelId,
|
||||||
messageId,
|
messageId,
|
||||||
reaction,
|
reaction,
|
||||||
userId,
|
options.userId,
|
||||||
)
|
)
|
||||||
: endpoints.CHANNEL_MESSAGE_REACTION_ME(channelId, messageId, reaction),
|
: endpoints.CHANNEL_MESSAGE_REACTION_ME(channelId, messageId, reaction),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ const baseMessage: Partial<DiscordenoMessage> = {
|
|||||||
return removeReactionEmoji(this.channelId!, this.id!, reaction);
|
return removeReactionEmoji(this.channelId!, this.id!, reaction);
|
||||||
},
|
},
|
||||||
removeReaction(reaction, userId) {
|
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.channelId,
|
||||||
message.id,
|
message.id,
|
||||||
"❤",
|
"❤",
|
||||||
user ? message.author.id : undefined,
|
user ? { userId: message.author.id } : undefined,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await message.removeReaction("❤", user ? message.author.id : undefined);
|
await message.removeReaction("❤", user ? message.author.id : undefined);
|
||||||
|
|||||||
Reference in New Issue
Block a user