mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 09:42:22 +00:00
fix(message_mentions): lazy require GuildMember to avoid circular (#3877)
This commit is contained in:
parent
1336156799
commit
cd746f3069
1 changed files with 1 additions and 1 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const GuildMember = require('./GuildMember');
|
|
||||||
const Collection = require('../util/Collection');
|
const Collection = require('../util/Collection');
|
||||||
const { ChannelTypes } = require('../util/Constants');
|
const { ChannelTypes } = require('../util/Constants');
|
||||||
const Util = require('../util/Util');
|
const Util = require('../util/Util');
|
||||||
|
|
@ -174,6 +173,7 @@ class MessageMentions {
|
||||||
*/
|
*/
|
||||||
has(data, { ignoreDirect = false, ignoreRoles = false, ignoreEveryone = false } = {}) {
|
has(data, { ignoreDirect = false, ignoreRoles = false, ignoreEveryone = false } = {}) {
|
||||||
if (!ignoreEveryone && this.everyone) return true;
|
if (!ignoreEveryone && this.everyone) return true;
|
||||||
|
const GuildMember = require('./GuildMember');
|
||||||
if (!ignoreRoles && data instanceof GuildMember) {
|
if (!ignoreRoles && data instanceof GuildMember) {
|
||||||
for (const role of this.roles.values()) if (data.roles.cache.has(role.id)) return true;
|
for (const role of this.roles.values()) if (data.roles.cache.has(role.id)) return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue