diff --git a/packages/discord.js/src/structures/MessageMentions.js b/packages/discord.js/src/structures/MessageMentions.js index ca5c720a12f5..6a5acaad772c 100644 --- a/packages/discord.js/src/structures/MessageMentions.js +++ b/packages/discord.js/src/structures/MessageMentions.js @@ -215,13 +215,18 @@ class MessageMentions { const role = this.guild?.roles.resolve(data); const channel = this.client.channels.resolve(data); - if (!ignoreRepliedUser && this.users.has(this.repliedUser?.id) && this.repliedUser?.id === user?.id) return true; + if (!ignoreEveryone && user && this.everyone) return true; + + const userWasRepliedTo = user && this.repliedUser?.id === user.id; + + if (!ignoreRepliedUser && userWasRepliedTo && this.users.has(user.id)) return true; + if (!ignoreDirect) { - if (this.users.has(user?.id)) return true; + if ((ignoreRepliedUser ? !userWasRepliedTo : true) && this.users.has(user?.id)) return true; if (this.roles.has(role?.id)) return true; if (this.channels.has(channel?.id)) return true; } - if (user && !ignoreEveryone && this.everyone) return true; + if (!ignoreRoles) { const member = this.guild?.members.resolve(data); if (member) {