diff --git a/discord.11.5-dev.js b/discord.11.5-dev.js index 59d0d215..f8742439 100644 --- a/discord.11.5-dev.js +++ b/discord.11.5-dev.js @@ -1649,7 +1649,7 @@ eval("/**\n * Represents an embed in a message (image/video preview, rich embed, /*! ModuleConcatenation bailout: Module is not an ECMAScript module */ /***/ (function(module, exports, __webpack_require__) { -eval("const Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\n\n/**\n * Keeps track of mentions in a {@link Message}.\n */\nclass MessageMentions {\n constructor(message, users, roles, everyone) {\n /**\n * Whether `@everyone` or `@here` were mentioned\n * @type {boolean}\n */\n this.everyone = Boolean(everyone);\n\n if (users) {\n if (users instanceof Collection) {\n /**\n * Any users that were mentioned\n * @type {Collection}\n */\n this.users = new Collection(users);\n } else {\n this.users = new Collection();\n for (const mention of users) {\n let user = message.client.users.get(mention.id);\n if (!user) user = message.client.dataManager.newUser(mention);\n this.users.set(user.id, user);\n if (mention.member && message.guild && !message.guild.members.has(mention.id)) {\n message.guild._addMember(Object.assign(mention.member, { user }), false);\n }\n }\n }\n } else {\n this.users = new Collection();\n }\n\n if (roles) {\n if (roles instanceof Collection) {\n /**\n * Any roles that were mentioned\n * @type {Collection}\n */\n this.roles = new Collection(roles);\n } else {\n this.roles = new Collection();\n for (const mention of roles) {\n const role = message.channel.guild.roles.get(mention);\n if (role) this.roles.set(role.id, role);\n }\n }\n } else {\n this.roles = new Collection();\n }\n\n /**\n * Content of the message\n * @type {Message}\n * @private\n */\n this._content = message.content;\n\n /**\n * The client the message is from\n * @type {Client}\n * @private\n */\n this._client = message.client;\n\n /**\n * The guild the message is in\n * @type {?Guild}\n * @private\n */\n this._guild = message.channel.guild;\n\n /**\n * Cached members for {@MessageMention#members}\n * @type {?Collection}\n * @private\n */\n this._members = null;\n\n /**\n * Cached channels for {@MessageMention#channels}\n * @type {?Collection}\n * @private\n */\n this._channels = null;\n }\n\n /**\n * Any members that were mentioned (only in {@link TextChannel}s)\n * @type {?Collection}\n * @readonly\n */\n get members() {\n if (this._members) return this._members;\n if (!this._guild) return null;\n this._members = new Collection();\n this.users.forEach(user => {\n const member = this._guild.member(user);\n if (member) this._members.set(member.user.id, member);\n });\n return this._members;\n }\n\n /**\n * Any channels that were mentioned\n * @type {Collection}\n * @readonly\n */\n get channels() {\n if (this._channels) return this._channels;\n this._channels = new Collection();\n let matches;\n while ((matches = this.constructor.CHANNELS_PATTERN.exec(this._content)) !== null) {\n const chan = this._client.channels.get(matches[1]);\n if (chan) this._channels.set(chan.id, chan);\n }\n return this._channels;\n }\n}\n\n/**\n * Regular expression that globally matches `@everyone` and `@here`\n * @type {RegExp}\n */\nMessageMentions.EVERYONE_PATTERN = /@(everyone|here)/g;\n\n/**\n * Regular expression that globally matches user mentions like `<@81440962496172032>`\n * @type {RegExp}\n */\nMessageMentions.USERS_PATTERN = /<@!?[0-9]+>/g;\n\n/**\n * Regular expression that globally matches role mentions like `<@&297577916114403338>`\n * @type {RegExp}\n */\nMessageMentions.ROLES_PATTERN = /<@&[0-9]+>/g;\n\n/**\n * Regular expression that globally matches channel mentions like `<#222079895583457280>`\n * @type {RegExp}\n */\nMessageMentions.CHANNELS_PATTERN = /<#([0-9]+)>/g;\n\nmodule.exports = MessageMentions;\n\n\n//# sourceURL=webpack:///./src/structures/MessageMentions.js?"); +eval("const Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\n\n/**\n * Keeps track of mentions in a {@link Message}.\n */\nclass MessageMentions {\n constructor(message, users, roles, everyone) {\n /**\n * Whether `@everyone` or `@here` were mentioned\n * @type {boolean}\n */\n this.everyone = Boolean(everyone);\n\n if (users) {\n if (users instanceof Collection) {\n /**\n * Any users that were mentioned\n * Order as received from the API, not as they appear in the message content\n * @type {Collection}\n */\n this.users = new Collection(users);\n } else {\n this.users = new Collection();\n for (const mention of users) {\n let user = message.client.users.get(mention.id);\n if (!user) user = message.client.dataManager.newUser(mention);\n this.users.set(user.id, user);\n if (mention.member && message.guild && !message.guild.members.has(mention.id)) {\n message.guild._addMember(Object.assign(mention.member, { user }), false);\n }\n }\n }\n } else {\n this.users = new Collection();\n }\n\n if (roles) {\n if (roles instanceof Collection) {\n /**\n * Any roles that were mentioned\n * Order as received from the API, not as they appear in the message content}\n */\n this.roles = new Collection(roles);\n } else {\n this.roles = new Collection();\n for (const mention of roles) {\n const role = message.channel.guild.roles.get(mention);\n if (role) this.roles.set(role.id, role);\n }\n }\n } else {\n this.roles = new Collection();\n }\n\n /**\n * Content of the message\n * @type {Message}\n * @private\n */\n this._content = message.content;\n\n /**\n * The client the message is from\n * @type {Client}\n * @private\n */\n this._client = message.client;\n\n /**\n * The guild the message is in\n * @type {?Guild}\n * @private\n */\n this._guild = message.channel.guild;\n\n /**\n * Cached members for {@MessageMention#members}\n * @type {?Collection}\n * @private\n */\n this._members = null;\n\n /**\n * Cached channels for {@MessageMention#channels}\n * @type {?Collection}\n * @private\n */\n this._channels = null;\n }\n\n /**\n * Any members that were mentioned (only in {@link TextChannel}s)\n * Order as received from the API, not as they appear in the message content}\n * @readonly\n */\n get members() {\n if (this._members) return this._members;\n if (!this._guild) return null;\n this._members = new Collection();\n this.users.forEach(user => {\n const member = this._guild.member(user);\n if (member) this._members.set(member.user.id, member);\n });\n return this._members;\n }\n\n /**\n * Any channels that were mentioned\n * Order as they appear first in the message content\n * @type {Collection}\n * @readonly\n */\n get channels() {\n if (this._channels) return this._channels;\n this._channels = new Collection();\n let matches;\n while ((matches = this.constructor.CHANNELS_PATTERN.exec(this._content)) !== null) {\n const chan = this._client.channels.get(matches[1]);\n if (chan) this._channels.set(chan.id, chan);\n }\n return this._channels;\n }\n}\n\n/**\n * Regular expression that globally matches `@everyone` and `@here`\n * @type {RegExp}\n */\nMessageMentions.EVERYONE_PATTERN = /@(everyone|here)/g;\n\n/**\n * Regular expression that globally matches user mentions like `<@81440962496172032>`\n * @type {RegExp}\n */\nMessageMentions.USERS_PATTERN = /<@!?[0-9]+>/g;\n\n/**\n * Regular expression that globally matches role mentions like `<@&297577916114403338>`\n * @type {RegExp}\n */\nMessageMentions.ROLES_PATTERN = /<@&[0-9]+>/g;\n\n/**\n * Regular expression that globally matches channel mentions like `<#222079895583457280>`\n * @type {RegExp}\n */\nMessageMentions.CHANNELS_PATTERN = /<#([0-9]+)>/g;\n\nmodule.exports = MessageMentions;\n\n\n//# sourceURL=webpack:///./src/structures/MessageMentions.js?"); /***/ }),