Skip to content

Commit

Permalink
delete based on reaction
Browse files Browse the repository at this point in the history
  • Loading branch information
iernie committed Nov 22, 2023
1 parent 0cfd27d commit 865359e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions events/reaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ const event: BotEvent<MessageReaction> = {

const users = await reaction.users.fetch();

console.log(
reaction.client.user.id,
reaction.message.author?.id,
users.find((u) => u.id === reaction.message.interaction?.user.id),
reaction.message.interaction?.user.id,
);
if (reaction.emoji.name === "❌" && reaction.client.user.id === reaction.message.author?.id) {
if (
reaction.emoji.name === "❌" &&
reaction.client.user.id === reaction.message.author?.id &&
users.some((u) => u.id === reaction.message.interaction?.user.id)
) {
await reaction.message.delete();
}
},
Expand Down

0 comments on commit 865359e

Please sign in to comment.