Skip to content

Commit

Permalink
⭐ Fixed self-reacts, starboard
Browse files Browse the repository at this point in the history
  • Loading branch information
wiki-Bird committed Jul 24, 2024
1 parent f80cab8 commit 65f021c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/events/messageReactionAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,17 @@ const messageReactionAdd: Event<[MessageReaction | PartialMessageReaction, User
try {
const userUser = await client.users.fetch(user.id);
await userUser.send("You can't star your own message. Sorry :(");
// reaction.remove();
reaction.remove();
} catch (error) {
console.error(`Failed to send DM to user ${user.id}: ${error}`);
}
// return;
return;
}

// Check if the number of star reacts >= minimum reacts to go to starboard. If it doesn't, return
const starCount = message.reactions.cache.find(r =>
r.emoji.id === emojiIdentifier || r.emoji.toString() === starEmoji
)?.count || 0;
console.log(starCount)
if ( starCount < minReactsToStar ) return;

// Get the last 100 messages in the starboard channel
Expand Down

0 comments on commit 65f021c

Please sign in to comment.