Skip to content

Commit

Permalink
fix(bots/discord): do not remove unrelated reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmDevs committed Aug 14, 2024
1 parent ef07039 commit 031fd26
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ const PossibleReactions = Object.values(Reactions) as string[]

withContext(on, 'messageReactionAdd', async (context, rct, user) => {
if (user.bot) return
await rct.users.remove(user.id)

const { database: db, logger, config } = context
const { messageScan: msConfig } = config

// If there's no config, we can't do anything
if (!msConfig?.humanCorrections) return

Expand All @@ -33,6 +32,7 @@ withContext(on, 'messageReactionAdd', async (context, rct, user) => {

if (reactionMessage.author.id !== reaction.client.user!.id) return
if (!PossibleReactions.includes(reaction.emoji.name!)) return
await rct.users.remove(user.id)

if (!isAdmin(reactionMessage.member || reactionMessage.author)) {
// User is in guild, and config has member requirements
Expand Down

0 comments on commit 031fd26

Please sign in to comment.