Skip to content

Commit

Permalink
fix(MessageMentions): ignoreRepliedUser option in has()
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Jun 30, 2022
1 parent 525bf03 commit badf4cd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/discord.js/src/structures/MessageMentions.js
Expand Up @@ -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) {
Expand Down

0 comments on commit badf4cd

Please sign in to comment.