From e88f1d00ffb464d9ff05e1fe70a6afec8add12e1 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sun, 30 Apr 2017 02:31:52 +0000 Subject: [PATCH] Webpack build for branch master: ac92d2cecc654f3614321022d5c377bf0bc60f4b --- discord.master.js | 1120 +++++++++++++++++++++-------------------- discord.master.min.js | 2 +- 2 files changed, 565 insertions(+), 557 deletions(-) diff --git a/discord.master.js b/discord.master.js index 704a1739..343772ca 100644 --- a/discord.master.js +++ b/discord.master.js @@ -73,7 +73,7 @@ /* WEBPACK VAR INJECTION */(function(process) {exports.Package = __webpack_require__(40); /** - * Options for a Client. + * Options for a client. * @typedef {Object} ClientOptions * @property {string} [apiRequestMethod='sequential'] One of `sequential` or `burst`. The sequential handler executes * all requests in the order they are triggered, whereas the burst handler runs multiple in parallel, and doesn't @@ -100,7 +100,7 @@ * processed, potentially resulting in performance improvements for larger bots. Only disable events you are * 100% certain you don't need, as many are important, but not obviously so. The safest one to disable with the * most impact is typically `TYPING_START`. - * @property {WebsocketOptions} [ws] Options for the websocket + * @property {WebsocketOptions} [ws] Options for the WebSocket */ exports.DefaultOptions = { apiRequestMethod: 'sequential', @@ -117,7 +117,7 @@ exports.DefaultOptions = { restTimeOffset: 500, /** - * Websocket options (these are left as snake_case to match the API) + * WebSocket options (these are left as snake_case to match the API) * @typedef {Object} WebsocketOptions * @property {number} [large_threshold=250] Number of members in a guild to be considered large * @property {boolean} [compress=true] Whether to compress data sent on the connection @@ -508,7 +508,7 @@ exports.ExplicitContentFilterTypes = [ exports.UserSettingsMap = { /** - * Automatically convert emoticons in your messages to emoji. + * Automatically convert emoticons in your messages to emoji * For example, when you type `:-)` Discord will convert it to 😃 * @name ClientUserSettings#convertEmoticons * @type {boolean} @@ -729,7 +729,7 @@ class Collection extends Map { super(iterable); /** - * Cached array for the `array()` method - will be reset to `null` whenever `set()` or `delete()` are called. + * Cached array for the `array()` method - will be reset to `null` whenever `set()` or `delete()` are called * @name Collection#_array * @type {?Array} * @private @@ -737,7 +737,7 @@ class Collection extends Map { Object.defineProperty(this, '_array', { value: null, writable: true, configurable: true }); /** - * Cached array for the `keyArray()` method - will be reset to `null` whenever `set()` or `delete()` are called. + * Cached array for the `keyArray()` method - will be reset to `null` whenever `set()` or `delete()` are called * @name Collection#_keyArray * @type {?Array} * @private @@ -1163,7 +1163,7 @@ class Util { * Gets the recommended shard count from Discord. * @param {string} token Discord auth token * @param {number} [guildsPerShard=1000] Number of guilds per shard - * @returns {Promise} the recommended number of shards + * @returns {Promise} The recommended number of shards */ static fetchRecommendedShards(token, guildsPerShard = 1000) { return new Promise((resolve, reject) => { @@ -1203,7 +1203,7 @@ class Util { * Checks whether the arrays are equal, also removes duplicated entries from b. * @param {Array<*>} a Array which will not be modified. * @param {Array<*>} b Array to remove duplicated entries from. - * @returns {boolean} boolean Whether the arrays are equal. + * @returns {boolean} Whether the arrays are equal. * @private */ static arraysEqual(a, b) { @@ -1273,7 +1273,7 @@ class Util { } /** - * Makes an Error from a plain info object + * Makes an Error from a plain info object. * @param {Object} obj Error info * @param {string} obj.name Error type * @param {string} obj.message Message for the error @@ -1289,7 +1289,7 @@ class Util { } /** - * Makes a plain error info object from an Error + * Makes a plain error info object from an Error. * @param {Error} err Error to get info from * @returns {Object} * @private @@ -1303,7 +1303,7 @@ class Util { } /** - * Moves an element in an array *in place* + * Moves an element in an array *in place*. * @param {Array<*>} array Array to modify * @param {*} element Element to move * @param {number} newIndex Index or offset to move the element to @@ -3320,7 +3320,7 @@ const EPOCH = 1420070400000; let INCREMENT = 0; /** - * A container for useful snowflake-related methods + * A container for useful snowflake-related methods. */ class SnowflakeUtil { constructor() { @@ -3334,13 +3334,13 @@ class SnowflakeUtil { * * 64 22 17 12 0 * 000000111011000111100001101001000101000000 00001 00000 000000000000 - * number of ms since discord epoch worker pid increment + * number of ms since Discord epoch worker pid increment * ``` * @typedef {string} Snowflake */ /** - * Generates a Discord snowflake + * Generates a Discord snowflake. * This hardcodes the worker ID as 1 and the process ID as 0. * @returns {Snowflake} The generated snowflake */ @@ -3351,7 +3351,7 @@ class SnowflakeUtil { } /** - * A deconstructed snowflake + * A deconstructed snowflake. * @typedef {Object} DeconstructedSnowflake * @property {number} timestamp Timestamp the snowflake was created * @property {Date} date Date the snowflake was created @@ -3362,7 +3362,7 @@ class SnowflakeUtil { */ /** - * Deconstructs a Discord snowflake + * Deconstructs a Discord snowflake. * @param {Snowflake} snowflake Snowflake to deconstruct * @returns {DeconstructedSnowflake} Deconstructed snowflake */ @@ -3731,7 +3731,7 @@ if (typeof Object.create === 'function') { /***/ (function(module, exports) { /** - * Represents a user's presence + * Represents a user's presence. */ class Presence { constructor(data = {}) { @@ -3747,7 +3747,7 @@ class Presence { this.status = data.status || 'offline'; /** - * The game that the user is playing, `null` if they aren't playing a game. + * The game that the user is playing * @type {?Game} */ this.game = data.game ? new Game(data.game) : null; @@ -3760,7 +3760,7 @@ class Presence { /** * Whether this presence is equal to another - * @param {Presence} presence Presence to compare with + * @param {Presence} presence The presence to compare with * @returns {boolean} */ equals(presence) { @@ -3807,7 +3807,7 @@ class Game { /** * Whether this game is equal to another game - * @param {Game} game Game to compare with + * @param {Game} game The game to compare with * @returns {boolean} */ equals(game) { @@ -4220,7 +4220,7 @@ function forEach(xs, f) { const Snowflake = __webpack_require__(7); /** - * Represents any channel on Discord + * Represents any channel on Discord. */ class Channel { constructor(client, data) { @@ -4272,13 +4272,13 @@ class Channel { } /** - * Deletes the channel + * Deletes the channel. * @returns {Promise} * @example - * // delete the channel + * // Delete the channel * channel.delete() - * .then() // success - * .catch(console.error); // log error + * .then() // Success + * .catch(console.error); // Log error */ delete() { return this.client.rest.methods.deleteChannel(this); @@ -4297,7 +4297,7 @@ const Permissions = __webpack_require__(9); const util = __webpack_require__(22); /** - * Represents a role on Discord + * Represents a role on Discord. */ class Role { constructor(guild, data) { @@ -4387,7 +4387,7 @@ class Role { } /** - * The hexadecimal version of the role color, with a leading hashtag. + * The hexadecimal version of the role color, with a leading hashtag * @type {string} * @readonly */ @@ -4398,7 +4398,7 @@ class Role { } /** - * The cached guild members that have this role. + * The cached guild members that have this role * @type {Collection} * @readonly */ @@ -4407,7 +4407,7 @@ class Role { } /** - * Whether the role is editable by the client user. + * Whether the role is editable by the client user * @type {boolean} * @readonly */ @@ -4432,7 +4432,7 @@ class Role { * Get an object mapping permission names to whether or not the role enables that permission * @returns {Object} * @example - * // print the serialized role permissions + * // Print the serialized role permissions * console.log(role.serialize()); */ serialize() { @@ -4448,7 +4448,7 @@ class Role { * (takes priority over `explicit`) * @returns {boolean} * @example - * // see if a role can ban a member + * // See if a role can ban a member * if (role.hasPermission('BAN_MEMBERS')) { * console.log('This role can ban members'); * } else { @@ -4483,7 +4483,7 @@ class Role { } /** - * The data for a role + * The data for a role. * @typedef {Object} RoleData * @property {string} [name] The name of the role * @property {ColorResolvable} [color] The color of the role, either a hex string or a base 10 number @@ -4494,11 +4494,11 @@ class Role { */ /** - * Edits the role + * Edits the role. * @param {RoleData} data The new data for the role * @returns {Promise} * @example - * // edit a role + * // Edit a role * role.edit({name: 'new role'}) * .then(r => console.log(`Edited role ${r}`)) * .catch(console.error); @@ -4508,11 +4508,11 @@ class Role { } /** - * Set a new name for the role + * Set a new name for the role. * @param {string} name The new name of the role * @returns {Promise} * @example - * // set the name of the role + * // Set the name of the role * role.setName('new role') * .then(r => console.log(`Edited name of role ${r}`)) * .catch(console.error); @@ -4522,11 +4522,11 @@ class Role { } /** - * Set a new color for the role + * Set a new color for the role. * @param {ColorResolvable} color The color of the role * @returns {Promise} * @example - * // set the color of a role + * // Set the color of a role * role.setColor('#FF0000') * .then(r => console.log(`Set color of role ${r}`)) * .catch(console.error); @@ -4536,11 +4536,11 @@ class Role { } /** - * Set whether or not the role should be hoisted + * Set whether or not the role should be hoisted. * @param {boolean} hoist Whether or not to hoist the role * @returns {Promise} * @example - * // set the hoist of the role + * // Set the hoist of the role * role.setHoist(true) * .then(r => console.log(`Role hoisted: ${r.hoist}`)) * .catch(console.error); @@ -4550,12 +4550,12 @@ class Role { } /** - * Set the position of the role + * Set the position of the role. * @param {number} position The position of the role * @param {boolean} [relative=false] Move the position relative to its current value * @returns {Promise} * @example - * // set the position of the role + * // Set the position of the role * role.setPosition(1) * .then(r => console.log(`Role position: ${r.position}`)) * .catch(console.error); @@ -4565,11 +4565,11 @@ class Role { } /** - * Set the permissions of the role + * Set the permissions of the role. * @param {string[]} permissions The permissions of the role * @returns {Promise} * @example - * // set the permissions of the role + * // Set the permissions of the role * role.setPermissions(['KICK_MEMBERS', 'BAN_MEMBERS']) * .then(r => console.log(`Role updated ${r}`)) * .catch(console.error); @@ -4579,11 +4579,11 @@ class Role { } /** - * Set whether this role is mentionable + * Set whether this role is mentionable. * @param {boolean} mentionable Whether this role should be mentionable * @returns {Promise} * @example - * // make the role mentionable + * // Make the role mentionable * role.setMentionable(true) * .then(r => console.log(`Role updated ${r}`)) * .catch(console.error); @@ -4593,10 +4593,10 @@ class Role { } /** - * Deletes the role + * Deletes the role. * @returns {Promise} * @example - * // delete a role + * // Delete a role * role.delete() * .then(r => console.log(`Deleted role ${r}`)) * .catch(console.error); @@ -4668,9 +4668,9 @@ const Snowflake = __webpack_require__(7); class User { constructor(client, data) { /** - * The Client that created the instance of the the User. + * The client that created the instance of the the user * @name User#client - * @type {Client} + * @type {} * @readonly */ Object.defineProperty(this, 'client', { value: client }); @@ -4704,19 +4704,19 @@ class User { this.avatar = data.avatar; /** - * Whether or not the user is a bot. + * Whether or not the user is a bot * @type {boolean} */ this.bot = Boolean(data.bot); /** - * The ID of the last message sent by the user, if one was sent. + * The ID of the last message sent by the user, if one was sent * @type {?Snowflake} */ this.lastMessageID = null; /** - * The Message object of the last message sent by the user, if one was sent. + * The Message object of the last message sent by the user, if one was sent * @type {?Message} */ this.lastMessage = null; @@ -4761,7 +4761,7 @@ class User { } /** - * A link to the user's avatar (if they have one, otherwise null) + * A link to the user's avatar * @type {?string} * @readonly */ @@ -4791,7 +4791,7 @@ class User { } /** - * The discord "tag" for this user + * The Discord "tag" for this user * @type {string} * @readonly */ @@ -4849,7 +4849,7 @@ class User { } /** - * Creates a DM channel between the client and the user + * Creates a DM channel between the client and the user. * @returns {Promise} */ createDM() { @@ -4865,7 +4865,7 @@ class User { } /** - * Sends a friend request to the user + * Sends a friend request to the user. * This is only available when using a user account. * @returns {Promise} */ @@ -4874,7 +4874,7 @@ class User { } /** - * Removes the user from your friends + * Removes the user from your friends. * This is only available when using a user account. * @returns {Promise} */ @@ -4883,7 +4883,7 @@ class User { } /** - * Blocks the user + * Blocks the user. * This is only available when using a user account. * @returns {Promise} */ @@ -4892,7 +4892,7 @@ class User { } /** - * Unblocks the user + * Unblocks the user. * This is only available when using a user account. * @returns {Promise} */ @@ -4901,7 +4901,7 @@ class User { } /** - * Get the profile of the user + * Get the profile of the user. * This is only available when using a user account. * @returns {Promise} */ @@ -4910,7 +4910,7 @@ class User { } /** - * Sets a note for the user + * Sets a note for the user. * This is only available when using a user account. * @param {string} note The note to set for the user * @returns {Promise} @@ -4970,12 +4970,12 @@ const Collection = __webpack_require__(3); const Snowflake = __webpack_require__(7); /** - * Represents a custom emoji + * Represents a custom emoji. */ class Emoji { constructor(guild, data) { /** - * The Client that instantiated this object + * The client that instantiated this object * @name Emoji#client * @type {Client} * @readonly @@ -5038,7 +5038,7 @@ class Emoji { } /** - * A collection of roles this emoji is active for (empty if all), mapped by role ID. + * A collection of roles this emoji is active for (empty if all), mapped by role ID * @type {Collection} * @readonly */ @@ -5070,18 +5070,18 @@ class Emoji { } /** - * Data for editing an emoji + * Data for editing an emoji. * @typedef {Object} EmojiEditData * @property {string} [name] The name of the emoji * @property {Collection|Array} [roles] Roles to restrict emoji to */ /** - * Edits the emoji + * Edits the emoji. * @param {EmojiEditData} data The new data for the emoji * @returns {Promise} * @example - * // edit a emoji + * // Edit a emoji * emoji.edit({name: 'newemoji'}) * .then(e => console.log(`Edited emoji ${e}`)) * .catch(console.error); @@ -5094,7 +5094,7 @@ class Emoji { * When concatenated with a string, this automatically returns the emoji mention rather than the object. * @returns {string} * @example - * // send an emoji: + * // Send an emoji: * const emoji = guild.emojis.first(); * msg.reply(`Hello! ${emoji}`); */ @@ -5103,9 +5103,9 @@ class Emoji { } /** - * Whether this emoji is the same as another one - * @param {Emoji|Object} other the emoji to compare it to - * @returns {boolean} whether the emoji is equal to the given emoji or not + * Whether this emoji is the same as another one. + * @param {Emoji|Object} other The emoji to compare it to + * @returns {boolean} Whether the emoji is equal to the given emoji or not */ equals(other) { if (other instanceof Emoji) { @@ -5139,13 +5139,13 @@ const Presence = __webpack_require__(11).Presence; const util = __webpack_require__(22); /** - * Represents a member of a guild on Discord + * Represents a member of a guild on Discord. * @implements {TextBasedChannel} */ class GuildMember { constructor(guild, data) { /** - * The Client that instantiated this GuildMember + * The client that instantiated this GuildMember * @name GuildMember#client * @type {Client} * @readonly @@ -5168,13 +5168,13 @@ class GuildMember { if (data) this.setup(data); /** - * The ID of the last message sent by the member in their guild, if one was sent. + * The ID of the last message sent by the member in their guild, if one was sent * @type {?Snowflake} */ this.lastMessageID = null; /** - * The Message object of the last message sent by the member in their guild, if one was sent. + * The Message object of the last message sent by the member in their guild, if one was sent * @type {?Message} */ this.lastMessage = null; @@ -5258,7 +5258,7 @@ class GuildMember { } /** - * A list of roles that are applied to this GuildMember, mapped by the role ID. + * A list of roles that are applied to this GuildMember, mapped by the role ID * @type {Collection} * @readonly */ @@ -5277,7 +5277,7 @@ class GuildMember { } /** - * The role of the member with the highest position. + * The role of the member with the highest position * @type {Role} * @readonly */ @@ -5286,7 +5286,7 @@ class GuildMember { } /** - * The role of the member used to set their color. + * The role of the member used to set their color * @type {?Role} * @readonly */ @@ -5297,7 +5297,7 @@ class GuildMember { } /** - * The displayed color of the member in base 10. + * The displayed color of the member in base 10 * @type {number} * @readonly */ @@ -5307,7 +5307,7 @@ class GuildMember { } /** - * The displayed color of the member in hexadecimal. + * The displayed color of the member in hexadecimal * @type {string} * @readonly */ @@ -5317,7 +5317,7 @@ class GuildMember { } /** - * The role of the member used to hoist them in a separate category in the users list. + * The role of the member used to hoist them in a separate category in the users list * @type {?Role} * @readonly */ @@ -5388,7 +5388,7 @@ class GuildMember { } /** - * Whether the member is kickable by the client user. + * Whether the member is kickable by the client user * @type {boolean} * @readonly */ @@ -5401,7 +5401,7 @@ class GuildMember { } /** - * Whether the member is bannable by the client user. + * Whether the member is bannable by the client user * @type {boolean} * @readonly */ @@ -5416,7 +5416,7 @@ class GuildMember { /** * Returns `channel.permissionsFor(guildMember)`. Returns permissions for a member in a guild channel, * taking into account roles and permission overwrites. - * @param {ChannelResolvable} channel Guild channel to use as context + * @param {ChannelResolvable} channel The guild channel to use as context * @returns {?Permissions} */ permissionsIn(channel) { @@ -5466,7 +5466,7 @@ class GuildMember { } /** - * The data for editing a guild member + * The data for editing a guild member. * @typedef {Object} GuildMemberEditData * @property {string} [nick] The nickname to set for the member * @property {Collection|Role[]|Snowflake[]} [roles] The roles or role IDs to apply @@ -5476,7 +5476,7 @@ class GuildMember { */ /** - * Edit a guild member + * Edit a guild member. * @param {GuildMemberEditData} data The data to edit the member with * @returns {Promise} */ @@ -5485,7 +5485,7 @@ class GuildMember { } /** - * Mute/unmute a user + * Mute/unmute a user. * @param {boolean} mute Whether or not the member should be muted * @returns {Promise} */ @@ -5494,7 +5494,7 @@ class GuildMember { } /** - * Deafen/undeafen a user + * Deafen/undeafen a user. * @param {boolean} deaf Whether or not the member should be deafened * @returns {Promise} */ @@ -5580,7 +5580,7 @@ class GuildMember { } /** - * Set the nickname for the guild member + * Set the nickname for the guild member. * @param {string} nick The nickname for the guild member * @returns {Promise} */ @@ -5589,7 +5589,7 @@ class GuildMember { } /** - * Creates a DM channel between the client and the member + * Creates a DM channel between the client and the member. * @returns {Promise} */ createDM() { @@ -5597,7 +5597,7 @@ class GuildMember { } /** - * Deletes any DMs with this guild member + * Deletes any DMs with this guild member. * @returns {Promise} */ deleteDM() { @@ -5605,7 +5605,7 @@ class GuildMember { } /** - * Kick this member from the guild + * Kick this member from the guild. * @param {string} [reason] Reason for kicking user * @returns {Promise} */ @@ -5631,7 +5631,7 @@ class GuildMember { * When concatenated with a string, this automatically concatenates the user's mention instead of the Member object. * @returns {string} * @example - * // logs: Hello from <@123456789>! + * // Logs: Hello from <@123456789>! * console.log(`Hello from ${member}!`); */ toString() { @@ -5671,12 +5671,12 @@ const Permissions = __webpack_require__(9); let GuildMember; /** - * Represents a message on Discord + * Represents a message on Discord. */ class Message { constructor(channel, data, client) { /** - * The Client that instantiated the Message + * The client that instantiated the Message * @name Message#client * @type {Client} * @readonly @@ -5755,7 +5755,7 @@ class Message { this.embeds = data.embeds.map(e => new Embed(this, e)); /** - * A collection of attachments in the message - e.g. Pictures - mapped by their ID. + * A collection of attachments in the message - e.g. Pictures - mapped by their ID * @type {Collection} */ this.attachments = new Collection(); @@ -5774,7 +5774,7 @@ class Message { this.editedTimestamp = data.edited_timestamp ? new Date(data.edited_timestamp).getTime() : null; /** - * A collection of reactions to this message, mapped by the reaction "id". + * A collection of reactions to this message, mapped by the reaction ID * @type {Collection} */ this.reactions = new Collection(); @@ -5812,7 +5812,7 @@ class Message { } /** - * Updates the message + * Updates the message. * @param {Object} data Raw Discord message update data * @private */ @@ -5871,7 +5871,7 @@ class Message { /** * The message contents with all mentions replaced by the equivalent text. If mentions cannot be resolved to a name, - * the relevant mention in the message content will not be converted. + * the relevant mention in the message content will not be converted * @type {string} * @readonly */ @@ -5909,11 +5909,11 @@ class Message { /** * Creates a reaction collector. - * @param {CollectorFilter} filter The filter to apply. - * @param {ReactionCollectorOptions} [options={}] Options to send to the collector. + * @param {CollectorFilter} filter The filter to apply + * @param {ReactionCollectorOptions} [options={}] Options to send to the collector * @returns {ReactionCollector} * @example - * // create a reaction collector + * // Create a reaction collector * const collector = message.createReactionCollector( * (reaction, user) => reaction.emoji.id === '👌' && user.id === 'someID', * { time: 15000 } @@ -5949,8 +5949,8 @@ class Message { } /** - * An array of cached versions of the message, including the current version. - * Sorted from latest (first) to oldest (last). + * An array of cached versions of the message, including the current version + * Sorted from latest (first) to oldest (last) * @type {Message[]} * @readonly */ @@ -5961,7 +5961,7 @@ class Message { } /** - * Whether the message is editable by the client user. + * Whether the message is editable by the client user * @type {boolean} * @readonly */ @@ -5970,7 +5970,7 @@ class Message { } /** - * Whether the message is deletable by the client user. + * Whether the message is deletable by the client user * @type {boolean} * @readonly */ @@ -5981,7 +5981,7 @@ class Message { } /** - * Whether the message is pinnable by the client user. + * Whether the message is pinnable by the client user * @type {boolean} * @readonly */ @@ -5992,8 +5992,8 @@ class Message { /** * Whether or not a user, channel or role is mentioned in this message. - * @param {GuildChannel|User|Role|string} data either a guild channel, user or a role object, or a string representing - * the ID of any of these. + * @param {GuildChannel|User|Role|string} data Either a guild channel, user or a role object, or a string representing + * the ID of any of these * @returns {boolean} */ isMentioned(data) { @@ -6004,7 +6004,7 @@ class Message { /** * Whether or not a guild member is mentioned in this message. Takes into account * user mentions, role mentions, and @everyone/@here mentions. - * @param {GuildMember|User} member Member/user to check for a mention of + * @param {GuildMember|User} member The member/user to check for a mention of * @returns {boolean} */ isMemberMentioned(member) { @@ -6017,19 +6017,19 @@ class Message { } /** - * Options that can be passed into editMessage + * Options that can be passed into editMessage. * @typedef {Object} MessageEditOptions * @property {Object} [embed] An embed to be added/edited * @property {string|boolean} [code] Language for optional codeblock formatting to apply */ /** - * Edit the content of the message + * Edit the content of the message. * @param {StringResolvable} [content] The new content for the message * @param {MessageEditOptions} [options] The options to provide * @returns {Promise} * @example - * // update the content of a message + * // Update the content of a message * message.edit('This is my new content!') * .then(msg => console.log(`Updated the content of a message from ${msg.author}`)) * .catch(console.error); @@ -6045,8 +6045,8 @@ class Message { } /** - * Edit the content of the message, with a code block - * @param {string} lang Language for the code block + * Edit the content of the message, with a code block. + * @param {string} lang The language for the code block * @param {StringResolvable} content The new content for the message * @returns {Promise} */ @@ -6056,7 +6056,7 @@ class Message { } /** - * Pins this message to the channel's pinned messages + * Pins this message to the channel's pinned messages. * @returns {Promise} */ pin() { @@ -6064,7 +6064,7 @@ class Message { } /** - * Unpins this message from the channel's pinned messages + * Unpins this message from the channel's pinned messages. * @returns {Promise} */ unpin() { @@ -6072,8 +6072,8 @@ class Message { } /** - * Add a reaction to the message - * @param {string|Emoji|ReactionEmoji} emoji Emoji to react with + * Add a reaction to the message. + * @param {string|Emoji|ReactionEmoji} emoji The emoji to react with * @returns {Promise} */ react(emoji) { @@ -6084,7 +6084,7 @@ class Message { } /** - * Remove all reactions from a message + * Remove all reactions from a message. * @returns {Promise} */ clearReactions() { @@ -6092,11 +6092,11 @@ class Message { } /** - * Deletes the message + * Deletes the message. * @param {number} [timeout=0] How long to wait to delete the message in milliseconds * @returns {Promise} * @example - * // delete a message + * // Delete a message * message.delete() * .then(msg => console.log(`Deleted message from ${msg.author}`)) * .catch(console.error); @@ -6114,12 +6114,12 @@ class Message { } /** - * Reply to the message + * Reply to the message. * @param {StringResolvable} [content] The content for the message * @param {MessageOptions} [options] The options to provide * @returns {Promise} * @example - * // reply to a message + * // Reply to a message * message.reply('Hey, I\'m a reply!') * .then(msg => console.log(`Sent a reply to ${msg.author}`)) * .catch(console.error); @@ -6135,7 +6135,7 @@ class Message { } /** - * Marks the message as read + * Marks the message as read. * This is only available when using a user account. * @returns {Promise} */ @@ -6186,7 +6186,7 @@ class Message { * When concatenated with a string, this automatically concatenates the message's content instead of the object. * @returns {string} * @example - * // logs: Message: This is a message! + * // Logs: Message: This is a message! * console.log(`Message: ${message}`); */ toString() { @@ -6962,32 +6962,32 @@ const Collection = __webpack_require__(3); const util = __webpack_require__(22); /** - * Interface for classes that have text-channel-like features + * Interface for classes that have text-channel-like features. * @interface */ class TextBasedChannel { constructor() { /** - * A collection containing the messages sent to this channel. + * A collection containing the messages sent to this channel * @type {Collection} */ this.messages = new Collection(); /** - * The ID of the last message in the channel, if one was sent. + * The ID of the last message in the channel, if one was sent * @type {?Snowflake} */ this.lastMessageID = null; /** - * The Message object of the last message in the channel, if one was sent. + * The Message object of the last message in the channel, if one was sent * @type {?Message} */ this.lastMessage = null; } /** - * Options provided when sending or editing a message + * Options provided when sending or editing a message. * @typedef {Object} MessageOptions * @property {boolean} [tts=false] Whether or not the message should be spoken aloud * @property {string} [nonce=''] The nonce for the message @@ -6999,7 +6999,7 @@ class TextBasedChannel { * @property {FileOptions[]|string[]} [files] Files to send with the message * @property {string|boolean} [code] Language for optional codeblock formatting to apply * @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if - * it exceeds the character limit. If an object is provided, these are the options for splitting the message. + * it exceeds the character limit. If an object is provided, these are the options for splitting the message * @property {UserResolvable} [reply] User to reply to (prefixes the message with a mention, except in DMs) */ @@ -7010,7 +7010,7 @@ class TextBasedChannel { */ /** - * Options for splitting a message + * Options for splitting a message. * @typedef {Object} SplitOptions * @property {number} [maxLength=1950] Maximum character length per message piece * @property {string} [char='\n'] Character to split the message with @@ -7019,12 +7019,12 @@ class TextBasedChannel { */ /** - * Send a message to this channel + * Send a message to this channel. * @param {StringResolvable} [content] Text for the message * @param {MessageOptions} [options={}] Options for the message * @returns {Promise} * @example - * // send a message + * // Send a message * channel.send('hello!') * .then(message => console.log(`Sent message: ${message.content}`)) * .catch(console.error); @@ -7078,7 +7078,7 @@ class TextBasedChannel { * @param {Snowflake} messageID ID of the message to get * @returns {Promise} * @example - * // get message + * // Get message * channel.fetchMessage('99539446449315840') * .then(message => console.log(message.content)) * .catch(console.error); @@ -7113,7 +7113,7 @@ class TextBasedChannel { * @param {ChannelLogsQueryOptions} [options={}] Query parameters to pass in * @returns {Promise>} * @example - * // get messages + * // Get messages * channel.fetchMessages({limit: 10}) * .then(messages => console.log(`Received ${messages.size} messages`)) * .catch(console.error); @@ -7178,8 +7178,8 @@ class TextBasedChannel { * This is only available when using a user account. * @param {MessageSearchOptions} [options={}] Options to pass to the search * @returns {Promise>} - * An array containing arrays of messages. Each inner array is a search context cluster. - * The message which has triggered the result will have the `hit` property set to `true`. + * An array containing arrays of messages. Each inner array is a search context cluster + * The message which has triggered the result will have the `hit` property set to `true` * @example * channel.search({ * content: 'discord.js', @@ -7197,7 +7197,7 @@ class TextBasedChannel { * Starts a typing indicator in the channel. * @param {number} [count] The number of times startTyping should be considered to have been called * @example - * // start typing in a channel + * // Start typing in a channel * channel.startTyping(); */ startTyping(count) { @@ -7222,10 +7222,10 @@ class TextBasedChannel { * It can take a few seconds for the client user to stop typing. * @param {boolean} [force=false] Whether or not to reset the call count and force the indicator to stop * @example - * // stop typing in a channel + * // Stop typing in a channel * channel.stopTyping(); * @example - * // force typing to fully stop in a channel + * // Force typing to fully stop in a channel * channel.stopTyping(true); */ stopTyping(force = false) { @@ -7240,7 +7240,7 @@ class TextBasedChannel { } /** - * Whether or not the typing indicator is being shown in the channel. + * Whether or not the typing indicator is being shown in the channel * @type {boolean} * @readonly */ @@ -7249,7 +7249,7 @@ class TextBasedChannel { } /** - * Number of times `startTyping` has been called. + * Number of times `startTyping` has been called * @type {number} * @readonly */ @@ -7270,12 +7270,12 @@ class TextBasedChannel { } /** - * Creates a Message Collector + * Creates a Message Collector. * @param {CollectorFilter} filter The filter to create the collector with * @param {MessageCollectorOptions} [options={}] The options to pass to the collector * @returns {MessageCollector} * @example - * // create a message collector + * // Create a message collector * const collector = channel.createCollector( * m => m.content.includes('discord'), * { time: 15000 } @@ -7300,9 +7300,9 @@ class TextBasedChannel { * @param {AwaitMessagesOptions} [options={}] Optional options to pass to the internal collector * @returns {Promise>} * @example - * // await !vote messages + * // Await !vote messages * const filter = m => m.content.startsWith('!vote'); - * // errors: ['time'] treats ending because of the time limit as an error + * // Errors: ['time'] treats ending because of the time limit as an error * channel.awaitMessages(filter, { max: 4, time: 60000, errors: ['time'] }) * .then(collected => console.log(collected.size)) * .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`)); @@ -7321,7 +7321,7 @@ class TextBasedChannel { } /** - * Bulk delete given messages that are newer than two weeks + * Bulk delete given messages that are newer than two weeks. * This is only available when using a bot account. * @param {Collection|Message[]|number} messages Messages or number of messages to delete * @param {boolean} [filterOld=false] Filter messages to remove those which are older than two weeks automatically @@ -7337,7 +7337,7 @@ class TextBasedChannel { } /** - * Marks all messages in this channel as read + * Marks all messages in this channel as read. * This is only available when using a user account. * @returns {Promise} */ @@ -7358,13 +7358,13 @@ class TextBasedChannel { /** @lends TextBasedChannel.prototype */ const Deprecated = { /** - * Send a message to this channel + * Send a message to this channel. * @param {StringResolvable} [content] Text for the message * @param {MessageOptions} [options={}] Options for the message * @returns {Promise} * @deprecated * @example - * // send a message + * // Send a message * channel.sendMessage('hello!') * .then(message => console.log(`Sent message: ${message.content}`)) * .catch(console.error); @@ -7374,7 +7374,7 @@ const Deprecated = { }, /** - * Send an embed to this channel + * Send an embed to this channel. * @param {RichEmbed|Object} embed Embed for the message * @param {string} [content] Text for the message * @param {MessageOptions} [options] Options for the message @@ -7392,7 +7392,7 @@ const Deprecated = { }, /** - * Send files to this channel + * Send files to this channel. * @param {FileOptions[]|string[]} files Files to send with the message * @param {StringResolvable} [content] Text for the message * @param {MessageOptions} [options] Options for the message @@ -7404,7 +7404,7 @@ const Deprecated = { }, /** - * Send a file to this channel + * Send a file to this channel. * @param {BufferResolvable} attachment File to send * @param {string} [name='file.jpg'] Name and extension of the file * @param {StringResolvable} [content] Text for the message @@ -7417,7 +7417,7 @@ const Deprecated = { }, /** - * Send a code block to this channel + * Send a code block to this channel. * @param {string} lang Language for the code block * @param {StringResolvable} content Content of the code block * @param {MessageOptions} [options] Options for the message @@ -7534,7 +7534,7 @@ const Snowflake = __webpack_require__(7); class Guild { constructor(client, data) { /** - * The Client that created the instance of the the Guild. + * The client that created the instance of the the guild * @name Guild#client * @type {Client} * @readonly @@ -7542,19 +7542,19 @@ class Guild { Object.defineProperty(this, 'client', { value: client }); /** - * A collection of members that are in this guild. The key is the member's ID, the value is the member. + * A collection of members that are in this guild. The key is the member's ID, the value is the member * @type {Collection} */ this.members = new Collection(); /** - * A collection of channels that are in this guild. The key is the channel's ID, the value is the channel. + * A collection of channels that are in this guild. The key is the channel's ID, the value is the channel * @type {Collection} */ this.channels = new Collection(); /** - * A collection of roles that are in this guild. The key is the role's ID, the value is the role. + * A collection of roles that are in this guild. The key is the role's ID, the value is the role * @type {Collection} */ this.roles = new Collection(); @@ -7568,13 +7568,13 @@ class Guild { if (!data) return; if (data.unavailable) { /** - * Whether the guild is available to access. If it is not available, it indicates a server outage. + * Whether the guild is available to access. If it is not available, it indicates a server outage * @type {boolean} */ this.available = false; /** - * The Unique ID of the Guild, useful for comparisons. + * The Unique ID of the guild, useful for comparisons * @type {Snowflake} */ this.id = data.id; @@ -7585,7 +7585,7 @@ class Guild { } /** - * Sets up the Guild + * Sets up the guild. * @param {*} data The raw data of the guild * @private */ @@ -7597,13 +7597,13 @@ class Guild { this.name = data.name; /** - * The hash of the guild icon, or null if there is no icon. + * The hash of the guild icon * @type {?string} */ this.icon = data.icon; /** - * The hash of the guild splash image, or null if no splash (VIP only) + * The hash of the guild splash image (VIP only) * @type {?string} */ this.splash = data.splash; @@ -7627,7 +7627,7 @@ class Guild { this.large = Boolean('large' in data ? data.large : this.large); /** - * An array of guild features. + * An array of guild features * @type {Object[]} */ this.features = data.features; @@ -7639,31 +7639,31 @@ class Guild { this.applicationID = data.application_id; /** - * The time in seconds before a user is counted as "away from keyboard". + * The time in seconds before a user is counted as "away from keyboard" * @type {?number} */ this.afkTimeout = data.afk_timeout; /** - * The ID of the voice channel where AFK members are moved. + * The ID of the voice channel where AFK members are moved * @type {?string} */ this.afkChannelID = data.afk_channel_id; /** - * Whether embedded images are enabled on this guild. + * Whether embedded images are enabled on this guild * @type {boolean} */ this.embedEnabled = data.embed_enabled; /** - * The verification level of the guild. + * The verification level of the guild * @type {number} */ this.verificationLevel = data.verification_level; /** - * The explicit content filter level of the guild. + * The explicit content filter level of the guild * @type {number} */ this.explicitContentFilter = data.explicit_content_filter; @@ -7685,7 +7685,7 @@ class Guild { if (data.owner_id) { /** - * The user ID of this guild's owner. + * The user ID of this guild's owner * @type {Snowflake} */ this.ownerID = data.owner_id; @@ -7770,7 +7770,7 @@ class Guild { } /** - * Gets the URL to this guild's icon (if it has one, otherwise it returns null) + * The URL to this guild's icon * @type {?string} * @readonly */ @@ -7780,7 +7780,7 @@ class Guild { } /** - * Gets the URL to this guild's splash (if it has one, otherwise it returns null) + * The URL to this guild's splash * @type {?string} * @readonly */ @@ -7799,7 +7799,7 @@ class Guild { } /** - * If the client is connected to any voice channel in this guild, this will be the relevant VoiceConnection. + * If the client is connected to any voice channel in this guild, this will be the relevant VoiceConnection * @type {?VoiceConnection} * @readonly */ @@ -7809,7 +7809,7 @@ class Guild { } /** - * The `#general` TextChannel of the guild. + * The `#general` TextChannel of the guild * @type {TextChannel} * @readonly */ @@ -7818,7 +7818,7 @@ class Guild { } /** - * Get the position of this guild + * The position of this guild * This is only available when using a user account. * @type {?number} */ @@ -7829,7 +7829,7 @@ class Guild { } /** - * The `@everyone` Role of the guild. + * The `@everyone` Role of the guild * @type {Role} * @readonly */ @@ -7838,7 +7838,7 @@ class Guild { } /** - * Fetches a collection of roles in the current guild sorted by position. + * Fetches a collection of roles in the current guild sorted by position * @type {Collection} * @readonly * @private @@ -7852,7 +7852,7 @@ class Guild { * @param {UserResolvable} user The user that you want to obtain the GuildMember of * @returns {?GuildMember} * @example - * // get the guild member of a user + * // Get the guild member of a user * const member = guild.member(message.author); */ member(user) { @@ -7890,7 +7890,7 @@ class Guild { } /** - * Fetch available voice regions + * Fetch available voice regions. * @returns {Collection} */ fetchVoiceRegions() { @@ -7898,7 +7898,7 @@ class Guild { } /** - * Fetch audit logs for this guild + * Fetch audit logs for this guild. * @param {Object} [options={}] Options for fetching audit logs * @param {Snowflake|GuildAuditLogsEntry} [options.before] Limit to entries from before specified entry * @param {Snowflake|GuildAuditLogsEntry} [options.after] Limit to entries from after specified entry @@ -8000,7 +8000,7 @@ class Guild { } /** - * The data for editing a guild + * The data for editing a guild. * @typedef {Object} GuildEditData * @property {string} [name] The name of the guild * @property {string} [region] The region of the guild @@ -8013,11 +8013,11 @@ class Guild { */ /** - * Updates the Guild with new information - e.g. a new name. + * Updates the guild with new information - e.g. a new name. * @param {GuildEditData} data The data to update the guild with * @returns {Promise} * @example - * // set the guild name and region + * // Set the guild name and region * guild.edit({ * name: 'Discord Guild', * region: 'london', @@ -8034,7 +8034,7 @@ class Guild { * @param {string} name The new name of the guild * @returns {Promise} * @example - * // edit the guild name + * // Edit the guild name * guild.setName('Discord Guild') * .then(updated => console.log(`Updated guild name to ${guild.name}`)) * .catch(console.error); @@ -8045,10 +8045,10 @@ class Guild { /** * Edit the region of the guild. - * @param {string} region The new region of the guild. + * @param {string} region The new region of the guild * @returns {Promise} * @example - * // edit the guild region + * // Edit the guild region * guild.setRegion('london') * .then(updated => console.log(`Updated guild region to ${guild.region}`)) * .catch(console.error); @@ -8062,7 +8062,7 @@ class Guild { * @param {number} verificationLevel The new verification level of the guild * @returns {Promise} * @example - * // edit the guild verification level + * // Edit the guild verification level * guild.setVerificationLevel(1) * .then(updated => console.log(`Updated guild verification level to ${guild.verificationLevel}`)) * .catch(console.error); @@ -8076,7 +8076,7 @@ class Guild { * @param {ChannelResolvable} afkChannel The new AFK channel * @returns {Promise} * @example - * // edit the guild AFK channel + * // Edit the guild AFK channel * guild.setAFKChannel(channel) * .then(updated => console.log(`Updated guild AFK channel to ${guild.afkChannel}`)) * .catch(console.error); @@ -8090,7 +8090,7 @@ class Guild { * @param {number} afkTimeout The time in seconds that a user must be idle to be considered AFK * @returns {Promise} * @example - * // edit the guild AFK channel + * // Edit the guild AFK channel * guild.setAFKTimeout(60) * .then(updated => console.log(`Updated guild AFK timeout to ${guild.afkTimeout}`)) * .catch(console.error); @@ -8104,7 +8104,7 @@ class Guild { * @param {Base64Resolvable} icon The new icon of the guild * @returns {Promise} * @example - * // edit the guild icon + * // Edit the guild icon * guild.setIcon(fs.readFileSync('./icon.png')) * .then(updated => console.log('Updated the guild icon')) * .catch(console.error); @@ -8118,7 +8118,7 @@ class Guild { * @param {GuildMemberResolvable} owner The new owner of the guild * @returns {Promise} * @example - * // edit the guild owner + * // Edit the guild owner * guild.setOwner(guild.members.first()) * .then(updated => console.log(`Updated the guild owner to ${updated.owner.username}`)) * .catch(console.error); @@ -8132,7 +8132,7 @@ class Guild { * @param {Base64Resolvable} splash The new splash screen of the guild * @returns {Promise} * @example - * // edit the guild splash + * // Edit the guild splash * guild.setIcon(fs.readFileSync('./splash.png')) * .then(updated => console.log('Updated the guild splash')) * .catch(console.error); @@ -8154,16 +8154,16 @@ class Guild { } /** - * Marks all messages in this guild as read + * Marks all messages in this guild as read. * This is only available when using a user account. - * @returns {Promise} this guild + * @returns {Promise} This guild */ acknowledge() { return this.client.rest.methods.ackGuild(this); } /** - * Allow direct messages from guild members + * Allow direct messages from guild members. * @param {boolean} allow Whether to allow direct messages * @returns {Promise} */ @@ -8183,7 +8183,7 @@ class Guild { * If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot * be resolved, the user ID will be the result. * @example - * // ban a user by ID (or with a user/guild member object) + * // Ban a user by ID (or with a user/guild member object) * guild.ban('some user ID') * .then(user => console.log(`Banned ${user.username || user.id || user} from ${guild.name}`)) * .catch(console.error); @@ -8202,7 +8202,7 @@ class Guild { * @param {UserResolvable} user The user to unban * @returns {Promise} * @example - * // unban a user by ID (or with a user/guild member object) + * // Unban a user by ID (or with a user/guild member object) * guild.unban('some user ID') * .then(user => console.log(`Unbanned ${user.username} from ${guild.name}`)) * .catch(console.error); @@ -8217,12 +8217,12 @@ class Guild { * @param {boolean} [dry=false] If true, will return number of users that will be kicked, without actually doing it * @returns {Promise} The number of members that were/will be kicked * @example - * // see how many members will be pruned + * // See how many members will be pruned * guild.pruneMembers(12, true) * .then(pruned => console.log(`This will prune ${pruned} people!`)) * .catch(console.error); * @example - * // actually prune the members + * // Actually prune the members * guild.pruneMembers(12) * .then(pruned => console.log(`I just pruned ${pruned} people!`)) * .catch(console.error); @@ -8247,7 +8247,7 @@ class Guild { * @param {Array} overwrites Permission overwrites to apply to the new channel * @returns {Promise} * @example - * // create a new text channel + * // Create a new text channel * guild.createChannel('new-general', 'text') * .then(channel => console.log(`Created new channel ${channel}`)) * .catch(console.error); @@ -8281,12 +8281,12 @@ class Guild { * @param {RoleData} [data] The data to update the role with * @returns {Promise} * @example - * // create a new role + * // Create a new role * guild.createRole() * .then(role => console.log(`Created role ${role}`)) * .catch(console.error); * @example - * // create a new role with data + * // Create a new role with data * guild.createRole({ * name: 'Super Cool People', * color: 'BLUE', @@ -8300,17 +8300,17 @@ class Guild { /** * Creates a new custom emoji in the guild. - * @param {BufferResolvable|Base64Resolvable} attachment The image for the emoji. - * @param {string} name The name for the emoji. + * @param {BufferResolvable|Base64Resolvable} attachment The image for the emoji + * @param {string} name The name for the emoji * @param {Collection|Role[]} [roles] Roles to limit the emoji to - * @returns {Promise} The created emoji. + * @returns {Promise} The created emoji * @example - * // create a new emoji from a url + * // Create a new emoji from a url * guild.createEmoji('https://i.imgur.com/w3duR07.png', 'rip') * .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`)) * .catch(console.error); * @example - * // create a new emoji from a file on your computer + * // Create a new emoji from a file on your computer * guild.createEmoji('./memes/banana.png', 'banana') * .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`)) * .catch(console.error); @@ -8330,7 +8330,7 @@ class Guild { /** * Delete an emoji. - * @param {Emoji|string} emoji The emoji to delete. + * @param {Emoji|string} emoji The emoji to delete * @returns {Promise} */ deleteEmoji(emoji) { @@ -8339,10 +8339,10 @@ class Guild { } /** - * Causes the Client to leave the guild. + * Causes the client to leave the guild. * @returns {Promise} * @example - * // leave a guild + * // Leave a guild * guild.leave() * .then(g => console.log(`Left the guild ${g}`)) * .catch(console.error); @@ -8352,10 +8352,10 @@ class Guild { } /** - * Causes the Client to delete the guild. + * Causes the client to delete the guild. * @returns {Promise} * @example - * // delete a guild + * // Delete a guild * guild.delete() * .then(g => console.log(`Deleted the guild ${g}`)) * .catch(console.error); @@ -8365,10 +8365,10 @@ class Guild { } /** - * Whether this Guild equals another Guild. It compares all properties, so for most operations + * Whether this guild equals another guild. It compares all properties, so for most operations * it is advisable to just compare `guild.id === guild2.id` as it is much faster and is often * what most users need. - * @param {Guild} guild Guild to compare with + * @param {Guild} guild The guild to compare with * @returns {boolean} */ equals(guild) { @@ -8399,13 +8399,13 @@ class Guild { } /** - * When concatenated with a string, this automatically concatenates the guild's name instead of the Guild object. + * When concatenated with a string, this automatically concatenates the guild's name instead of the guild object. * @returns {string} * @example - * // logs: Hello from My Guild! + * // Logs: Hello from My Guild! * console.log(`Hello from ${guild}!`); * @example - * // logs: Hello from My Guild! + * // Logs: Hello from My Guild! * console.log('Hello from ' + guild + '!'); */ toString() { @@ -8457,7 +8457,7 @@ class Guild { if (this.client.ws.connection.status === Constants.Status.READY && notSame) { /** - * Emitted whenever a guild member changes - i.e. new role, removed role, nickname + * Emitted whenever a guild member changes - i.e. new role, removed role, nickname. * @event Client#guildMemberUpdate * @param {GuildMember} oldMember The member before the update * @param {GuildMember} newMember The member after the update @@ -8480,7 +8480,7 @@ class Guild { if (member && member.speaking !== speaking) { member.speaking = speaking; /** - * Emitted once a guild member starts/stops speaking + * Emitted once a guild member starts/stops speaking. * @event Client#guildMemberSpeaking * @param {GuildMember} member The member that started/stopped speaking * @param {boolean} speaking Whether or not the member is speaking @@ -8498,8 +8498,8 @@ class Guild { } /** - * Set the position of a role in this guild - * @param {string|Role} role The role to edit, can be a role object or a role ID. + * Set the position of a role in this guild. + * @param {string|Role} role The role to edit, can be a role object or a role ID * @param {number} position The new position of the role * @param {boolean} [relative=false] Position Moves the role relative to its current position * @returns {Promise} @@ -8522,8 +8522,8 @@ class Guild { } /** - * Set the position of a channel in this guild - * @param {string|GuildChannel} channel The channel to edit, can be a channel object or a channel ID. + * Set the position of a channel in this guild. + * @param {string|GuildChannel} channel The channel to edit, can be a channel object or a channel ID * @param {number} position The new position of the channel * @param {boolean} [relative=false] Position Moves the channel relative to its current position * @returns {Promise} @@ -8547,7 +8547,7 @@ class Guild { /** * Fetches a collection of channels in the current guild sorted by position. - * @param {string} type Channel type + * @param {string} type The channel type * @returns {Collection} * @private */ @@ -8589,7 +8589,7 @@ const Permissions = __webpack_require__(9); const Collection = __webpack_require__(3); /** - * Represents a guild channel (i.e. text channels and voice channels) + * Represents a guild channel (i.e. text channels and voice channels). * @extends {Channel} */ class GuildChannel extends Channel { @@ -8613,13 +8613,13 @@ class GuildChannel extends Channel { this.name = data.name; /** - * The position of the channel in the list. + * The position of the channel in the list * @type {number} */ this.position = data.position; /** - * A map of permission overwrites in this channel for roles and users. + * A map of permission overwrites in this channel for roles and users * @type {Collection} */ this.permissionOverwrites = new Collection(); @@ -8708,7 +8708,7 @@ class GuildChannel extends Channel { } /** - * An object mapping permission flags to `true` (enabled) or `false` (disabled) + * An object mapping permission flags to `true` (enabled) or `false` (disabled). * ```js * { * 'SEND_MESSAGES': true, @@ -8724,7 +8724,7 @@ class GuildChannel extends Channel { * @param {PermissionOverwriteOptions} options The configuration for the update * @returns {Promise} * @example - * // overwrite permissions for a message author + * // Overwrite permissions for a message author * message.channel.overwritePermissions(message.author, { * SEND_MESSAGES: false * }) @@ -8774,7 +8774,7 @@ class GuildChannel extends Channel { } /** - * The data for a guild channel + * The data for a guild channel. * @typedef {Object} ChannelData * @property {string} [name] The name of the channel * @property {number} [position] The position of the channel @@ -8784,11 +8784,11 @@ class GuildChannel extends Channel { */ /** - * Edits the channel + * Edits the channel. * @param {ChannelData} data The new data for the channel * @returns {Promise} * @example - * // edit a channel + * // Edit a channel * channel.edit({name: 'new-channel'}) * .then(c => console.log(`Edited channel ${c}`)) * .catch(console.error); @@ -8798,11 +8798,11 @@ class GuildChannel extends Channel { } /** - * Set a new name for the guild channel + * Set a new name for the guild channel. * @param {string} name The new name for the guild channel * @returns {Promise} * @example - * // set a new channel name + * // Set a new channel name * channel.setName('not_general') * .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`)) * .catch(console.error); @@ -8812,12 +8812,12 @@ class GuildChannel extends Channel { } /** - * Set a new position for the guild channel + * Set a new position for the guild channel. * @param {number} position The new position for the guild channel * @param {boolean} [relative=false] Move the position relative to its current value * @returns {Promise} * @example - * // set a new channel position + * // Set a new channel position * channel.setPosition(2) * .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`)) * .catch(console.error); @@ -8827,11 +8827,11 @@ class GuildChannel extends Channel { } /** - * Set a new topic for the guild channel + * Set a new topic for the guild channel. * @param {string} topic The new topic for the guild channel * @returns {Promise} * @example - * // set a new channel topic + * // Set a new channel topic * channel.setTopic('needs more rate limiting') * .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`)) * .catch(console.error); @@ -8841,13 +8841,13 @@ class GuildChannel extends Channel { } /** - * Options given when creating a guild channel invite + * Options given when creating a guild channel invite. * @typedef {Object} InviteOptions */ /** - * Create an invite to this guild channel + * Create an invite to this guild channel. * @param {InviteOptions} [options={}] Options for the invite * @param {boolean} [options.temporary=false] Whether members that joined via the invite should be automatically * kicked after 24 hours if they have not yet received a role @@ -8860,7 +8860,7 @@ class GuildChannel extends Channel { } /** - * Clone this channel + * Clone this channel. * @param {string} [name=this.name] Optional name for the new channel, otherwise it has the name of this channel * @param {boolean} [withPermissions=true] Whether to clone the channel with this channel's permission overwrites * @param {boolean} [withTopic=true] Whether to clone the channel with this channel's topic @@ -8897,7 +8897,7 @@ class GuildChannel extends Channel { } /** - * Whether the channel is deletable by the client user. + * Whether the channel is deletable by the client user * @type {boolean} * @readonly */ @@ -9192,7 +9192,7 @@ const Collection = __webpack_require__(3); */ /** - * Represents a Group DM on Discord + * Represents a Group DM on Discord. * @extends {Channel} * @implements {TextBasedChannel} */ @@ -9208,7 +9208,7 @@ class GroupDMChannel extends Channel { super.setup(data); /** - * The name of this Group DM, can be null if one isn't set. + * The name of this Group DM, can be null if one isn't set * @type {string} */ this.name = data.name; @@ -9220,19 +9220,19 @@ class GroupDMChannel extends Channel { this.icon = data.icon; /** - * The user ID of this Group DM's owner. + * The user ID of this Group DM's owner * @type {string} */ this.ownerID = data.owner_id; /** - * If the dm is managed by an application + * If the DM is managed by an application * @type {boolean} */ this.managed = data.managed; /** - * Application ID of the application that made this group dm, if applicable + * Application ID of the application that made this Group DM, if applicable * @type {?string} */ this.applicationID = data.application_id; @@ -9245,7 +9245,7 @@ class GroupDMChannel extends Channel { if (!this.recipients) { /** - * A collection of the recipients of this DM, mapped by their ID. + * A collection of the recipients of this DM, mapped by their ID * @type {Collection} */ this.recipients = new Collection(); @@ -9262,7 +9262,7 @@ class GroupDMChannel extends Channel { } /** - * The owner of this Group DM. + * The owner of this Group DM * @type {User} * @readonly */ @@ -9292,9 +9292,9 @@ class GroupDMChannel extends Channel { } /** - * Add a user to the dm + * Add a user to the DM * @param {UserResolvable|string} accessTokenOrID Access token or user resolvable - * @param {string} [nick] Permanent nickname to give the user (only available if a bot is creating the dm) + * @param {string} [nick] Permanent nickname to give the user (only available if a bot is creating the DM) */ addUser(accessTokenOrID, nick) { @@ -9309,10 +9309,10 @@ class GroupDMChannel extends Channel { * When concatenated with a string, this automatically concatenates the channel's name instead of the Channel object. * @returns {string} * @example - * // logs: Hello from My Group DM! + * // Logs: Hello from My Group DM! * console.log(`Hello from ${channel}!`); * @example - * // logs: Hello from My Group DM! + * // Logs: Hello from My Group DM! * console.log(`Hello from ' + channel + '!'); */ toString() { @@ -9337,7 +9337,7 @@ class GroupDMChannel extends Channel { get typingCount() {} createCollector() {} awaitMessages() {} - // Doesn't work on group DMs; bulkDelete() {} + // Doesn't work on Group DMs; bulkDelete() {} acknowledge() {} _cacheMessage() {} } @@ -9365,13 +9365,13 @@ class ReactionEmoji { this.reaction = reaction; /** - * The name of this reaction emoji. + * The name of this reaction emoji * @type {string} */ this.name = name; /** - * The ID of this reaction emoji. + * The ID of this reaction emoji * @type {?Snowflake} */ this.id = id; @@ -9390,7 +9390,7 @@ class ReactionEmoji { /** * Creates the text required to form a graphical emoji on Discord. * @example - * // send the emoji used in a reaction to the channel the reaction is part of + * // Send the emoji used in a reaction to the channel the reaction is part of * reaction.message.channel.sendMessage(`The emoji used is ${reaction.emoji}`); * @returns {string} */ @@ -9409,13 +9409,13 @@ module.exports = ReactionEmoji; const path = __webpack_require__(27); /** - * Represents a webhook + * Represents a webhook. */ class Webhook { constructor(client, dataOrID, token) { if (client) { /** - * The Client that instantiated the Webhook + * The client that instantiated the webhook * @name Webhook#client * @type {Client} * @readonly @@ -9478,7 +9478,7 @@ class Webhook { } /** - * Options that can be passed into send, sendMessage, sendFile, sendEmbed, and sendCode + * Options that can be passed into send, sendMessage, sendFile, sendEmbed, and sendCode. * @typedef {Object} WebhookMessageOptions * @property {string} [username=this.name] Username override for the message * @property {string} [avatarURL] Avatar URL override for the message @@ -9495,12 +9495,12 @@ class Webhook { */ /** - * Send a message with this webhook - * @param {StringResolvable} content The content to send. - * @param {WebhookMessageOptions} [options={}] The options to provide. + * Send a message with this webhook. + * @param {StringResolvable} content The content to send + * @param {WebhookMessageOptions} [options={}] The options to provide * @returns {Promise} * @example - * // send a message + * // Send a message * webhook.send('hello!') * .then(message => console.log(`Sent message: ${message.content}`)) * .catch(console.error); @@ -9535,11 +9535,11 @@ class Webhook { /** * Send a message with this webhook - * @param {StringResolvable} content The content to send. - * @param {WebhookMessageOptions} [options={}] The options to provide. + * @param {StringResolvable} content The content to send + * @param {WebhookMessageOptions} [options={}] The options to provide * @returns {Promise} * @example - * // send a message + * // Send a message * webhook.sendMessage('hello!') * .then(message => console.log(`Sent message: ${message.content}`)) * .catch(console.error); @@ -9549,7 +9549,7 @@ class Webhook { } /** - * Send a file with this webhook + * Send a file with this webhook. * @param {BufferResolvable} attachment The file to send * @param {string} [name='file.jpg'] The name and extension of the file * @param {StringResolvable} [content] Text message to send with the attachment @@ -9561,7 +9561,7 @@ class Webhook { } /** - * Send a code block with this webhook + * Send a code block with this webhook. * @param {string} lang Language for the code block * @param {StringResolvable} content Content of the code block * @param {WebhookMessageOptions} options The options to provide @@ -9572,11 +9572,11 @@ class Webhook { } /** - * Send a raw slack message with this webhook - * @param {Object} body The raw body to send. + * Send a raw slack message with this webhook. + * @param {Object} body The raw body to send * @returns {Promise} * @example - * // send a slack message + * // Send a slack message * webhook.sendSlackMessage({ * 'username': 'Wumpus', * 'attachments': [{ @@ -9594,8 +9594,8 @@ class Webhook { /** * Edit the webhook. - * @param {string} name The new name for the Webhook - * @param {BufferResolvable} avatar The new avatar for the Webhook. + * @param {string} name The new name for the webhook + * @param {BufferResolvable} avatar The new avatar for the webhook * @returns {Promise} */ edit(name = this.name, avatar) { @@ -9612,7 +9612,7 @@ class Webhook { } /** - * Delete the webhook + * Delete the webhook. * @returns {Promise} */ delete() { @@ -9633,14 +9633,14 @@ const EventEmitter = __webpack_require__(12).EventEmitter; /** * Filter to be applied to the collector. * @typedef {Function} CollectorFilter - * @param {...*} args Any arguments received by the listener. - * @returns {boolean} To collect or not collect. + * @param {...*} args Any arguments received by the listener + * @returns {boolean} To collect or not collect */ /** * Options to be applied to the collector. * @typedef {Object} CollectorOptions - * @property {number} [time] How long to run the collector for. + * @property {number} [time] How long to run the collector for */ /** @@ -9652,7 +9652,7 @@ class Collector extends EventEmitter { super(); /** - * The client. + * The client * @name Collector#client * @type {Client} * @readonly @@ -9660,39 +9660,39 @@ class Collector extends EventEmitter { Object.defineProperty(this, 'client', { value: client }); /** - * The filter applied to this collector. + * The filter applied to this collector * @type {CollectorFilter} */ this.filter = filter; /** - * The options of this collector. + * The options of this collector * @type {CollectorOptions} */ this.options = options; /** - * The items collected by this collector. + * The items collected by this collector * @type {Collection} */ this.collected = new Collection(); /** - * Whether this collector has finished collecting. + * Whether this collector has finished collecting * @type {boolean} */ this.ended = false; /** - * Timeout for cleanup. + * Timeout for cleanup * @type {?Timeout} * @private */ this._timeout = null; /** - * Call this to handle an event as a collectable element. - * Accepts any event data as parameters. + * Call this to handle an event as a collectable element + * Accepts any event data as parameters * @type {Function} * @private */ @@ -9701,7 +9701,7 @@ class Collector extends EventEmitter { } /** - * @param {...*} args The arguments emitted by the listener. + * @param {...*} args The arguments emitted by the listener * @emits Collector#collect * @private */ @@ -9714,8 +9714,8 @@ class Collector extends EventEmitter { /** * Emitted whenever an element is collected. * @event Collector#collect - * @param {*} element The element that got collected. - * @param {Collector} collector The collector. + * @param {*} element The element that got collected + * @param {Collector} collector The collector */ this.emit('collect', collect.value, this); @@ -9725,7 +9725,7 @@ class Collector extends EventEmitter { /** * Return a promise that resolves with the next collected element; - * rejects with collected elements if the collector finishes without receving a next element. + * rejects with collected elements if the collector finishes without receving a next element * @type {Promise} * @readonly */ @@ -9758,7 +9758,7 @@ class Collector extends EventEmitter { /** * Stop this collector and emit the `end` event. - * @param {string} [reason='user'] The reason this collector is ending. + * @param {string} [reason='user'] The reason this collector is ending * @emits Collector#end */ stop(reason = 'user') { @@ -9771,27 +9771,27 @@ class Collector extends EventEmitter { /** * Emitted when the collector is finished collecting. * @event Collector#end - * @param {Collection} collected The elements collected by the collector. - * @param {string} reason The reason the collector ended. + * @param {Collection} collected The elements collected by the collector + * @param {string} reason The reason the collector ended */ this.emit('end', this.collected, reason); } /* eslint-disable no-empty-function, valid-jsdoc */ /** - * Handles incoming events from the `listener` function. Returns null if the - * event should not be collected, or returns an object describing the data that should be stored. + * Handles incoming events from the `listener` function. Returns null if the event should not be collected, + * or returns an object describing the data that should be stored. * @see Collector#listener - * @param {...*} args Any args the event listener emits. - * @returns {?{key: string, value}} Data to insert into collection, if any. + * @param {...*} args Any args the event listener emits + * @returns {?{key: string, value}} Data to insert into collection, if any * @abstract */ handle() {} /** * This method runs after collection to see if the collector should finish. - * @param {...*} args Any args the event listener emits. - * @returns {?string} Reason to end the collector, if any. + * @param {...*} args Any args the event listener emits + * @returns {?string} Reason to end the collector, if any * @abstract */ postCheck() {} @@ -11863,7 +11863,7 @@ class ClientDataResolver { */ /** - * Resolves a UserResolvable to a User object + * Resolves a UserResolvable to a User object. * @param {UserResolvable} user The UserResolvable to identify * @returns {?User} */ @@ -11877,7 +11877,7 @@ class ClientDataResolver { } /** - * Resolves a UserResolvable to a user ID string + * Resolves a UserResolvable to a user ID string. * @param {UserResolvable} user The UserResolvable to identify * @returns {?Snowflake} */ @@ -11897,7 +11897,7 @@ class ClientDataResolver { */ /** - * Resolves a GuildResolvable to a Guild object + * Resolves a GuildResolvable to a Guild object. * @param {GuildResolvable} guild The GuildResolvable to identify * @returns {?Guild} */ @@ -11915,7 +11915,7 @@ class ClientDataResolver { */ /** - * Resolves a GuildMemberResolvable to a GuildMember object + * Resolves a GuildMemberResolvable to a GuildMember object. * @param {GuildResolvable} guild The guild that the member is part of * @param {UserResolvable} user The user that is part of the guild * @returns {?GuildMember} @@ -11938,7 +11938,7 @@ class ClientDataResolver { */ /** - * Resolves a ChannelResolvable to a Channel object + * Resolves a ChannelResolvable to a Channel object. * @param {ChannelResolvable} channel The channel resolvable to resolve * @returns {?Channel} */ @@ -11951,7 +11951,7 @@ class ClientDataResolver { } /** - * Resolves a ChannelResolvable to a channel ID + * Resolves a ChannelResolvable to a channel ID. * @param {ChannelResolvable} channel The channel resolvable to resolve * @returns {?Snowflake} */ @@ -11971,7 +11971,7 @@ class ClientDataResolver { */ /** - * Resolves InviteResolvable to an invite code + * Resolves InviteResolvable to an invite code. * @param {InviteResolvable} data The invite resolvable to resolve * @returns {string} */ @@ -11991,7 +11991,7 @@ class ClientDataResolver { */ /** - * Resolves a StringResolvable to a string + * Resolves a StringResolvable to a string. * @param {StringResolvable} data The string resolvable to resolve * @returns {string} */ @@ -12009,7 +12009,7 @@ class ClientDataResolver { */ /** - * Resolves a Base64Resolvable to a Base 64 image + * Resolves a Base64Resolvable to a Base 64 image. * @param {Base64Resolvable} data The base 64 resolvable you want to resolve * @returns {?string} */ @@ -12027,7 +12027,7 @@ class ClientDataResolver { */ /** - * Resolves a BufferResolvable to a Buffer + * Resolves a BufferResolvable to a Buffer. * @param {BufferResolvable} resource The buffer resolvable to resolve * @returns {Promise} */ @@ -12071,7 +12071,7 @@ class ClientDataResolver { */ /** - * Resolves an EmojiResolvable to an emoji identifier + * Resolves an EmojiResolvable to an emoji identifier. * @param {EmojiIdentifierResolvable} emoji The emoji resolvable to resolve * @returns {?string} */ @@ -12122,7 +12122,7 @@ class ClientDataResolver { */ /** - * Resolves a ColorResolvable into a color number + * Resolves a ColorResolvable into a color number. * @param {ColorResolvable} color Color to resolve * @returns {number} A color */ @@ -12263,7 +12263,7 @@ const ClientUserSettings = __webpack_require__(42); const Constants = __webpack_require__(0); /** - * Represents the logged in client's Discord user + * Represents the logged in client's Discord user. * @extends {User} */ class ClientUser extends User { @@ -12285,28 +12285,28 @@ class ClientUser extends User { this._typing = new Map(); /** - * A Collection of friends for the logged in user. + * A Collection of friends for the logged in user * This is only filled when using a user account. * @type {Collection} */ this.friends = new Collection(); /** - * A Collection of blocked users for the logged in user. + * A Collection of blocked users for the logged in user * This is only filled when using a user account. * @type {Collection} */ this.blocked = new Collection(); /** - * A Collection of notes for the logged in user. + * A Collection of notes for the logged in user * This is only filled when using a user account. * @type {Collection} */ this.notes = new Collection(); /** - * If the user has discord premium (nitro) + * If the user has Discord premium (nitro) * This is only filled when using a user account. * @type {?boolean} */ @@ -12320,7 +12320,7 @@ class ClientUser extends User { this.mfaEnabled = typeof data.mfa_enabled === 'boolean' ? data.mfa_enabled : null; /** - * If the user has ever used a mobile device on discord + * If the user has ever used a mobile device on Discord * This is only filled when using a user account. * @type {?boolean} */ @@ -12328,7 +12328,7 @@ class ClientUser extends User { /** * Various settings for this user - * This is only filled when using a user account + * This is only filled when using a user account. * @type {?ClientUserSettings} */ if (data.user_settings) this.settings = new ClientUserSettings(this, data.user_settings); @@ -12339,14 +12339,14 @@ class ClientUser extends User { } /** - * Set the username of the logged in Client. + * Set the username of the logged in client. * Changing usernames in Discord is heavily rate limited, with only 2 requests * every hour. Use this sparingly! * @param {string} username The new username * @param {string} [password] Current password (only for user accounts) * @returns {Promise} * @example - * // set username + * // Set username * client.user.setUsername('discordjs') * .then(user => console.log(`My new username is ${user.username}`)) * .catch(console.error); @@ -12362,7 +12362,7 @@ class ClientUser extends User { * @param {string} password Current password * @returns {Promise} * @example - * // set email + * // Set email * client.user.setEmail('bob@gmail.com', 'some amazing password 123') * .then(user => console.log(`My new email is ${user.email}`)) * .catch(console.error); @@ -12378,7 +12378,7 @@ class ClientUser extends User { * @param {string} oldPassword Current password * @returns {Promise} * @example - * // set password + * // Set password * client.user.setPassword('some new amazing password 456', 'some amazing password 123') * .then(user => console.log('New password set!')) * .catch(console.error); @@ -12388,11 +12388,11 @@ class ClientUser extends User { } /** - * Set the avatar of the logged in Client. + * Set the avatar of the logged in client. * @param {BufferResolvable|Base64Resolvable} avatar The new avatar * @returns {Promise} * @example - * // set avatar + * // Set avatar * client.user.setAvatar('./avatar.png') * .then(user => console.log(`New avatar set!`)) * .catch(console.error); @@ -12408,7 +12408,7 @@ class ClientUser extends User { } /** - * Data resembling a raw Discord presence + * Data resembling a raw Discord presence. * @typedef {Object} PresenceData * @property {PresenceStatus} [status] Status of the user * @property {boolean} [afk] Whether the user is AFK @@ -12516,7 +12516,7 @@ class ClientUser extends User { } /** - * Fetches messages that mentioned the client's user + * Fetches messages that mentioned the client's user. * @param {Object} [options] Options for the fetch * @param {number} [options.limit=25] Maximum number of mentions to retrieve * @param {boolean} [options.roles=true] Whether to include role mentions @@ -12529,10 +12529,10 @@ class ClientUser extends User { } /** - * Send a friend request + * Send a friend request. * This is only available when using a user account. - * @param {UserResolvable} user The user to send the friend request to. - * @returns {Promise} The user the friend request was sent to. + * @param {UserResolvable} user The user to send the friend request to + * @returns {Promise} The user the friend request was sent to */ addFriend(user) { user = this.client.resolver.resolveUser(user); @@ -12540,7 +12540,7 @@ class ClientUser extends User { } /** - * Remove a friend + * Remove a friend. * This is only available when using a user account. * @param {UserResolvable} user The user to remove from your friends * @returns {Promise} The user that was removed @@ -12551,7 +12551,7 @@ class ClientUser extends User { } /** - * Creates a guild + * Creates a guild. * This is only available when using a user account. * @param {string} name The name of the guild * @param {string} region The region for the server @@ -12570,17 +12570,17 @@ class ClientUser extends User { } /** - * An object containing either a user or access token, and an optional nickname + * An object containing either a user or access token, and an optional nickname. * @typedef {Object} GroupDMRecipientOptions - * @property {UserResolvable|Snowflake} [user] User to add to the group DM + * @property {UserResolvable|Snowflake} [user] User to add to the Group DM * (only available if a user is creating the DM) - * @property {string} [accessToken] Access token to use to add a user to the group DM + * @property {string} [accessToken] Access token to use to add a user to the Group DM * (only available if a bot is creating the DM) * @property {string} [nick] Permanent nickname (only available if a bot is creating the DM) */ /** - * Creates a group DM + * Creates a Group DM. * @param {GroupDMRecipientOptions[]} recipients The recipients * @returns {Promise} */ @@ -12593,7 +12593,7 @@ class ClientUser extends User { } /** - * Accepts an invite to join a guild + * Accepts an invite to join a guild. * This is only available when using a user account. * @param {Invite|string} invite Invite or code to accept * @returns {Promise} Joined guild @@ -12614,7 +12614,7 @@ const Constants = __webpack_require__(0); const Util = __webpack_require__(4); /** - * A wrapper around the ClientUser's settings + * A wrapper around the ClientUser's settings. */ class ClientUserSettings { constructor(user, data) { @@ -12623,7 +12623,7 @@ class ClientUserSettings { } /** - * Patch the data contained in this class with new partial data + * Patch the data contained in this class with new partial data. * @param {Object} data Data to patch this with */ patch(data) { @@ -12639,7 +12639,7 @@ class ClientUserSettings { } /** - * Update a specific property of of user settings + * Update a specific property of of user settings. * @param {string} name Name of property * @param {value} value Value to patch * @returns {Promise} @@ -12649,7 +12649,7 @@ class ClientUserSettings { } /** - * @param {Guild} guild Guild to move + * @param {Guild} guild The guild to move * @param {number} position Absolute or relative position * @param {boolean} [relative=false] Whether to position relatively or absolutely * @returns {Promise} @@ -12661,8 +12661,8 @@ class ClientUserSettings { } /** - * Add a guild to the list of restricted guilds - * @param {Guild} guild Guild to add + * Add a guild to the list of restricted guilds. + * @param {Guild} guild The guild to add * @returns {Promise} */ addRestrictedGuild(guild) { @@ -12673,8 +12673,8 @@ class ClientUserSettings { } /** - * Remove a guild from the list of restricted guilds - * @param {Guild} guild Guild to remove + * Remove a guild from the list of restricted guilds. + * @param {Guild} guild The guild to remove * @returns {Promise} */ removeRestrictedGuild(guild) { @@ -12807,8 +12807,8 @@ class Invite { setup(data) { /** - * The guild the invite is for. If this guild is already known, this will be a Guild object. If the guild is - * unknown, this will be a PartialGuild object. + * The guild the invite is for. If this guild is already known, this will be a guild object. If the guild is + * unknown, this will be a PartialGuild object * @type {Guild|PartialGuild} */ this.guild = this.client.guilds.get(data.guild.id) || new PartialGuild(this.client, data.guild); @@ -12902,7 +12902,7 @@ class Invite { } /** - * Deletes this invite + * Deletes this invite. * @returns {Promise} */ delete() { @@ -12913,7 +12913,7 @@ class Invite { * When concatenated with a string, this automatically concatenates the invite's URL instead of the object. * @returns {string} * @example - * // logs: Invite: https://discord.gg/A1b2C3 + * // Logs: Invite: https://discord.gg/A1b2C3 * console.log(`Invite: ${invite}`); */ toString() { @@ -12929,12 +12929,12 @@ module.exports = Invite; /***/ (function(module, exports) { /** - * Represents an attachment in a message + * Represents an attachment in a message. */ class MessageAttachment { constructor(message, data) { /** - * The Client that instantiated this MessageAttachment. + * The client that instantiated this MessageAttachment * @name MessageAttachment#client * @type {Client} * @readonly @@ -12942,7 +12942,7 @@ class MessageAttachment { Object.defineProperty(this, 'client', { value: message.client }); /** - * The message this attachment is part of. + * The message this attachment is part of * @type {Message} */ this.message = message; @@ -13007,8 +13007,8 @@ const util = __webpack_require__(22); /** * @typedef {CollectorOptions} MessageCollectorOptions - * @property {number} max The maximum amount of messages to process. - * @property {number} maxMatches The maximum amount of messages to collect. + * @property {number} max The maximum amount of messages to process + * @property {number} maxMatches The maximum amount of messages to collect */ /** @@ -13018,36 +13018,35 @@ const util = __webpack_require__(22); class MessageCollector extends Collector { /** - * @param {TextChannel|DMChannel|GroupDMChannel} channel The channel. - * @param {CollectorFilter} filter The filter to be applied to this collector. - * @param {MessageCollectorOptions} options The options to be applied to this collector. + * @param {TextChannel|DMChannel|GroupDMChannel} channel The channel + * @param {CollectorFilter} filter The filter to be applied to this collector + * @param {MessageCollectorOptions} options The options to be applied to this collector * @emits MessageCollector#message */ constructor(channel, filter, options = {}) { super(channel.client, filter, options); /** - * @type {TextBasedChannel} channel The channel. + * @type {TextBasedChannel} channel The channel */ this.channel = channel; /** - * Total number of messages that were received in the - * channel during message collection. + * Total number of messages that were received in the channel during message collection * @type {number} */ this.received = 0; this.client.on('message', this.listener); - // For backwards compatibility (remove in v12). + // For backwards compatibility (remove in v12) if (this.options.max) this.options.maxProcessed = this.options.max; if (this.options.maxMatches) this.options.max = this.options.maxMatches; this._reEmitter = message => { /** * Emitted when the collector receives a message. * @event MessageCollector#message - * @param {Message} message The message. + * @param {Message} message The message * @deprecated */ this.emit('message', message); @@ -13055,7 +13054,7 @@ class MessageCollector extends Collector { this.on('collect', this._reEmitter); } - // TODO: Remove me in v12 + // Remove in v12 on(eventName, listener) { if (eventName === 'message') { listener = util.deprecate(listener, 'MessageCollector will soon no longer emit "message", use "collect" instead'); @@ -13065,8 +13064,8 @@ class MessageCollector extends Collector { /** * Handle an incoming message for possible collection. - * @param {Message} message The message that could be collected. - * @returns {?{key: Snowflake, value: Message}} Message data to collect. + * @param {Message} message The message that could be collected + * @returns {?{key: Snowflake, value: Message}} Message data to collect * @private */ handle(message) { @@ -13080,7 +13079,7 @@ class MessageCollector extends Collector { /** * Check after collection to see if the collector is done. - * @returns {?string} Reason to end the collector, if any. + * @returns {?string} Reason to end the collector, if any * @private */ postCheck() { @@ -13138,13 +13137,13 @@ class MessageEmbed { this.type = data.type; /** - * The title of this embed, if there is one + * The title of this embed * @type {?string} */ this.title = data.title; /** - * The description of this embed, if there is one + * The description of this embed * @type {?string} */ this.description = data.description; @@ -13175,31 +13174,31 @@ class MessageEmbed { this.createdTimestamp = data.timestamp; /** - * The thumbnail of this embed, if there is one + * The thumbnail of this embed * @type {?MessageEmbedThumbnail} */ this.thumbnail = data.thumbnail ? new MessageEmbedThumbnail(this, data.thumbnail) : null; /** - * The image of this embed, if there is one + * The image of this embed * @type {?MessageEmbedImage} */ this.image = data.image ? new MessageEmbedImage(this, data.image) : null; /** - * The video of this embed, if there is one + * The video of this embed * @type {?MessageEmbedVideo} */ this.video = data.video ? new MessageEmbedVideo(this, data.video) : null; /** - * The author of this embed, if there is one + * The author of this embed * @type {?MessageEmbedAuthor} */ this.author = data.author ? new MessageEmbedAuthor(this, data.author) : null; /** - * The provider of this embed, if there is one + * The provider of this embed * @type {?MessageEmbedProvider} */ this.provider = data.provider ? new MessageEmbedProvider(this, data.provider) : null; @@ -13221,7 +13220,7 @@ class MessageEmbed { } /** - * The hexadecimal version of the embed color, with a leading hash. + * The hexadecimal version of the embed color, with a leading hash * @type {string} * @readonly */ @@ -13233,7 +13232,7 @@ class MessageEmbed { } /** - * Represents a thumbnail for a message embed + * Represents a thumbnail for a message embed. */ class MessageEmbedThumbnail { constructor(embed, data) { @@ -13274,7 +13273,7 @@ class MessageEmbedThumbnail { } /** - * Represents an image for a message embed + * Represents an image for a message embed. */ class MessageEmbedImage { constructor(embed, data) { @@ -13315,7 +13314,7 @@ class MessageEmbedImage { } /** - * Represents a video for a message embed + * Represents a video for a message embed. */ class MessageEmbedVideo { constructor(embed, data) { @@ -13350,7 +13349,7 @@ class MessageEmbedVideo { } /** - * Represents a provider for a message embed + * Represents a provider for a message embed. */ class MessageEmbedProvider { constructor(embed, data) { @@ -13379,7 +13378,7 @@ class MessageEmbedProvider { } /** - * Represents an author for a message embed + * Represents an author for a message embed. */ class MessageEmbedAuthor { constructor(embed, data) { @@ -13414,7 +13413,7 @@ class MessageEmbedAuthor { } /** - * Represents a field for a message embed + * Represents a field for a message embed. */ class MessageEmbedField { constructor(embed, data) { @@ -13449,7 +13448,7 @@ class MessageEmbedField { } /** - * Represents the footer of a message embed + * Represents the footer of a message embed. */ class MessageEmbedFooter { constructor(embed, data) { @@ -13501,7 +13500,7 @@ module.exports = MessageEmbed; const Collection = __webpack_require__(3); /** - * Keeps track of mentions in a {@link Message} + * Keeps track of mentions in a {@link Message}. */ class MessageMentions { constructor(message, users, roles, everyone) { @@ -13556,14 +13555,14 @@ class MessageMentions { this._content = message.content; /** - * Client the message is from + * The client the message is from * @type {Client} * @private */ this._client = message.client; /** - * Guild the message is in + * The guild the message is in * @type {?Guild} * @private */ @@ -13653,7 +13652,7 @@ const Emoji = __webpack_require__(17); const ReactionEmoji = __webpack_require__(30); /** - * Represents a reaction to a message + * Represents a reaction to a message. */ class MessageReaction { constructor(message, emoji, count, me) { @@ -13670,13 +13669,13 @@ class MessageReaction { this.me = me; /** - * The number of people that have given the same reaction. + * The number of people that have given the same reaction * @type {number} */ this.count = count || 0; /** - * The users that have given this reaction, mapped by their ID. + * The users that have given this reaction, mapped by their ID * @type {Collection} */ this.users = new Collection(); @@ -13707,7 +13706,7 @@ class MessageReaction { /** * Removes a user from this reaction. - * @param {UserResolvable} [user=this.message.client.user] User to remove the reaction of + * @param {UserResolvable} [user=this.message.client.user] The user to remove the reaction of * @returns {Promise} */ remove(user = this.message.client.user) { @@ -13721,7 +13720,7 @@ class MessageReaction { /** * Fetch all the users that gave this reaction. Resolves with a collection of users, mapped by their IDs. - * @param {number} [limit=100] the maximum amount of users to fetch, defaults to 100 + * @param {number} [limit=100] The maximum amount of users to fetch, defaults to 100 * @returns {Promise>} */ fetchUsers(limit = 100) { @@ -13750,7 +13749,7 @@ module.exports = MessageReaction; const Snowflake = __webpack_require__(7); /** - * Represents an OAuth2 Application + * Represents an OAuth2 Application. */ class OAuth2Application { constructor(client, data) { @@ -13809,7 +13808,7 @@ class OAuth2Application { this.redirectURIs = data.redirect_uris; /** - * If this app's bot requires a code grant when using the oauth2 flow + * If this app's bot requires a code grant when using the OAuth2 flow * @type {boolean} */ this.botRequireCodeGrant = data.bot_require_code_grant; @@ -13833,7 +13832,7 @@ class OAuth2Application { this.bot = data.bot; /** - * Flags for the app + * The flags for the app * @type {number} */ this.flags = data.flags; @@ -13864,7 +13863,7 @@ class OAuth2Application { } /** - * Reset the app's secret and bot token + * Reset the app's secret and bot token. * @returns {OAuth2Application} */ reset() { @@ -13900,7 +13899,7 @@ module.exports = OAuth2Application; class PartialGuild { constructor(client, data) { /** - * The Client that instantiated this PartialGuild + * The client that instantiated this PartialGuild * @name PartialGuild#client * @type {Client} * @readonly @@ -13924,13 +13923,13 @@ class PartialGuild { this.name = data.name; /** - * The hash of this guild's icon, or null if there is none. + * The hash of this guild's icon * @type {?string} */ this.icon = data.icon; /** - * The hash of the guild splash image, or null if no splash (VIP only) + * The hash of the guild splash image (VIP only) * @type {?string} */ this.splash = data.splash; @@ -13956,7 +13955,7 @@ const Constants = __webpack_require__(0); class PartialGuildChannel { constructor(client, data) { /** - * The Client that instantiated this PartialGuildChannel + * The client that instantiated this PartialGuildChannel * @name PartialGuildChannel#client * @type {Client} * @readonly @@ -14048,9 +14047,9 @@ const Collection = __webpack_require__(3); /** * @typedef {CollectorOptions} ReactionCollectorOptions - * @property {number} max The maximum total amount of reactions to collect. - * @property {number} maxEmojis The maximum number of emojis to collect. - * @property {number} maxUsers The maximum number of users to react. + * @property {number} max The maximum total amount of reactions to collect + * @property {number} maxEmojis The maximum number of emojis to collect + * @property {number} maxUsers The maximum number of users to react */ /** @@ -14060,27 +14059,27 @@ const Collection = __webpack_require__(3); class ReactionCollector extends Collector { /** - * @param {Message} message The message upon which to collect reactions. - * @param {CollectorFilter} filter The filter to apply to this collector. - * @param {ReactionCollectorOptions} [options={}] The options to apply to this collector. + * @param {Message} message The message upon which to collect reactions + * @param {CollectorFilter} filter The filter to apply to this collector + * @param {ReactionCollectorOptions} [options={}] The options to apply to this collector */ constructor(message, filter, options = {}) { super(message.client, filter, options); /** - * The message. + * The message * @type {Message} */ this.message = message; /** - * Users which have reacted. + * The users which have reacted * @type {Collection} */ this.users = new Collection(); /** - * Total number of reactions collected. + * The total number of reactions collected * @type {number} */ this.total = 0; @@ -14090,8 +14089,8 @@ class ReactionCollector extends Collector { /** * Handle an incoming reaction for possible collection. - * @param {MessageReaction} reaction The reaction to possibly collect. - * @returns {?{key: Snowflake, value: MessageReaction}} Reaction data to collect. + * @param {MessageReaction} reaction The reaction to possibly collect + * @returns {?{key: Snowflake, value: MessageReaction}} Reaction data to collect * @private */ handle(reaction) { @@ -14104,9 +14103,9 @@ class ReactionCollector extends Collector { /** * Check after collection to see if the collector is done. - * @param {MessageReaction} reaction The reaction that was collected. - * @param {User} user The user that reacted. - * @returns {?string} Reason to end the collector, if any. + * @param {MessageReaction} reaction The reaction that was collected + * @param {User} user The user that reacted + * @returns {?string} Reason to end the collector, if any * @private */ postCheck(reaction, user) { @@ -14154,7 +14153,7 @@ class TextChannel extends GuildChannel { super.setup(data); /** - * The topic of the text channel, if there is one. + * The topic of the text channel * @type {?string} */ this.topic = data.topic; @@ -14163,7 +14162,7 @@ class TextChannel extends GuildChannel { } /** - * A collection of members that can see this channel, mapped by their ID. + * A collection of members that can see this channel, mapped by their ID * @type {Collection} * @readonly */ @@ -14177,6 +14176,15 @@ class TextChannel extends GuildChannel { return members; } + /** + * If the Discord considers this channel NSFW + * @type {boolean} + * @readonly + */ + get nsfw() { + return /^nsfw(-|$)/.test(this.name); + } + /** * Fetch all webhooks for the channel. * @returns {Promise>} @@ -14187,12 +14195,12 @@ class TextChannel extends GuildChannel { /** * Create a webhook for the channel. - * @param {string} name The name of the webhook. - * @param {BufferResolvable|Base64Resolvable} avatar The avatar for the webhook. - * @returns {Promise} webhook The created webhook. + * @param {string} name The name of the webhook + * @param {BufferResolvable|Base64Resolvable} avatar The avatar for the webhook + * @returns {Promise} webhook The created webhook * @example * channel.createWebhook('Snek', 'http://snek.s3.amazonaws.com/topSnek.png') - * .then(webhook => console.log(`Created Webhook ${webhook}`)) + * .then(webhook => console.log(`Created webhook ${webhook}`)) * .catch(console.error) */ createWebhook(name, avatar) { @@ -14207,15 +14215,6 @@ class TextChannel extends GuildChannel { }); } - /** - * If the Discord Client considers this channel NSFW - * @type {boolean} - * @readonly - */ - get nsfw() { - return /^nsfw(-|$)/.test(this.name); - } - // These are here only for documentation purposes - they are implemented by TextBasedChannel /* eslint-disable no-empty-function */ send() {} @@ -14261,7 +14260,7 @@ class VoiceChannel extends GuildChannel { super(guild, data); /** - * The members in this voice channel. + * The members in this voice channel * @type {Collection} */ this.members = new Collection(); @@ -14327,11 +14326,11 @@ class VoiceChannel extends GuildChannel { } /** - * Sets the bitrate of the channel + * Sets the bitrate of the channel. * @param {number} bitrate The new bitrate * @returns {Promise} * @example - * // set the bitrate of a voice channel + * // Set the bitrate of a voice channel * voiceChannel.setBitrate(48000) * .then(vc => console.log(`Set bitrate to ${vc.bitrate} for ${vc.name}`)) * .catch(console.error); @@ -14341,11 +14340,11 @@ class VoiceChannel extends GuildChannel { } /** - * Sets the user limit of the channel + * Sets the user limit of the channel. * @param {number} userLimit The new user limit * @returns {Promise} * @example - * // set the user limit of a voice channel + * // Set the user limit of a voice channel * voiceChannel.setUserLimit(42) * .then(vc => console.log(`Set user limit to ${vc.userLimit} for ${vc.name}`)) * .catch(console.error); @@ -14355,10 +14354,10 @@ class VoiceChannel extends GuildChannel { } /** - * Attempts to join this voice channel + * Attempts to join this voice channel. * @returns {Promise} * @example - * // join a voice channel + * // Join a voice channel * voiceChannel.join() * .then(connection => console.log('Connected!')) * .catch(console.error); @@ -14369,9 +14368,9 @@ class VoiceChannel extends GuildChannel { } /** - * Leaves this voice channel + * Leaves this voice channel. * @example - * // leave a voice channel + * // Leave a voice channel * voiceChannel.leave(); */ leave() { @@ -16797,7 +16796,7 @@ function base64DetectIncompleteChar(buffer) { /***/ (function(module, exports) { /** - * Represents an error from the Discord API + * Represents an error from the Discord API. */ class DiscordAPIError extends Error { constructor(error) { @@ -16814,7 +16813,7 @@ class DiscordAPIError extends Error { } /** - * Flattens an errors object returned from the API into an array + * Flattens an errors object returned from the API into an array. * @param {Object} obj Discord errors object * @param {string} [key] idklol * @returns {string[]} @@ -16919,14 +16918,14 @@ class RequestHandler { this.restManager = restManager; /** - * A list of requests that have yet to be processed. + * A list of requests that have yet to be processed * @type {APIRequest[]} */ this.queue = []; } /** - * Whether or not the client is being rate limited on every endpoint. + * Whether or not the client is being rate limited on every endpoint * @type {boolean} * @readonly */ @@ -16939,7 +16938,7 @@ class RequestHandler { } /** - * Push a new API request into this bucket + * Push a new API request into this bucket. * @param {APIRequest} request The new request to push into the queue */ push(request) { @@ -16947,7 +16946,7 @@ class RequestHandler { } /** - * Attempts to get this RequestHandler to process its current queue + * Attempts to get this RequestHandler to process its current queue. */ handle() {} // eslint-disable-line no-empty-function @@ -16988,13 +16987,13 @@ const WebSocket = (function findWebSocket() { }()); /** - * Abstracts a WebSocket connection with decoding/encoding for the discord gateway + * Abstracts a WebSocket connection with decoding/encoding for the Discord gateway. * @private */ class WebSocketConnection extends EventEmitter { /** - * @param {WebSocketManager} manager the WebSocket manager - * @param {string} gateway Websocket gateway to connect to + * @param {WebSocketManager} manager The WebSocket manager + * @param {string} gateway WebSocket gateway to connect to */ constructor(manager, gateway) { super(); @@ -17003,36 +17002,43 @@ class WebSocketConnection extends EventEmitter { * @type {WebSocketManager} */ this.manager = manager; + /** - * Client this belongs to + * The client this belongs to * @type {Client} */ this.client = manager.client; + /** - * WebSocket connection itself + * The WebSocket connection itself * @type {WebSocket} */ this.ws = null; + /** - * Current sequence of the WebSocket + * The current sequence of the WebSocket * @type {number} */ this.sequence = -1; + /** - * Current status of the client + * The current status of the client * @type {number} */ this.status = Constants.Status.IDLE; + /** - * Packet Manager of the connection + * The Packet Manager of the connection * @type {WebSocketPacketManager} */ this.packetManager = new PacketManager(this); + /** - * Last time a ping was sent (a timestamp) + * The last time a ping was sent (a timestamp) * @type {number} */ this.lastPingTimestamp = 0; + /** * Contains the rate limit queue and metadata * @type {Object} @@ -17043,13 +17049,15 @@ class WebSocketConnection extends EventEmitter { resetTime: -1, }; this.connect(gateway); + /** * Events that are disabled (will not be processed) * @type {Object} */ this.disabledEvents = {}; + /** - * Sequence on WebSocket close + * The sequence on WebSocket close * @type {number} */ this.closeSequence = 0; @@ -17057,7 +17065,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Causes the client to be marked as ready and emits the ready event + * Causes the client to be marked as ready and emits the ready event. * @returns {void} */ triggerReady() { @@ -17071,7 +17079,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Checks whether the client is ready to be marked as ready + * Checks whether the client is ready to be marked as ready. * @returns {void} */ checkIfReady() { @@ -17097,7 +17105,7 @@ class WebSocketConnection extends EventEmitter { // Util /** - * Emits a debug message + * Emits a debug message. * @param {string} message Debug message * @returns {void} */ @@ -17107,7 +17115,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Attempts to serialise data from the WebSocket + * Attempts to serialise data from the WebSocket. * @param {string|Object} data Data to unpack * @returns {Object} */ @@ -17122,7 +17130,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Packs an object ready to be sent + * Packs an object ready to be sent. * @param {Object} data Data to pack * @returns {string|Buffer} */ @@ -17131,7 +17139,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Processes the current WebSocket queue + * Processes the current WebSocket queue. */ processQueue() { if (this.ratelimit.remaining === 0) return; @@ -17151,7 +17159,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Sends data, bypassing the queue + * Sends data, bypassing the queue. * @param {Object} data Packet to send * @returns {void} */ @@ -17164,7 +17172,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Adds data to the queue to be sent + * Adds data to the queue to be sent. * @param {Object} data Packet to send * @returns {void} */ @@ -17178,7 +17186,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Creates a connection to a gateway + * Creates a connection to a gateway. * @param {string} gateway Gateway to connect to * @param {number} [after=0] How long to wait before connecting * @param {boolean} [force=false] Whether or not to force a new connection even if one already exists @@ -17206,7 +17214,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Destroys the connection + * Destroys the connection. * @returns {boolean} */ destroy() { @@ -17224,7 +17232,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Called whenever a message is received + * Called whenever a message is received. * @param {Event} event Event received * @returns {boolean} */ @@ -17239,7 +17247,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Sets the current sequence of the connection + * Sets the current sequence of the connection. * @param {number} s New sequence */ setSequence(s) { @@ -17247,8 +17255,8 @@ class WebSocketConnection extends EventEmitter { } /** - * Called whenever a packet is received - * @param {Object} packet received packet + * Called whenever a packet is received. + * @param {Object} packet Received packet * @returns {boolean} */ onPacket(packet) { @@ -17276,7 +17284,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Called whenever a connection is opened to the gateway + * Called whenever a connection is opened to the gateway. * @param {Event} event Received open event */ onOpen(event) { @@ -17286,7 +17294,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Causes a reconnection to the gateway + * Causes a reconnection to the gateway. */ reconnect() { this.debug('Attemping to reconnect in 5500ms...'); @@ -17295,7 +17303,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Called whenever an error occurs with the WebSocket + * Called whenever an error occurs with the WebSocket. * @param {Error} error Error that occurred */ onError(error) { @@ -17308,7 +17316,7 @@ class WebSocketConnection extends EventEmitter { */ /** - * Called whenever a connection to the gateway is closed + * Called whenever a connection to the gateway is closed. * @param {CloseEvent} event Close event that was received */ onClose(event) { @@ -17328,7 +17336,7 @@ class WebSocketConnection extends EventEmitter { // Heartbeat /** - * Acknowledges a heartbeat + * Acknowledges a heartbeat. */ ackHeartbeat() { this.debug(`Heartbeat acknowledged, latency of ${Date.now() - this.lastPingTimestamp}ms`); @@ -17337,8 +17345,8 @@ class WebSocketConnection extends EventEmitter { /** * Sends a heartbeat or sets an interval for sending heartbeats. - * @param {number} [time] If -1, clears the interval, any other number sets an interval. - * If no value is given, a heartbeat will be sent instantly. + * @param {number} [time] If -1, clears the interval, any other number sets an interval + * If no value is given, a heartbeat will be sent instantly */ heartbeat(time) { if (!isNaN(time)) { @@ -17362,7 +17370,7 @@ class WebSocketConnection extends EventEmitter { // Identification /** - * Identifies the client on a connection + * Identifies the client on a connection. * @param {number} [after] How long to wait before identifying * @returns {void} */ @@ -17372,7 +17380,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Identifies as a new connection on the gateway + * Identifies as a new connection on the gateway. * @returns {void} */ identifyNew() { @@ -17393,7 +17401,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Resumes a session on the gateway + * Resumes a session on the gateway. * @returns {void} */ identifyResume() { @@ -17417,7 +17425,7 @@ class WebSocketConnection extends EventEmitter { } /** - * Encoding the WebSocket connections will use + * Encoding the WebSocket connections will use. * @type {string} */ WebSocketConnection.ENCODING = erlpack ? 'etf' : 'json'; @@ -17780,7 +17788,7 @@ class Client extends EventEmitter { * Sweeps all text-based channels' messages and removes the ones older than the max message lifetime. * If the message has been edited, the time of the edit is used rather than the time of the original message. * @param {number} [lifetime=this.options.messageCacheLifetime] Messages that are older than this (in seconds) - * will be removed from the caches. The default is based on {@link ClientOptions#messageCacheLifetime}. + * will be removed from the caches. The default is based on {@link ClientOptions#messageCacheLifetime} * @returns {number} Amount of messages that were removed from the caches, * or -1 if the message cache lifetime is unlimited */ @@ -17968,13 +17976,13 @@ class Client extends EventEmitter { module.exports = Client; /** - * Emitted for general warnings + * Emitted for general warnings. * @event Client#warn * @param {string} info The warning */ /** - * Emitted for general debugging information + * Emitted for general debugging information. * @event Client#debug * @param {string} info The debug information */ @@ -17992,7 +18000,7 @@ const Constants = __webpack_require__(0); const Util = __webpack_require__(4); /** - * The Webhook Client + * The webhook client. * @extends {Webhook} */ class WebhookClient extends Webhook { @@ -18001,7 +18009,7 @@ class WebhookClient extends Webhook { * @param {string} token Token of the webhook * @param {ClientOptions} [options] Options for the client * @example - * // create a new webhook and send a message + * // Create a new webhook and send a message * const hook = new Discord.WebhookClient('1234', 'abcdef'); * hook.sendMessage('This will send a message').catch(console.error); */ @@ -18112,7 +18120,7 @@ module.exports = WebhookClient; const ClientDataResolver = __webpack_require__(39); /** - * A rich embed to be sent with a message with a fluent interface for creation + * A rich embed to be sent with a message with a fluent interface for creation. * @param {Object} [data] Data to set in the rich embed */ class RichEmbed { @@ -18185,7 +18193,7 @@ class RichEmbed { } /** - * Sets the title of this embed + * Sets the title of this embed. * @param {StringResolvable} title The title * @returns {RichEmbed} This embed */ @@ -18197,7 +18205,7 @@ class RichEmbed { } /** - * Sets the description of this embed + * Sets the description of this embed. * @param {StringResolvable} description The description * @returns {RichEmbed} This embed */ @@ -18209,7 +18217,7 @@ class RichEmbed { } /** - * Sets the URL of this embed + * Sets the URL of this embed. * @param {string} url The URL * @returns {RichEmbed} This embed */ @@ -18219,7 +18227,7 @@ class RichEmbed { } /** - * Sets the color of this embed + * Sets the color of this embed. * @param {ColorResolvable} color The color of the embed * @returns {RichEmbed} This embed */ @@ -18229,7 +18237,7 @@ class RichEmbed { } /** - * Sets the author of this embed + * Sets the author of this embed. * @param {StringResolvable} name The name of the author * @param {string} [icon] The icon URL of the author * @param {string} [url] The URL of the author @@ -18241,7 +18249,7 @@ class RichEmbed { } /** - * Sets the timestamp of this embed + * Sets the timestamp of this embed. * @param {Date} [timestamp=current date] The timestamp * @returns {RichEmbed} This embed */ @@ -18251,7 +18259,7 @@ class RichEmbed { } /** - * Adds a field to the embed (max 25) + * Adds a field to the embed (max 25). * @param {StringResolvable} name The name of the field * @param {StringResolvable} value The value of the field * @param {boolean} [inline=false] Set the field to display inline @@ -18279,7 +18287,7 @@ class RichEmbed { } /** - * Set the thumbnail of this embed + * Set the thumbnail of this embed. * @param {string} url The URL of the thumbnail * @returns {RichEmbed} This embed */ @@ -18289,7 +18297,7 @@ class RichEmbed { } /** - * Set the image of this embed + * Set the image of this embed. * @param {string} url The URL of the image * @returns {RichEmbed} This embed */ @@ -18299,7 +18307,7 @@ class RichEmbed { } /** - * Sets the footer of this embed + * Sets the footer of this embed. * @param {StringResolvable} text The text of the footer * @param {string} [icon] The icon URL of the footer * @returns {RichEmbed} This embed @@ -22634,19 +22642,19 @@ const Constants = __webpack_require__(0); const WebSocketConnection = __webpack_require__(69); /** - * Manages the State and Background Tasks of the Client + * Manages the state and background tasks of the client. * @private */ class ClientManager { constructor(client) { /** - * The Client that instantiated this Manager + * The client that instantiated this Manager * @type {Client} */ this.client = client; /** - * The heartbeat interval, null if not yet set + * The heartbeat interval * @type {?number} */ this.heartbeatInterval = null; @@ -22661,7 +22669,7 @@ class ClientManager { } /** - * Connects the Client to the WebSocket + * Connects the client to the WebSocket. * @param {string} token The authorization token * @param {Function} resolve Function to run when connection is successful * @param {Function} reject Function to run when connection fails @@ -22940,7 +22948,7 @@ class GuildDeleteAction extends Action { /** * Emitted whenever a guild becomes unavailable, likely due to a server outage. * @event Client#guildUnavailable - * @param {Guild} guild The guild that has become unavailable. + * @param {Guild} guild The guild that has become unavailable */ module.exports = GuildDeleteAction; @@ -22961,9 +22969,9 @@ class GuildEmojiCreateAction extends Action { } /** - * Emitted whenever a custom emoji is created in a guild + * Emitted whenever a custom emoji is created in a guild. * @event Client#emojiCreate - * @param {Emoji} emoji The emoji that was created. + * @param {Emoji} emoji The emoji that was created */ module.exports = GuildEmojiCreateAction; @@ -22984,9 +22992,9 @@ class GuildEmojiDeleteAction extends Action { } /** - * Emitted whenever a custom guild emoji is deleted + * Emitted whenever a custom guild emoji is deleted. * @event Client#emojiDelete - * @param {Emoji} emoji The emoji that was deleted. + * @param {Emoji} emoji The emoji that was deleted */ module.exports = GuildEmojiDeleteAction; @@ -23006,7 +23014,7 @@ class GuildEmojiUpdateAction extends Action { } /** - * Emitted whenever a custom guild emoji is updated + * Emitted whenever a custom guild emoji is updated. * @event Client#emojiUpdate * @param {Emoji} oldEmoji The old emoji * @param {Emoji} newEmoji The new emoji @@ -23115,7 +23123,7 @@ class GuildMemberRemoveAction extends Action { /** * Emitted whenever a member leaves a guild, or is kicked. * @event Client#guildMemberRemove - * @param {GuildMember} member The member that has left/been kicked from the guild. + * @param {GuildMember} member The member that has left/been kicked from the guild */ module.exports = GuildMemberRemoveAction; @@ -23147,7 +23155,7 @@ class GuildRoleCreate extends Action { /** * Emitted whenever a role is created. * @event Client#roleCreate - * @param {Role} role The role that was created. + * @param {Role} role The role that was created */ module.exports = GuildRoleCreate; @@ -23194,7 +23202,7 @@ class GuildRoleDeleteAction extends Action { /** * Emitted whenever a guild role is deleted. * @event Client#roleDelete - * @param {Role} role The role that was deleted. + * @param {Role} role The role that was deleted */ module.exports = GuildRoleDeleteAction; @@ -23240,8 +23248,8 @@ class GuildRoleUpdateAction extends Action { /** * Emitted whenever a guild role is updated. * @event Client#roleUpdate - * @param {Role} oldRole The role before the update. - * @param {Role} newRole The role after the update. + * @param {Role} oldRole The role before the update + * @param {Role} newRole The role after the update */ module.exports = GuildRoleUpdateAction; @@ -23340,8 +23348,8 @@ class GuildUpdateAction extends Action { /** * Emitted whenever a guild is updated - e.g. name change. * @event Client#guildUpdate - * @param {Guild} oldGuild The guild before the update. - * @param {Guild} newGuild The guild after the update. + * @param {Guild} oldGuild The guild before the update + * @param {Guild} newGuild The guild after the update */ module.exports = GuildUpdateAction; @@ -23512,8 +23520,8 @@ class MessageReactionAdd extends Action { /** * Emitted whenever a reaction is added to a message. * @event Client#messageReactionAdd - * @param {MessageReaction} messageReaction The reaction object. - * @param {User} user The user that applied the emoji or reaction emoji. + * @param {MessageReaction} messageReaction The reaction object + * @param {User} user The user that applied the emoji or reaction emoji */ module.exports = MessageReactionAdd; @@ -23555,8 +23563,8 @@ class MessageReactionRemove extends Action { /** * Emitted whenever a reaction is removed from a message. * @event Client#messageReactionRemove - * @param {MessageReaction} messageReaction The reaction object. - * @param {User} user The user that removed the emoji or reaction emoji. + * @param {MessageReaction} messageReaction The reaction object + * @param {User} user The user that removed the emoji or reaction emoji */ module.exports = MessageReactionRemove; @@ -23587,7 +23595,7 @@ class MessageReactionRemoveAll extends Action { /** * Emitted whenever all reactions are removed from a message. * @event Client#messageReactionRemoveAll - * @param {Message} message The message the reactions were removed from. + * @param {Message} message The message the reactions were removed from */ module.exports = MessageReactionRemoveAll; @@ -23632,8 +23640,8 @@ class MessageUpdateAction extends Action { /** * Emitted whenever a message is updated - e.g. embed or content change. * @event Client#messageUpdate - * @param {Message} oldMessage The message before the update. - * @param {Message} newMessage The message after the update. + * @param {Message} oldMessage The message before the update + * @param {Message} newMessage The message after the update */ module.exports = MessageUpdateAction; @@ -24793,7 +24801,7 @@ class SequentialRequestHandler extends RequestHandler { /** * The time difference between Discord's Dates and the local computer's Dates. A positive number means the local - * computer's time is ahead of Discord's. + * computer's time is ahead of Discord's * @type {number} */ this.timeDifference = 0; @@ -24811,7 +24819,7 @@ class SequentialRequestHandler extends RequestHandler { } /** - * Performs a request then resolves a promise to indicate its readiness for a new request + * Performs a request then resolves a promise to indicate its readiness for a new request. * @param {APIRequest} item The item to execute * @returns {Promise} */ @@ -24908,20 +24916,20 @@ const Constants = __webpack_require__(0); const WebSocketConnection = __webpack_require__(69); /** - * WebSocket Manager of the Client + * WebSocket Manager of the client * @private */ class WebSocketManager extends EventEmitter { constructor(client) { super(); /** - * Client that instantiated this WebSocketManager + * The client that instantiated this WebSocketManager * @type {Client} */ this.client = client; /** - * WebSocket connection of this manager + * The WebSocket connection of this manager * @type {?WebSocketConnection} */ this.connection = null; @@ -24937,7 +24945,7 @@ class WebSocketManager extends EventEmitter { } /** - * Emits a debug event + * Emits a debug event. * @param {string} message Debug message * @returns {void} */ @@ -24946,7 +24954,7 @@ class WebSocketManager extends EventEmitter { } /** - * Destroy the client + * Destroy the client. * @returns {void} Whether or not destruction was successful */ destroy() { @@ -24958,7 +24966,7 @@ class WebSocketManager extends EventEmitter { } /** - * Send a packet on the available WebSocket + * Send a packet on the available WebSocket. * @param {Object} packet Packet to send * @returns {void} */ @@ -24971,7 +24979,7 @@ class WebSocketManager extends EventEmitter { } /** - * Connects the client to a gateway + * Connects the client to a gateway. * @param {string} gateway Gateway to connect to * @returns {boolean} */ @@ -25433,7 +25441,7 @@ class GuildMembersChunkHandler extends AbstractHandler { } /** - * Emitted whenever a chunk of guild members is received (all members come from the same guild) + * Emitted whenever a chunk of guild members is received (all members come from the same guild). * @event Client#guildMembersChunk * @param {Collection} members The members in the chunk * @param {Guild} guild The guild related to the member chunk @@ -25544,7 +25552,7 @@ class MessageCreateHandler extends AbstractHandler { } /** - * Emitted whenever a message is created + * Emitted whenever a message is created. * @event Client#message * @param {Message} message The created message */ @@ -25569,7 +25577,7 @@ class MessageDeleteHandler extends AbstractHandler { } /** - * Emitted whenever a message is deleted + * Emitted whenever a message is deleted. * @event Client#messageDelete * @param {Message} message The deleted message */ @@ -25592,7 +25600,7 @@ class MessageDeleteBulkHandler extends AbstractHandler { } /** - * Emitted whenever messages are deleted in bulk + * Emitted whenever messages are deleted in bulk. * @event Client#messageDeleteBulk * @param {Collection} messages The deleted messages, mapped by their ID */ @@ -25742,7 +25750,7 @@ class PresenceUpdateHandler extends AbstractHandler { */ /** - * Emitted whenever a member becomes available in a large guild + * Emitted whenever a member becomes available in a large guild. * @event Client#guildMemberAvailable * @param {GuildMember} member The member that became available */ @@ -25914,9 +25922,9 @@ class ResumedHandler extends AbstractHandler { } /** - * Emitted whenever a websocket resumes + * Emitted whenever a WebSocket resumes. * @event Client#resume - * @param {number} replayed Number of events that were replayed + * @param {number} replayed The number of events that were replayed */ module.exports = ResumedHandler; @@ -25980,14 +25988,14 @@ function tooLate(channel, user) { } /** - * Emitted whenever a user starts typing in a channel + * Emitted whenever a user starts typing in a channel. * @event Client#typingStart * @param {Channel} channel The channel the user started typing in * @param {User} user The user that started typing */ /** - * Emitted whenever a user stops typing in a channel + * Emitted whenever a user stops typing in a channel. * @event Client#typingStop * @param {Channel} channel The channel the user stopped typing in * @param {User} user The user that stopped typing @@ -26030,7 +26038,7 @@ class UserSettingsUpdateHandler extends AbstractHandler { } /** - * Emitted when the client user's settings update + * Emitted when the client user's settings update. * @event Client#clientUserSettingsUpdate * @param {ClientUserSettings} clientUserSettings The new client user settings */ @@ -26249,7 +26257,7 @@ class GuildAuditLogs { if (data.users) for (const user of data.users) guild.client.dataManager.newUser(user); /** - * Entries for this Guild's audit logs + * The entries for this guild's audit logs * @type {GuildAuditLogsEntry[]} */ this.entries = []; @@ -26257,7 +26265,7 @@ class GuildAuditLogs { } /** - * Handles possible promises for entry targets + * Handles possible promises for entry targets. * @returns {GuildAuditLogs} */ static build(...args) { @@ -26268,8 +26276,8 @@ class GuildAuditLogs { } /** - * Find target type from entry action - * @param {number} target Action target + * Find target type from entry action. + * @param {number} target The action target * @returns {?string} */ static targetType(target) { @@ -26285,8 +26293,8 @@ class GuildAuditLogs { /** - * Find action type from entry action - * @param {string} action Action target + * Find action type from entry action. + * @param {string} action The action target * @returns {string} */ static actionType(action) { @@ -26331,13 +26339,13 @@ class GuildAuditLogsEntry { constructor(guild, data) { const targetType = GuildAuditLogs.targetType(data.action_type); /** - * Target type of this entry + * The target type of this entry * @type {string} */ this.targetType = targetType; /** - * Action type of this entry + * The action type of this entry * @type {string} */ this.actionType = GuildAuditLogs.actionType(data.action_type); @@ -26349,13 +26357,13 @@ class GuildAuditLogsEntry { this.action = Object.keys(Actions).find(k => Actions[k] === data.action_type); /** - * Reason of this entry + * The reason of this entry * @type {?string} */ this.reason = data.reason || null; /** - * User that executed this entry + * The user that executed this entry * @type {User} */ this.executor = guild.client.users.get(data.user_id); @@ -26367,14 +26375,14 @@ class GuildAuditLogsEntry { this.changes = data.changes ? data.changes.map(c => ({ name: c.key, old: c.old_value, new: c.new_value })) : null; /** - * ID of this entry + * The ID of this entry * @type {Snowflake} */ this.id = data.id; if ([Targets.USER, Targets.GUILD].includes(targetType)) { /** - * Target of this entry + * The target of this entry * @type {?Guild|User|Role|Emoji|Invite|Webhook} */ this.target = guild.client[`${targetType.toLowerCase()}s`].get(data.target_id); @@ -26409,12 +26417,12 @@ module.exports = GuildAuditLogs; /***/ (function(module, exports) { /** - * Represents a user connection (or "platform identity") + * Represents a user connection (or "platform identity"). */ class UserConnection { constructor(user, data) { /** - * The user that owns the Connection + * The user that owns the connection * @type {User} */ this.user = user; @@ -26424,7 +26432,7 @@ class UserConnection { setup(data) { /** - * The type of the Connection + * The type of the connection * @type {string} */ this.type = data.type; @@ -26477,7 +26485,7 @@ class UserProfile { this.user = user; /** - * The Client that created the instance of the the UserProfile. + * The client that created the instance of the the UserProfile. * @name UserProfile#client * @type {Client} * @readonly @@ -26485,7 +26493,7 @@ class UserProfile { Object.defineProperty(this, 'client', { value: user.client }); /** - * Guilds that the client user and the user share + * The guilds that the client user and the user share * @type {Collection} */ this.mutualGuilds = new Collection(); @@ -26531,12 +26539,12 @@ module.exports = UserProfile; /***/ (function(module, exports) { /** - * Represents a Discord voice region for guilds + * Represents a Discord voice region for guilds. */ class VoiceRegion { constructor(data) { /** - * ID of the region + * The ID of the region * @type {string} */ this.id = data.id; diff --git a/discord.master.min.js b/discord.master.min.js index dc9c062d..4b4570db 100644 --- a/discord.master.min.js +++ b/discord.master.min.js @@ -11,7 +11,7 @@ ${t} * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details */ -!function(n,o){s=[],i=o,void 0!==(r="function"==typeof i?i.apply(t,s):i)&&(e.exports=r)}(0,function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,i,r;return t?(e>>>=0,(r=0<=e&&e<256)&&(i=c[e])?i:(n=s(e,(0|e)<0?-1:0,!0),r&&(c[e]=n),n)):(e|=0,(r=-128<=e&&e<128)&&(i=a[e])?i:(n=s(e,e<0?-1:0,!1),r&&(a[e]=n),n))}function i(e,t){if(isNaN(e)||!isFinite(e))return t?m:f;if(t){if(e<0)return m;if(e>=h)return w}else{if(e<=-p)return y;if(e+1>=p)return b}return e<0?i(-e,t).neg():s(e%l|0,e/l|0,t)}function s(t,n,i){return new e(t,n,i)}function r(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return f;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return r(e.substring(1),t,n).neg();for(var o=i(u(n,8)),a=f,c=0;c>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36>>0,h=l.toString(e);if(o=c,o.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return t(e)||(e=o(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.compare=function(e){if(t(e)||(e=o(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(g)},_.neg=_.negate,_.add=function(e){t(e)||(e=o(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,c=e.high>>>16,u=65535&e.high,l=e.low>>>16,h=65535&e.low,p=0,d=0,f=0,m=0;return m+=a+h,f+=m>>>16,m&=65535,f+=r+l,d+=f>>>16,f&=65535,d+=i+u,p+=d>>>16,d&=65535,p+=n+c,p&=65535,s(f<<16|m,p<<16|d,this.unsigned)},_.subtract=function(e){return t(e)||(e=o(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return f;if(t(e)||(e=o(e)),e.isZero())return f;if(this.eq(y))return e.isOdd()?y:f;if(e.eq(y))return this.isOdd()?y:f;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return i(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,c=65535&this.low,u=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,m=0,g=0,v=0,E=0;return E+=c*p,v+=E>>>16,E&=65535,v+=a*p,g+=v>>>16,v&=65535,v+=c*h,g+=v>>>16,v&=65535,g+=r*p,m+=g>>>16,g&=65535,g+=a*h,m+=g>>>16,g&=65535,g+=c*l,m+=g>>>16,g&=65535,m+=n*p+r*h+a*l+c*u,m&=65535,s(v<<16|E,m<<16|g,this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(t(e)||(e=o(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:f;var n,s,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return v;r=m}else{if(this.eq(y)){if(e.eq(g)||e.eq(E))return y;if(e.eq(y))return g;return n=this.shr(1).div(e).shl(1),n.eq(f)?e.isNegative()?g:E:(s=this.sub(e.mul(n)),r=n.add(s.div(e)))}if(e.eq(y))return this.unsigned?m:f;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=f}for(s=this;s.gte(e);){n=Math.max(1,Math.floor(s.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:u(2,a-48),l=i(n),h=l.mul(e);h.isNegative()||h.gt(s);)n-=c,l=i(n,this.unsigned),h=l.mul(e);l.isZero()&&(l=g),r=r.add(l),s=s.sub(h)}return r},_.div=_.divide,_.modulo=function(e){return t(e)||(e=o(e)),this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.not=function(){return s(~this.low,~this.high,this.unsigned)},_.and=function(e){return t(e)||(e=o(e)),s(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return t(e)||(e=o(e)),s(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return t(e)||(e=o(e)),s(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?s(this.low<>>32-e,this.unsigned):s(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):s(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var n=this.high;if(e<32){return s(this.low>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?s(n,0,this.unsigned):s(n>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})},function(e,t,n){"use strict";(function(t){function n(e,n,i,s){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var r,o,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,i)});case 4:return t.nextTick(function(){e.call(null,n,i,s)});default:for(r=new Array(a-1),o=0;o-1?i:R;a.WritableState=o;var k=n(20);k.inherits=n(10);var S={deprecate:n(101)},D=n(60),M=n(5).Buffer,C=n(33);k.inherits(a,D),o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:S.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var I;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(e){return!!I.call(this,e)||e&&e._writableState instanceof o}})):I=function(e){return e instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,n){var i=this._writableState,r=!1,o=M.isBuffer(e);return"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=s),i.ended?c(this,n):(o||u(this,i,e,n))&&(i.pendingcb++,r=h(this,i,o,e,t,n)),r},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||E(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||_(this,i,n)}}).call(t,n(6),n(98).setImmediate)},function(e,t,n){(function(t,i,s){const r=n(92),o="__SNEKFETCH_SYNC_REQUEST";let a=!0;for(let e of r.METHODS)e="M-SEARCH"===e?"msearch":e.toLowerCase(),r[`${e}Sync`]=((s,r={})=>{a&&(a=!1,console.error("Performing sync requests is a really stupid thing to do. https://www.google.com/search?q=why+sync+requests+are+bad+nodejs"));r.url=s;r.method=e;const c=n(28);const u=JSON.parse(c.execSync(`node ${t}/index.js`,{env:{[o]:JSON.stringify(r)}}).toString(),(e,t)=>{if(null===t)return t;if("Buffer"===t.type&&Array.isArray(t.data))return new i(t.data);if(t.__CONVERT_TO_ERROR){const e=new Error;for(const n of Object.keys(t))"__CONVERT_TO_ERROR"!==n&&(e[n]=t[n]);return e}return t});if(u.error)throw u.error;return u});if(s.env[o]){const e=JSON.parse(s.env[o]),t=r[e.method](e.url);e.headers&&t.set(e.headers),e.body&&t.send(e.body),t.end((e,t={})=>{if(e){const n={};for(const t of Object.getOwnPropertyNames(e))n[t]=e[t];t.error=n,t.error.__CONVERT_TO_ERROR=!0}t.request=null;s.stdout.write(JSON.stringify(t))})}e.exports=r}).call(t,"node_modules/snekfetch",n(5).Buffer,n(6))},function(e,t,n){(function(t){const i=n(27),s=n(28),r=n(38),o=n(0),a=n(4).convertToBuffer,c=n(16),u=n(19),l=n(25),h=n(14),p=n(18),d=n(17),f=n(30);class m{constructor(e){this.client=e}resolveUser(e){return e instanceof c?e:"string"==typeof e?this.client.users.get(e)||null:e instanceof p?e.user:e instanceof u?e.author:e instanceof l?e.owner:null}resolveUserID(e){return e instanceof c||e instanceof p?e.id:"string"==typeof e?e||null:e instanceof u?e.author.id:e instanceof l?e.ownerID:null}resolveGuild(e){return e instanceof l?e:"string"==typeof e?this.client.guilds.get(e)||null:null}resolveGuildMember(e,t){return t instanceof p?t:(e=this.resolveGuild(e),t=this.resolveUser(t),e&&t?e.members.get(t.id)||null:null)}resolveChannel(e){return e instanceof h?e:"string"==typeof e?this.client.channels.get(e)||null:e instanceof u?e.channel:e instanceof l?e.channels.get(e.id)||null:null}resolveChannelID(e){return e instanceof h?e.id:"string"==typeof e?e:e instanceof u?e.channel.id:e instanceof l?e.defaultChannel.id:null}resolveInviteCode(e){const t=/discord(?:app\.com\/invite|\.gg)\/([\w-]{2,255})/i,n=t.exec(e);return n&&n[1]?n[1]:e}resolveString(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}resolveBase64(e){return e instanceof t?`data:image/jpg;base64,${e.toString("base64")}`:e}resolveBuffer(e){return e instanceof t?Promise.resolve(e):this.client.browser&&e instanceof ArrayBuffer?Promise.resolve(a(e)):"string"==typeof e?new Promise((n,o)=>{if(/^https?:\/\//.test(e))r.get(e).end((e,i)=>{if(e)return o(e);if(!(i.body instanceof t))return o(new TypeError("The response body isn't a Buffer."));return n(i.body)});else{const t=i.resolve(e);s.stat(t,(e,i)=>{if(e)return o(e);if(!i||!i.isFile())return o(new Error(`The file could not be found: ${t}`));s.readFile(t,(e,t)=>{e?o(e):n(t)});return null})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(e){return e instanceof d||e instanceof f?e.identifier:"string"==typeof e?this.client.emojis.has(e)?this.client.emojis.get(e).identifier:e.includes("%")?e:encodeURIComponent(e):null}static resolveColor(e){if("string"==typeof e){if("RANDOM"===e)return Math.floor(16777216*Math.random());e=o.Colors[e]||parseInt(e.replace("#",""),16)}else e instanceof Array&&(e=(e[0]<<16)+(e[1]<<8)+e[2]);if(e<0||e>16777215)throw new RangeError("Color must be within the range 0 - 16777215 (0xFFFFFF).");if(e&&isNaN(e))throw new TypeError("Unable to convert color to a number.");return e}resolveColor(e){return this.constructor.resolveColor(e)}}e.exports=m}).call(t,n(5).Buffer)},function(e,t){e.exports={name:"discord.js",version:"11.1.0",description:"A powerful library for interacting with the Discord API",main:"./src/index",types:"./typings/index.d.ts",scripts:{test:"npm run lint && npm run docs:test",docs:"docgen --source src --custom docs/index.yml --output docs/docs.json","docs:test":"docgen --source src --custom docs/index.yml",lint:"eslint src","lint:fix":"eslint --fix src",webpack:"parallel-webpack"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",runkitExampleFilename:"./docs/examples/ping.js",dependencies:{long:"^3.2.0","prism-media":"^0.0.1",snekfetch:"^3.1.0",tweetnacl:"^0.14.0",ws:"^2.0.0"},peerDependencies:{bufferutil:"^2.0.0",erlpack:"hammerandchisel/erlpack","node-opus":"^0.2.5",opusscript:"^0.0.3",sodium:"^2.0.1","libsodium-wrappers":"^0.5.1"},devDependencies:{"@types/node":"^7.0.0","discord.js-docgen":"hydrabolt/discord.js-docgen",eslint:"^3.19.0","parallel-webpack":"^1.6.0","uglify-js":"mishoo/UglifyJS2#harmony",webpack:"^2.2.0"},engines:{node:">=6.0.0"},browser:{ws:!1,uws:!1,erlpack:!1,"prism-media":!1,opusscript:!1,"node-opus":!1,tweetnacl:!1,sodium:!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/Secretbox.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/util/VolumeInterface.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceBroadcast.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(e,t,n){const i=n(16),s=n(3),r=n(42),o=n(0);class a extends i{setup(e){super.setup(e),this.verified=e.verified,this.email=e.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s,this.premium="boolean"==typeof e.premium?e.premium:null,this.mfaEnabled="boolean"==typeof e.mfa_enabled?e.mfa_enabled:null,this.mobile="boolean"==typeof e.mobile?e.mobile:null,e.user_settings&&(this.settings=new r(this,e.user_settings))}edit(e){return this.client.rest.methods.updateCurrentUser(e)}setUsername(e,t){return this.client.rest.methods.updateCurrentUser({username:e},t)}setEmail(e,t){return this.client.rest.methods.updateCurrentUser({email:e},t)}setPassword(e,t){return this.client.rest.methods.updateCurrentUser({password:e},t)}setAvatar(e){return"string"==typeof e&&e.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:e}):this.client.resolver.resolveBuffer(e).then(e=>this.client.rest.methods.updateCurrentUser({avatar:e}))}setPresence(e){return new Promise(t=>{let n=this.localPresence.status||this.presence.status;let i=this.localPresence.game;let s=this.localPresence.afk||this.presence.afk;!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url});if(e.status){if("string"!=typeof e.status)throw new TypeError("Status must be a string");this.bot?n=e.status:(this.settings.update(o.UserSettingsMap.status,e.status),n="invisible")}e.game?(i=e.game,i.url&&(i.type=1)):void 0!==e.game&&(i=null);void 0!==e.afk&&(s=e.afk);s=Boolean(s);this.localPresence={status:n,game:i,afk:s};this.localPresence.since=0;this.localPresence.game=this.localPresence.game||null;this.client.ws.send({op:3,d:this.localPresence});this.client._setPresence(this.id,this.localPresence);t(this)})}setStatus(e){return this.setPresence({status:e})}setGame(e,t){return e?this.setPresence({game:{name:e,url:t}}):this.setPresence({game:null})}setAFK(e){return this.setPresence({afk:e})}fetchMentions(e={limit:25,roles:!0,everyone:!0,guild:null}){return this.client.rest.methods.fetchMentions(e)}addFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.addFriend(e)}removeFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.removeFriend(e)}createGuild(e,t,n=null){return n?"string"==typeof n&&n.startsWith("data:")?this.client.rest.methods.createGuild({name:e,icon:n,region:t}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:e,icon:n,region:t})):this.client.rest.methods.createGuild({name:e,icon:n,region:t})}createGroupDM(e){return this.client.rest.methods.createGroupDM({recipients:e.map(e=>this.client.resolver.resolveUserID(e.user)),accessTokens:e.map(e=>e.accessToken),nicks:e.map(e=>e.nick)})}acceptInvite(e){return this.client.rest.methods.acceptInvite(e)}}e.exports=a},function(e,t,n){const i=n(0),s=n(4);class r{constructor(e,t){this.user=e,this.patch(t)}patch(e){for(const t of Object.keys(i.UserSettingsMap)){const n=i.UserSettingsMap[t];e.hasOwnProperty(t)&&("function"==typeof n?this[n.name]=n(e[t]):this[n]=e[t])}}update(e,t){return this.user.client.rest.methods.patchUserSettings({[e]:t})}setGuildPosition(e,t,n){const i=Object.assign([],this.guildPositions);return s.moveElementInArray(i,e.id,t,n),this.update("guild_positions",i).then(()=>e)}addRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds);return t.includes(e.id)?Promise.reject(new Error("Guild is already restricted")):(t.push(e.id),this.update("restricted_guilds",t).then(()=>e))}removeRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds),n=t.indexOf(e.id);return n<0?Promise.reject(new Error("Guild is not restricted")):(t.splice(n,1),this.update("restricted_guilds",t).then(()=>e))}}e.exports=r},function(e,t,n){const i=n(14),s=n(23),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="dm",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.recipient=this.client.dataManager.newUser(e.recipients[0]),this.lastMessageID=e.last_message_id}toString(){return this.recipient.toString()}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),e.exports=o},function(e,t,n){const i=n(51),s=n(52),r=n(0);class o{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.guild=this.client.guilds.get(e.guild.id)||new i(this.client,e.guild),this.code=e.code,this.temporary=e.temporary,this.maxAge=e.max_age,this.uses=e.uses,this.maxUses=e.max_uses,e.inviter&&(this.inviter=this.client.dataManager.newUser(e.inviter)),this.channel=this.client.channels.get(e.channel.id)||new s(this.client,e.channel),this.createdTimestamp=new Date(e.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return r.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}e.exports=o},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){this.id=e.id,this.filename=e.filename,this.filesize=e.size,this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}e.exports=n},function(e,t,n){const i=n(32),s=n(22);class r extends i{constructor(e,t,n={}){super(e.client,t,n),this.channel=e,this.received=0,this.client.on("message",this.listener),this.options.max&&(this.options.maxProcessed=this.options.max),this.options.maxMatches&&(this.options.max=this.options.maxMatches),this._reEmitter=(e=>{this.emit("message",e)}),this.on("collect",this._reEmitter)}on(e,t){"message"===e&&(t=s.deprecate(t,'MessageCollector will soon no longer emit "message", use "collect" instead')),super.on(e,t)}handle(e){return e.channel.id!==this.channel.id?null:(this.received++,{key:e.id,value:e})}postCheck(){return this.options.maxMatches&&this.collected.size>=this.options.max?"matchesLimit":this.options.max&&this.received>=this.options.maxProcessed?"limit":null}cleanup(){this.removeListener("collect",this._reEmitter),this.client.removeListener("message",this.listener)}}e.exports=r},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){if(this.type=e.type,this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.fields=[],e.fields)for(const t of e.fields)this.fields.push(new c(this,t));this.createdTimestamp=e.timestamp,this.thumbnail=e.thumbnail?new i(this,e.thumbnail):null,this.image=e.image?new s(this,e.image):null,this.video=e.video?new r(this,e.video):null,this.author=e.author?new a(this,e.author):null,this.provider=e.provider?new o(this,e.provider):null,this.footer=e.footer?new u(this,e.footer):null}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let e=this.color.toString(16);for(;e.length<6;)e=`0${e}`;return`#${e}`}}class i{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class s{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class r{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.height=e.height,this.width=e.width}}class o{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class a{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url,this.iconURL=e.icon_url}}class c{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.value=e.value,this.inline=e.inline}}class u{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.text=e.text,this.iconURL=e.icon_url,this.proxyIconUrl=e.proxy_icon_url}}n.Thumbnail=i,n.Image=s,n.Video=r,n.Provider=o,n.Author=a,n.Field=c,n.Footer=u,e.exports=n},function(e,t,n){const i=n(3);class s{constructor(e,t,n,s){if(this.everyone=Boolean(s),t)if(t instanceof i)this.users=new i(t);else{this.users=new i;for(const n of t){let t=e.client.users.get(n.id);t||(t=e.client.dataManager.newUser(n)),this.users.set(t.id,t)}}else this.users=new i;if(n)if(n instanceof i)this.roles=new i(n);else{this.roles=new i;for(const t of n){const n=e.channel.guild.roles.get(t);n&&this.roles.set(n.id,n)}}else this.roles=new i;this._content=e.content,this._client=e.client,this._guild=e.channel.guild,this._members=null,this._channels=null}get members(){return this._members?this._members:this._guild?(this._members=new i,this.users.forEach(e=>{const t=this._guild.member(e);t&&this._members.set(t.user.id,t)}),this._members):null}get channels(){if(this._channels)return this._channels;this._channels=new i;let e;for(;null!==(e=this.constructor.CHANNELS_PATTERN.exec(this._content));){const t=this._client.channels.get(e[1]);t&&this._channels.set(t.id,t)}return this._channels}}s.EVERYONE_PATTERN=/@(everyone|here)/g,s.USERS_PATTERN=/<@!?[0-9]+>/g,s.ROLES_PATTERN=/<@&[0-9]+>/g,s.CHANNELS_PATTERN=/<#([0-9]+)>/g,e.exports=s},function(e,t,n){const i=n(3),s=n(17),r=n(30);class o{constructor(e,t,n,s){this.message=e,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,t.name,t.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const e=this.message.client.emojis;if(e.has(this._emoji.id)){const t=e.get(this._emoji.id);return this._emoji=t,t}}return this._emoji}remove(e=this.message.client.user){const t=this.message,n=this.message.client.resolver.resolveUserID(e);return n?t.client.rest.methods.removeMessageReaction(t,this.emoji.identifier,n):Promise.reject(new Error("Couldn't resolve the user ID to remove from the reaction."))}fetchUsers(e=100){const t=this.message;return t.client.rest.methods.getMessageReactionUsers(t,this.emoji.identifier,e).then(e=>{this.users=new i;for(const t of e){const e=this.message.client.dataManager.newUser(t);this.users.set(e.id,e)}this.count=this.users.size;return this.users})}}e.exports=o},function(e,t,n){const i=n(7);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.description=e.description,this.icon=e.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=e.rpc_origins,this.redirectURIs=e.redirect_uris,this.botRequireCodeGrant=e.bot_require_code_grant,this.botPublic=e.bot_public,this.rpcApplicationState=e.rpc_application_state,this.bot=e.bot,this.flags=e.flags,this.secret=e.secret}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}reset(){return this.client.rest.methods.resetApplication(this.id)}toString(){return this.name}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.icon=e.icon,this.splash=e.splash}}e.exports=n},function(e,t,n){const i=n(0);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.type=i.ChannelTypes.TEXT===e.type?"text":"voice"}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"channel",{value:e}),t&&this.setup(t)}setup(e){this.id=e.id,this.type=e.type,this.deny=e.deny,this.allow=e.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}e.exports=n},function(e,t,n){const i=n(32),s=n(3);class r extends i{constructor(e,t,n={}){super(e.client,t,n),this.message=e,this.users=new s,this.total=0,this.client.on("messageReactionAdd",this.listener)}handle(e){return e.message.id!==this.message.id?null:{key:e.emoji.id||e.emoji.name,value:e}}postCheck(e,t){return this.users.set(t.id,t),this.options.max&&++this.total>=this.options.max?"limit":this.options.maxEmojis&&this.collected.size>=this.options.maxEmojis?"emojiLimit":this.options.maxUsers&&this.users.size>=this.options.maxUsers?"userLimit":null}cleanup(){this.client.removeListener("messageReactionAdd",this.listener)}}e.exports=r},function(e,t,n){const i=n(26),s=n(23),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="text",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.topic=e.topic,this.lastMessageID=e.last_message_id}get members(){const e=new r;for(const t of this.guild.members.values())this.permissionsFor(t).hasPermission("READ_MESSAGES")&&e.set(t.id,t);return e}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(e,t){return new Promise(n=>{"string"==typeof t&&t.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,e,t)):this.client.resolver.resolveBuffer(t).then(t=>n(this.client.rest.methods.createWebhook(this,e,t)))})}get nsfw(){return/^nsfw(-|$)/.test(this.name)}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}createMessageCollector(){}awaitMessages(){}bulkDelete(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0),e.exports=o},function(e,t,n){const i=n(26),s=n(3);class r extends i{constructor(e,t){super(e,t),this.members=new s,this.type="voice"}setup(e){super.setup(e),this.bitrate=e.bitrate,this.userLimit=e.user_limit}get connection(){const e=this.guild.voiceConnection;return e&&e.channel.id===this.id?e:null}get full(){return this.userLimit>0&&this.members.size>=this.userLimit}get joinable(){return!this.client.browser&&(!!this.permissionsFor(this.client.user).hasPermission("CONNECT")&&!(this.full&&!this.permissionsFor(this.client.user).hasPermission("MOVE_MEMBERS")))}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(e){return this.edit({bitrate:e})}setUserLimit(e){return this.edit({userLimit:e})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const e=this.client.voice.connections.get(this.guild.id);e&&e.channel.id===this.id&&e.disconnect()}}}e.exports=r},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t){function i(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?M(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function s(e,t){S=S||n(13),e=e||{},this.objectMode=!!e.objectMode,t instanceof S&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.buffer=new G,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(j||(j=n(65).StringDecoder),this.decoder=new j(e.encoding),this.encoding=e.encoding)}function r(e){if(S=S||n(13),!(this instanceof r))return new r(e);this._readableState=new s(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),I.call(this)}function o(e,t,n,i,s){var r=l(t,n);if(r)e.emit("error",r);else if(null===n)t.reading=!1,h(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!s){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&s){var c=new Error("stream.unshift() after end event");e.emit("error",c)}else{var u;!t.decoder||s||i||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),s||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,s?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&p(e))),f(e,t)}else s||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length=B?e=B:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function u(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=c(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function l(e,t){var n=null;return L.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,p(e)}}function p(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?D(d,e):d(e))}function d(e){P("emit readable"),e.emit("readable"),w(e)}function f(e,t){t.readingMore||(t.readingMore=!0,D(m,e,t))}function m(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=_(e,t.buffer,t.decoder),n}function _(e,t,n){var i;return er.length?r.length:e;if(o===r.length?s+=r:s+=r.slice(0,e),0===(e-=o)){o===r.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=r.slice(o));break}++i}return t.length-=i,s}function A(e,t){var n=U.allocUnsafe(e),i=t.head,s=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(n,n.length-e,0,o),0===(e-=o)){o===r.length?(++s,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=r.slice(o));break}++s}return t.length-=s,n}function R(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,D(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function k(e,t){for(var n=0,i=e.length;n=t.highWaterMark||t.ended))return P("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):p(this),null;if(0===(e=u(e,t))&&t.ended)return 0===t.length&&R(this),null;var i=t.needReadable;P("need readable",i),(0===t.length||t.length-e0?y(e,t):null,null===s?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&R(this)),null!==s&&this.emit("data",s),s},r.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},r.prototype.pipe=function(e,n){function s(e){P("onunpipe"),e===p&&o()}function r(){P("onend"),e.end()}function o(){P("cleanup"),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("drain",v),e.removeListener("error",c),e.removeListener("unpipe",s),p.removeListener("end",r),p.removeListener("end",o),p.removeListener("data",a),E=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function a(t){P("ondata"),b=!1,!1!==e.write(t)||b||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==k(d.pipes,e))&&!E&&(P("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,b=!0),p.pause())}function c(t){P("onerror",t),h(),e.removeListener("error",c),0===C(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",l),h()}function l(){P("onfinish"),e.removeListener("close",u),h()}function h(){P("unpipe"),p.unpipe(e)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,P("pipe count=%d opts=%j",d.pipesCount,n);var f=(!n||!1!==n.end)&&e!==t.stdout&&e!==t.stderr,m=f?r:o;d.endEmitted?D(m):p.once("end",m),e.on("unpipe",s);var v=g(p);e.on("drain",v);var E=!1,b=!1;return p.on("data",a),i(e,"error",c),e.once("close",u),e.once("finish",l),e.emit("pipe",p),d.flowing||(P("pipe resume"),p.resume()),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(f),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],E={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(36);i.prototype.parse=function(e,t,n){if(!u.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i127?C+="x":C+=M[I];if(!C.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var U=S.slice(0,x),O=S.slice(x+1),N=M.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);N&&(U.push(N[1]),O.unshift(N[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=c.toASCII(this.hostname));var P=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+P,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!E[d])for(var x=0,D=m.length;x0)&&n.host.split("@");R&&(n.auth=R.shift(),n.host=n.hostname=R.shift())}return n.search=e.search,n.query=e.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var T=x.slice(-1)[0],k=(n.host||e.host||x.length>1)&&("."===T||".."===T)||""===T,S=0,D=x.length;D>=0;D--)T=x[D],"."===T?x.splice(D,1):".."===T?(x.splice(D,1),S++):S&&(x.splice(D,1),S--);if(!y&&!_)for(;S--;S)x.unshift("..");!y||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),k&&"/"!==x.join("/").substr(-1)&&x.push("");var M=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(A){n.hostname=n.host=M?"":x.length?x.shift():"";var R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");R&&(n.auth=R.shift(),n.host=n.hostname=R.shift())}return y=y||n.host&&x.length,y&&!M&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=h.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){function i(e){if(e&&!c(e))throw new Error("Unknown encoding: "+e)}function s(e){return e.toString(this.encoding)}function r(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=n(5).Buffer,c=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),i(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=s)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,s),s-=this.charReceived),t+=e.toString(this.encoding,0,s);var s=t.length-1,i=t.charCodeAt(s);if(i>=55296&&i<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),e.copy(this.charBuffer,0,0,r),t.substring(0,s)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,i=this.charBuffer,s=this.encoding;t+=i.slice(0,n).toString(s)}return t}},function(e,t){class n extends Error{constructor(e){super();const t=e.errors?` +!function(n,o){s=[],i=o,void 0!==(r="function"==typeof i?i.apply(t,s):i)&&(e.exports=r)}(0,function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,i,r;return t?(e>>>=0,(r=0<=e&&e<256)&&(i=c[e])?i:(n=s(e,(0|e)<0?-1:0,!0),r&&(c[e]=n),n)):(e|=0,(r=-128<=e&&e<128)&&(i=a[e])?i:(n=s(e,e<0?-1:0,!1),r&&(a[e]=n),n))}function i(e,t){if(isNaN(e)||!isFinite(e))return t?m:f;if(t){if(e<0)return m;if(e>=h)return w}else{if(e<=-p)return y;if(e+1>=p)return b}return e<0?i(-e,t).neg():s(e%l|0,e/l|0,t)}function s(t,n,i){return new e(t,n,i)}function r(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return f;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===s)return r(e.substring(1),t,n).neg();for(var o=i(u(n,8)),a=f,c=0;c>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36>>0,h=l.toString(e);if(o=c,o.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return t(e)||(e=o(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.compare=function(e){if(t(e)||(e=o(e)),this.eq(e))return 0;var n=this.isNegative(),i=e.isNegative();return n&&!i?-1:!n&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(g)},_.neg=_.negate,_.add=function(e){t(e)||(e=o(e));var n=this.high>>>16,i=65535&this.high,r=this.low>>>16,a=65535&this.low,c=e.high>>>16,u=65535&e.high,l=e.low>>>16,h=65535&e.low,p=0,d=0,f=0,m=0;return m+=a+h,f+=m>>>16,m&=65535,f+=r+l,d+=f>>>16,f&=65535,d+=i+u,p+=d>>>16,d&=65535,p+=n+c,p&=65535,s(f<<16|m,p<<16|d,this.unsigned)},_.subtract=function(e){return t(e)||(e=o(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return f;if(t(e)||(e=o(e)),e.isZero())return f;if(this.eq(y))return e.isOdd()?y:f;if(e.eq(y))return this.isOdd()?y:f;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return i(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,c=65535&this.low,u=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,m=0,g=0,v=0,E=0;return E+=c*p,v+=E>>>16,E&=65535,v+=a*p,g+=v>>>16,v&=65535,v+=c*h,g+=v>>>16,v&=65535,g+=r*p,m+=g>>>16,g&=65535,g+=a*h,m+=g>>>16,g&=65535,g+=c*l,m+=g>>>16,g&=65535,m+=n*p+r*h+a*l+c*u,m&=65535,s(v<<16|E,m<<16|g,this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(t(e)||(e=o(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:f;var n,s,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return v;r=m}else{if(this.eq(y)){if(e.eq(g)||e.eq(E))return y;if(e.eq(y))return g;return n=this.shr(1).div(e).shl(1),n.eq(f)?e.isNegative()?g:E:(s=this.sub(e.mul(n)),r=n.add(s.div(e)))}if(e.eq(y))return this.unsigned?m:f;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=f}for(s=this;s.gte(e);){n=Math.max(1,Math.floor(s.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:u(2,a-48),l=i(n),h=l.mul(e);h.isNegative()||h.gt(s);)n-=c,l=i(n,this.unsigned),h=l.mul(e);l.isZero()&&(l=g),r=r.add(l),s=s.sub(h)}return r},_.div=_.divide,_.modulo=function(e){return t(e)||(e=o(e)),this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.not=function(){return s(~this.low,~this.high,this.unsigned)},_.and=function(e){return t(e)||(e=o(e)),s(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return t(e)||(e=o(e)),s(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return t(e)||(e=o(e)),s(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?s(this.low<>>32-e,this.unsigned):s(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):s(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var n=this.high;if(e<32){return s(this.low>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?s(n,0,this.unsigned):s(n>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})},function(e,t,n){"use strict";(function(t){function n(e,n,i,s){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var r,o,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,i)});case 4:return t.nextTick(function(){e.call(null,n,i,s)});default:for(r=new Array(a-1),o=0;o-1?i:R;a.WritableState=o;var k=n(20);k.inherits=n(10);var S={deprecate:n(101)},D=n(60),M=n(5).Buffer,C=n(33);k.inherits(a,D),o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:S.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var I;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(e){return!!I.call(this,e)||e&&e._writableState instanceof o}})):I=function(e){return e instanceof this},a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},a.prototype.write=function(e,t,n){var i=this._writableState,r=!1,o=M.isBuffer(e);return"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=s),i.ended?c(this,n):(o||u(this,i,e,n))&&(i.pendingcb++,r=h(this,i,o,e,t,n)),r},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||E(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},a.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||_(this,i,n)}}).call(t,n(6),n(98).setImmediate)},function(e,t,n){(function(t,i,s){const r=n(92),o="__SNEKFETCH_SYNC_REQUEST";let a=!0;for(let e of r.METHODS)e="M-SEARCH"===e?"msearch":e.toLowerCase(),r[`${e}Sync`]=((s,r={})=>{a&&(a=!1,console.error("Performing sync requests is a really stupid thing to do. https://www.google.com/search?q=why+sync+requests+are+bad+nodejs"));r.url=s;r.method=e;const c=n(28);const u=JSON.parse(c.execSync(`node ${t}/index.js`,{env:{[o]:JSON.stringify(r)}}).toString(),(e,t)=>{if(null===t)return t;if("Buffer"===t.type&&Array.isArray(t.data))return new i(t.data);if(t.__CONVERT_TO_ERROR){const e=new Error;for(const n of Object.keys(t))"__CONVERT_TO_ERROR"!==n&&(e[n]=t[n]);return e}return t});if(u.error)throw u.error;return u});if(s.env[o]){const e=JSON.parse(s.env[o]),t=r[e.method](e.url);e.headers&&t.set(e.headers),e.body&&t.send(e.body),t.end((e,t={})=>{if(e){const n={};for(const t of Object.getOwnPropertyNames(e))n[t]=e[t];t.error=n,t.error.__CONVERT_TO_ERROR=!0}t.request=null;s.stdout.write(JSON.stringify(t))})}e.exports=r}).call(t,"node_modules/snekfetch",n(5).Buffer,n(6))},function(e,t,n){(function(t){const i=n(27),s=n(28),r=n(38),o=n(0),a=n(4).convertToBuffer,c=n(16),u=n(19),l=n(25),h=n(14),p=n(18),d=n(17),f=n(30);class m{constructor(e){this.client=e}resolveUser(e){return e instanceof c?e:"string"==typeof e?this.client.users.get(e)||null:e instanceof p?e.user:e instanceof u?e.author:e instanceof l?e.owner:null}resolveUserID(e){return e instanceof c||e instanceof p?e.id:"string"==typeof e?e||null:e instanceof u?e.author.id:e instanceof l?e.ownerID:null}resolveGuild(e){return e instanceof l?e:"string"==typeof e?this.client.guilds.get(e)||null:null}resolveGuildMember(e,t){return t instanceof p?t:(e=this.resolveGuild(e),t=this.resolveUser(t),e&&t?e.members.get(t.id)||null:null)}resolveChannel(e){return e instanceof h?e:"string"==typeof e?this.client.channels.get(e)||null:e instanceof u?e.channel:e instanceof l?e.channels.get(e.id)||null:null}resolveChannelID(e){return e instanceof h?e.id:"string"==typeof e?e:e instanceof u?e.channel.id:e instanceof l?e.defaultChannel.id:null}resolveInviteCode(e){const t=/discord(?:app\.com\/invite|\.gg)\/([\w-]{2,255})/i,n=t.exec(e);return n&&n[1]?n[1]:e}resolveString(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}resolveBase64(e){return e instanceof t?`data:image/jpg;base64,${e.toString("base64")}`:e}resolveBuffer(e){return e instanceof t?Promise.resolve(e):this.client.browser&&e instanceof ArrayBuffer?Promise.resolve(a(e)):"string"==typeof e?new Promise((n,o)=>{if(/^https?:\/\//.test(e))r.get(e).end((e,i)=>{if(e)return o(e);if(!(i.body instanceof t))return o(new TypeError("The response body isn't a Buffer."));return n(i.body)});else{const t=i.resolve(e);s.stat(t,(e,i)=>{if(e)return o(e);if(!i||!i.isFile())return o(new Error(`The file could not be found: ${t}`));s.readFile(t,(e,t)=>{e?o(e):n(t)});return null})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(e){return e instanceof d||e instanceof f?e.identifier:"string"==typeof e?this.client.emojis.has(e)?this.client.emojis.get(e).identifier:e.includes("%")?e:encodeURIComponent(e):null}static resolveColor(e){if("string"==typeof e){if("RANDOM"===e)return Math.floor(16777216*Math.random());e=o.Colors[e]||parseInt(e.replace("#",""),16)}else e instanceof Array&&(e=(e[0]<<16)+(e[1]<<8)+e[2]);if(e<0||e>16777215)throw new RangeError("Color must be within the range 0 - 16777215 (0xFFFFFF).");if(e&&isNaN(e))throw new TypeError("Unable to convert color to a number.");return e}resolveColor(e){return this.constructor.resolveColor(e)}}e.exports=m}).call(t,n(5).Buffer)},function(e,t){e.exports={name:"discord.js",version:"11.1.0",description:"A powerful library for interacting with the Discord API",main:"./src/index",types:"./typings/index.d.ts",scripts:{test:"npm run lint && npm run docs:test",docs:"docgen --source src --custom docs/index.yml --output docs/docs.json","docs:test":"docgen --source src --custom docs/index.yml",lint:"eslint src","lint:fix":"eslint --fix src",webpack:"parallel-webpack"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",runkitExampleFilename:"./docs/examples/ping.js",dependencies:{long:"^3.2.0","prism-media":"^0.0.1",snekfetch:"^3.1.0",tweetnacl:"^0.14.0",ws:"^2.0.0"},peerDependencies:{bufferutil:"^2.0.0",erlpack:"hammerandchisel/erlpack","node-opus":"^0.2.5",opusscript:"^0.0.3",sodium:"^2.0.1","libsodium-wrappers":"^0.5.1"},devDependencies:{"@types/node":"^7.0.0","discord.js-docgen":"hydrabolt/discord.js-docgen",eslint:"^3.19.0","parallel-webpack":"^1.6.0","uglify-js":"mishoo/UglifyJS2#harmony",webpack:"^2.2.0"},engines:{node:">=6.0.0"},browser:{ws:!1,uws:!1,erlpack:!1,"prism-media":!1,opusscript:!1,"node-opus":!1,tweetnacl:!1,sodium:!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/Secretbox.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/util/VolumeInterface.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceBroadcast.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(e,t,n){const i=n(16),s=n(3),r=n(42),o=n(0);class a extends i{setup(e){super.setup(e),this.verified=e.verified,this.email=e.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s,this.premium="boolean"==typeof e.premium?e.premium:null,this.mfaEnabled="boolean"==typeof e.mfa_enabled?e.mfa_enabled:null,this.mobile="boolean"==typeof e.mobile?e.mobile:null,e.user_settings&&(this.settings=new r(this,e.user_settings))}edit(e){return this.client.rest.methods.updateCurrentUser(e)}setUsername(e,t){return this.client.rest.methods.updateCurrentUser({username:e},t)}setEmail(e,t){return this.client.rest.methods.updateCurrentUser({email:e},t)}setPassword(e,t){return this.client.rest.methods.updateCurrentUser({password:e},t)}setAvatar(e){return"string"==typeof e&&e.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:e}):this.client.resolver.resolveBuffer(e).then(e=>this.client.rest.methods.updateCurrentUser({avatar:e}))}setPresence(e){return new Promise(t=>{let n=this.localPresence.status||this.presence.status;let i=this.localPresence.game;let s=this.localPresence.afk||this.presence.afk;!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url});if(e.status){if("string"!=typeof e.status)throw new TypeError("Status must be a string");this.bot?n=e.status:(this.settings.update(o.UserSettingsMap.status,e.status),n="invisible")}e.game?(i=e.game,i.url&&(i.type=1)):void 0!==e.game&&(i=null);void 0!==e.afk&&(s=e.afk);s=Boolean(s);this.localPresence={status:n,game:i,afk:s};this.localPresence.since=0;this.localPresence.game=this.localPresence.game||null;this.client.ws.send({op:3,d:this.localPresence});this.client._setPresence(this.id,this.localPresence);t(this)})}setStatus(e){return this.setPresence({status:e})}setGame(e,t){return e?this.setPresence({game:{name:e,url:t}}):this.setPresence({game:null})}setAFK(e){return this.setPresence({afk:e})}fetchMentions(e={limit:25,roles:!0,everyone:!0,guild:null}){return this.client.rest.methods.fetchMentions(e)}addFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.addFriend(e)}removeFriend(e){return e=this.client.resolver.resolveUser(e),this.client.rest.methods.removeFriend(e)}createGuild(e,t,n=null){return n?"string"==typeof n&&n.startsWith("data:")?this.client.rest.methods.createGuild({name:e,icon:n,region:t}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:e,icon:n,region:t})):this.client.rest.methods.createGuild({name:e,icon:n,region:t})}createGroupDM(e){return this.client.rest.methods.createGroupDM({recipients:e.map(e=>this.client.resolver.resolveUserID(e.user)),accessTokens:e.map(e=>e.accessToken),nicks:e.map(e=>e.nick)})}acceptInvite(e){return this.client.rest.methods.acceptInvite(e)}}e.exports=a},function(e,t,n){const i=n(0),s=n(4);class r{constructor(e,t){this.user=e,this.patch(t)}patch(e){for(const t of Object.keys(i.UserSettingsMap)){const n=i.UserSettingsMap[t];e.hasOwnProperty(t)&&("function"==typeof n?this[n.name]=n(e[t]):this[n]=e[t])}}update(e,t){return this.user.client.rest.methods.patchUserSettings({[e]:t})}setGuildPosition(e,t,n){const i=Object.assign([],this.guildPositions);return s.moveElementInArray(i,e.id,t,n),this.update("guild_positions",i).then(()=>e)}addRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds);return t.includes(e.id)?Promise.reject(new Error("Guild is already restricted")):(t.push(e.id),this.update("restricted_guilds",t).then(()=>e))}removeRestrictedGuild(e){const t=Object.assign([],this.restrictedGuilds),n=t.indexOf(e.id);return n<0?Promise.reject(new Error("Guild is not restricted")):(t.splice(n,1),this.update("restricted_guilds",t).then(()=>e))}}e.exports=r},function(e,t,n){const i=n(14),s=n(23),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="dm",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.recipient=this.client.dataManager.newUser(e.recipients[0]),this.lastMessageID=e.last_message_id}toString(){return this.recipient.toString()}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0,["bulkDelete"]),e.exports=o},function(e,t,n){const i=n(51),s=n(52),r=n(0);class o{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.guild=this.client.guilds.get(e.guild.id)||new i(this.client,e.guild),this.code=e.code,this.temporary=e.temporary,this.maxAge=e.max_age,this.uses=e.uses,this.maxUses=e.max_uses,e.inviter&&(this.inviter=this.client.dataManager.newUser(e.inviter)),this.channel=this.client.channels.get(e.channel.id)||new s(this.client,e.channel),this.createdTimestamp=new Date(e.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return r.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}e.exports=o},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){this.id=e.id,this.filename=e.filename,this.filesize=e.size,this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}e.exports=n},function(e,t,n){const i=n(32),s=n(22);class r extends i{constructor(e,t,n={}){super(e.client,t,n),this.channel=e,this.received=0,this.client.on("message",this.listener),this.options.max&&(this.options.maxProcessed=this.options.max),this.options.maxMatches&&(this.options.max=this.options.maxMatches),this._reEmitter=(e=>{this.emit("message",e)}),this.on("collect",this._reEmitter)}on(e,t){"message"===e&&(t=s.deprecate(t,'MessageCollector will soon no longer emit "message", use "collect" instead')),super.on(e,t)}handle(e){return e.channel.id!==this.channel.id?null:(this.received++,{key:e.id,value:e})}postCheck(){return this.options.maxMatches&&this.collected.size>=this.options.max?"matchesLimit":this.options.max&&this.received>=this.options.maxProcessed?"limit":null}cleanup(){this.removeListener("collect",this._reEmitter),this.client.removeListener("message",this.listener)}}e.exports=r},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e.client}),this.message=e,this.setup(t)}setup(e){if(this.type=e.type,this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.fields=[],e.fields)for(const t of e.fields)this.fields.push(new c(this,t));this.createdTimestamp=e.timestamp,this.thumbnail=e.thumbnail?new i(this,e.thumbnail):null,this.image=e.image?new s(this,e.image):null,this.video=e.video?new r(this,e.video):null,this.author=e.author?new a(this,e.author):null,this.provider=e.provider?new o(this,e.provider):null,this.footer=e.footer?new u(this,e.footer):null}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let e=this.color.toString(16);for(;e.length<6;)e=`0${e}`;return`#${e}`}}class i{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class s{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.proxyURL=e.proxy_url,this.height=e.height,this.width=e.width}}class r{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.url=e.url,this.height=e.height,this.width=e.width}}class o{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url}}class a{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.url=e.url,this.iconURL=e.icon_url}}class c{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.name=e.name,this.value=e.value,this.inline=e.inline}}class u{constructor(e,t){this.embed=e,this.setup(t)}setup(e){this.text=e.text,this.iconURL=e.icon_url,this.proxyIconUrl=e.proxy_icon_url}}n.Thumbnail=i,n.Image=s,n.Video=r,n.Provider=o,n.Author=a,n.Field=c,n.Footer=u,e.exports=n},function(e,t,n){const i=n(3);class s{constructor(e,t,n,s){if(this.everyone=Boolean(s),t)if(t instanceof i)this.users=new i(t);else{this.users=new i;for(const n of t){let t=e.client.users.get(n.id);t||(t=e.client.dataManager.newUser(n)),this.users.set(t.id,t)}}else this.users=new i;if(n)if(n instanceof i)this.roles=new i(n);else{this.roles=new i;for(const t of n){const n=e.channel.guild.roles.get(t);n&&this.roles.set(n.id,n)}}else this.roles=new i;this._content=e.content,this._client=e.client,this._guild=e.channel.guild,this._members=null,this._channels=null}get members(){return this._members?this._members:this._guild?(this._members=new i,this.users.forEach(e=>{const t=this._guild.member(e);t&&this._members.set(t.user.id,t)}),this._members):null}get channels(){if(this._channels)return this._channels;this._channels=new i;let e;for(;null!==(e=this.constructor.CHANNELS_PATTERN.exec(this._content));){const t=this._client.channels.get(e[1]);t&&this._channels.set(t.id,t)}return this._channels}}s.EVERYONE_PATTERN=/@(everyone|here)/g,s.USERS_PATTERN=/<@!?[0-9]+>/g,s.ROLES_PATTERN=/<@&[0-9]+>/g,s.CHANNELS_PATTERN=/<#([0-9]+)>/g,e.exports=s},function(e,t,n){const i=n(3),s=n(17),r=n(30);class o{constructor(e,t,n,s){this.message=e,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,t.name,t.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const e=this.message.client.emojis;if(e.has(this._emoji.id)){const t=e.get(this._emoji.id);return this._emoji=t,t}}return this._emoji}remove(e=this.message.client.user){const t=this.message,n=this.message.client.resolver.resolveUserID(e);return n?t.client.rest.methods.removeMessageReaction(t,this.emoji.identifier,n):Promise.reject(new Error("Couldn't resolve the user ID to remove from the reaction."))}fetchUsers(e=100){const t=this.message;return t.client.rest.methods.getMessageReactionUsers(t,this.emoji.identifier,e).then(e=>{this.users=new i;for(const t of e){const e=this.message.client.dataManager.newUser(t);this.users.set(e.id,e)}this.count=this.users.size;return this.users})}}e.exports=o},function(e,t,n){const i=n(7);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.description=e.description,this.icon=e.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=e.rpc_origins,this.redirectURIs=e.redirect_uris,this.botRequireCodeGrant=e.bot_require_code_grant,this.botPublic=e.bot_public,this.rpcApplicationState=e.rpc_application_state,this.bot=e.bot,this.flags=e.flags,this.secret=e.secret}get createdTimestamp(){return i.deconstruct(this.id).timestamp}get createdAt(){return new Date(this.createdTimestamp)}reset(){return this.client.rest.methods.resetApplication(this.id)}toString(){return this.name}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.icon=e.icon,this.splash=e.splash}}e.exports=n},function(e,t,n){const i=n(0);class s{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this.setup(t)}setup(e){this.id=e.id,this.name=e.name,this.type=i.ChannelTypes.TEXT===e.type?"text":"voice"}}e.exports=s},function(e,t){class n{constructor(e,t){Object.defineProperty(this,"channel",{value:e}),t&&this.setup(t)}setup(e){this.id=e.id,this.type=e.type,this.deny=e.deny,this.allow=e.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}e.exports=n},function(e,t,n){const i=n(32),s=n(3);class r extends i{constructor(e,t,n={}){super(e.client,t,n),this.message=e,this.users=new s,this.total=0,this.client.on("messageReactionAdd",this.listener)}handle(e){return e.message.id!==this.message.id?null:{key:e.emoji.id||e.emoji.name,value:e}}postCheck(e,t){return this.users.set(t.id,t),this.options.max&&++this.total>=this.options.max?"limit":this.options.maxEmojis&&this.collected.size>=this.options.maxEmojis?"emojiLimit":this.options.maxUsers&&this.users.size>=this.options.maxUsers?"userLimit":null}cleanup(){this.client.removeListener("messageReactionAdd",this.listener)}}e.exports=r},function(e,t,n){const i=n(26),s=n(23),r=n(3);class o extends i{constructor(e,t){super(e,t),this.type="text",this.messages=new r,this._typing=new Map}setup(e){super.setup(e),this.topic=e.topic,this.lastMessageID=e.last_message_id}get members(){const e=new r;for(const t of this.guild.members.values())this.permissionsFor(t).hasPermission("READ_MESSAGES")&&e.set(t.id,t);return e}get nsfw(){return/^nsfw(-|$)/.test(this.name)}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(e,t){return new Promise(n=>{"string"==typeof t&&t.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,e,t)):this.client.resolver.resolveBuffer(t).then(t=>n(this.client.rest.methods.createWebhook(this,e,t)))})}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendFiles(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}search(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}createMessageCollector(){}awaitMessages(){}bulkDelete(){}acknowledge(){}_cacheMessage(){}}s.applyToClass(o,!0),e.exports=o},function(e,t,n){const i=n(26),s=n(3);class r extends i{constructor(e,t){super(e,t),this.members=new s,this.type="voice"}setup(e){super.setup(e),this.bitrate=e.bitrate,this.userLimit=e.user_limit}get connection(){const e=this.guild.voiceConnection;return e&&e.channel.id===this.id?e:null}get full(){return this.userLimit>0&&this.members.size>=this.userLimit}get joinable(){return!this.client.browser&&(!!this.permissionsFor(this.client.user).hasPermission("CONNECT")&&!(this.full&&!this.permissionsFor(this.client.user).hasPermission("MOVE_MEMBERS")))}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(e){return this.edit({bitrate:e})}setUserLimit(e){return this.edit({userLimit:e})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const e=this.client.voice.connections.get(this.guild.id);e&&e.channel.id===this.id&&e.disconnect()}}}e.exports=r},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t){function i(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?M(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function s(e,t){S=S||n(13),e=e||{},this.objectMode=!!e.objectMode,t instanceof S&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.buffer=new G,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(j||(j=n(65).StringDecoder),this.decoder=new j(e.encoding),this.encoding=e.encoding)}function r(e){if(S=S||n(13),!(this instanceof r))return new r(e);this._readableState=new s(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),I.call(this)}function o(e,t,n,i,s){var r=l(t,n);if(r)e.emit("error",r);else if(null===n)t.reading=!1,h(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!s){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(t.endEmitted&&s){var c=new Error("stream.unshift() after end event");e.emit("error",c)}else{var u;!t.decoder||s||i||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),s||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,s?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&p(e))),f(e,t)}else s||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length=B?e=B:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function u(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=c(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function l(e,t){var n=null;return L.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,p(e)}}function p(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?D(d,e):d(e))}function d(e){P("emit readable"),e.emit("readable"),w(e)}function f(e,t){t.readingMore||(t.readingMore=!0,D(m,e,t))}function m(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=_(e,t.buffer,t.decoder),n}function _(e,t,n){var i;return er.length?r.length:e;if(o===r.length?s+=r:s+=r.slice(0,e),0===(e-=o)){o===r.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=r.slice(o));break}++i}return t.length-=i,s}function A(e,t){var n=U.allocUnsafe(e),i=t.head,s=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(n,n.length-e,0,o),0===(e-=o)){o===r.length?(++s,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=r.slice(o));break}++s}return t.length-=s,n}function R(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,D(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function k(e,t){for(var n=0,i=e.length;n=t.highWaterMark||t.ended))return P("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):p(this),null;if(0===(e=u(e,t))&&t.ended)return 0===t.length&&R(this),null;var i=t.needReadable;P("need readable",i),(0===t.length||t.length-e0?y(e,t):null,null===s?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&R(this)),null!==s&&this.emit("data",s),s},r.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},r.prototype.pipe=function(e,n){function s(e){P("onunpipe"),e===p&&o()}function r(){P("onend"),e.end()}function o(){P("cleanup"),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("drain",v),e.removeListener("error",c),e.removeListener("unpipe",s),p.removeListener("end",r),p.removeListener("end",o),p.removeListener("data",a),E=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function a(t){P("ondata"),b=!1,!1!==e.write(t)||b||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==k(d.pipes,e))&&!E&&(P("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,b=!0),p.pause())}function c(t){P("onerror",t),h(),e.removeListener("error",c),0===C(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",l),h()}function l(){P("onfinish"),e.removeListener("close",u),h()}function h(){P("unpipe"),p.unpipe(e)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,P("pipe count=%d opts=%j",d.pipesCount,n);var f=(!n||!1!==n.end)&&e!==t.stdout&&e!==t.stderr,m=f?r:o;d.endEmitted?D(m):p.once("end",m),e.on("unpipe",s);var v=g(p);e.on("drain",v);var E=!1,b=!1;return p.on("data",a),i(e,"error",c),e.once("close",u),e.once("finish",l),e.emit("pipe",p),d.flowing||(P("pipe resume"),p.resume()),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(f),g=["%","/","?",";","#"].concat(m),v=["/","?","#"],E={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(36);i.prototype.parse=function(e,t,n){if(!u.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i127?C+="x":C+=M[I];if(!C.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var U=S.slice(0,x),O=S.slice(x+1),N=M.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);N&&(U.push(N[1]),O.unshift(N[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=c.toASCII(this.hostname));var P=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+P,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!E[d])for(var x=0,D=m.length;x0)&&n.host.split("@");R&&(n.auth=R.shift(),n.host=n.hostname=R.shift())}return n.search=e.search,n.query=e.query,u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!x.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var T=x.slice(-1)[0],k=(n.host||e.host||x.length>1)&&("."===T||".."===T)||""===T,S=0,D=x.length;D>=0;D--)T=x[D],"."===T?x.splice(D,1):".."===T?(x.splice(D,1),S++):S&&(x.splice(D,1),S--);if(!y&&!_)for(;S--;S)x.unshift("..");!y||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),k&&"/"!==x.join("/").substr(-1)&&x.push("");var M=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(A){n.hostname=n.host=M?"":x.length?x.shift():"";var R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");R&&(n.auth=R.shift(),n.host=n.hostname=R.shift())}return y=y||n.host&&x.length,y&&!M&&x.unshift(""),x.length?n.pathname=x.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=h.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){function i(e){if(e&&!c(e))throw new Error("Unknown encoding: "+e)}function s(e){return e.toString(this.encoding)}function r(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=n(5).Buffer,c=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=t.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),i(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=s)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,s),s-=this.charReceived),t+=e.toString(this.encoding,0,s);var s=t.length-1,i=t.charCodeAt(s);if(i>=55296&&i<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),e.copy(this.charBuffer,0,0,r),t.substring(0,s)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,i=this.charBuffer,s=this.encoding;t+=i.slice(0,n).toString(s)}return t}},function(e,t){class n extends Error{constructor(e){super();const t=e.errors?` ${this.constructor.flattenErrors(e.errors).join("\n")}`:"";this.name="DiscordAPIError",this.message=`${e.message}${t}`,this.code=e.code}static flattenErrors(e,t=""){let n=[];for(const i of Object.keys(e)){const s=t?isNaN(i)?`${t}.${i}`:`${t}[${i}]`:i;e[i]._errors?n.push(`${s}: ${e[i]._errors.map(e=>e.message).join(" ")}`):n=n.concat(this.flattenErrors(e[i],s))}return n}}e.exports=n},function(e,t,n){const i=n(141),s=n(138),r=n(140),o=n(139),a=n(137),c=n(0);class u{constructor(e){this.client=e,this.handlers={},this.userAgentManager=new i(this),this.methods=new s(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}destroy(){for(const e in this.handlers)this.handlers[e].destroy()}push(e,t){return new Promise((n,i)=>{e.push({request:t,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return r;case"burst":return o;default:throw new Error(c.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(e,t,n,i,s){const r=new a(this,e,t,n,i,s);if(!this.handlers[r.route]){const e=this.getRequestHandler();this.handlers[r.route]=new e(this,r.route)}return this.push(this.handlers[r.route],r)}}e.exports=u},function(e,t){class n{constructor(e){this.restManager=e,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(e){this.restManager.globallyRateLimited=e}push(e){this.queue.push(e)}handle(){}destroy(){this.queue=[]}}e.exports=n},function(e,t,n){(function(t){const i="browser"===n(24).platform(),s=n(12),r=n(0),o=n(28),a=n(143),c=function(){try{const e=n(189);return e.pack?e:null}catch(e){return null}}(),u=function(){if(i)return window.WebSocket;try{return n(190)}catch(e){return n(191)}}();class l extends s{constructor(e,t){super(),this.manager=e,this.client=e.client,this.ws=null,this.sequence=-1,this.status=r.Status.IDLE,this.packetManager=new a(this),this.lastPingTimestamp=0,this.ratelimit={queue:[],remaining:120,resetTime:-1},this.connect(t),this.disabledEvents={},this.closeSequence=0;for(const e of this.client.options.disabledEvents)this.disabledEvents[e]=!0}triggerReady(){if(this.status===r.Status.READY)return void this.debug("Tried to mark self as ready, but already ready");this.status=r.Status.READY,this.client.emit(r.Events.READY),this.packetManager.handleQueue()}checkIfReady(){if(this.status===r.Status.READY||this.status===r.Status.NEARLY)return!1;let e=0;for(const t of this.client.guilds.values())t.available||e++;if(0===e){if(this.status=r.Status.NEARLY,!this.client.options.fetchAllMembers)return this.triggerReady();const e=this.client.guilds.map(e=>e.fetchMembers());Promise.all(e).then(()=>this.triggerReady()).catch(e=>{this.debug(`Failed to fetch all members before ready! ${e}`);this.triggerReady()})}return!0}debug(e){return e instanceof Error&&(e=e.stack),this.manager.debug(`[connection] ${e}`)}unpack(e){return c&&"string"!=typeof e?(e instanceof ArrayBuffer&&(e=t.from(new Uint8Array(e))),c.unpack(e)):((e instanceof ArrayBuffer||e instanceof t)&&(e=o.inflateSync(e).toString()),JSON.parse(e))}pack(e){return c?c.pack(e):JSON.stringify(e)}processQueue(){if(0!==this.ratelimit.remaining&&0!==this.ratelimit.queue.length)for(120===this.ratelimit.remaining&&(this.ratelimit.resetTimer=setTimeout(()=>{this.ratelimit.remaining=120;this.processQueue()},12e4));this.ratelimit.remaining>0;){const e=this.ratelimit.queue.shift();if(!e)return;this._send(e),this.ratelimit.remaining--}}_send(e){if(!this.ws||this.ws.readyState!==u.OPEN)return void this.debug(`Tried to send packet ${e} but no WebSocket is available!`);this.ws.send(this.pack(e))}send(e){if(!this.ws||this.ws.readyState!==u.OPEN)return void this.debug(`Tried to send packet ${e} but no WebSocket is available!`);this.ratelimit.queue.push(e),this.processQueue()}connect(e=this.gateway,t=0,n=!1){if(t)return this.client.setTimeout(()=>this.connect(e,0,n),t);if(this.ws&&!n)return this.debug("WebSocket connection already exists"),!1;if("string"!=typeof e)return this.debug(`Tried to connect to an invalid gateway: ${e}`),!1;this.gateway=e,this.debug(`Connecting to ${e}`);const s=this.ws=new u(e);return i&&(s.binaryType="arraybuffer"),s.onmessage=this.onMessage.bind(this),s.onopen=this.onOpen.bind(this),s.onerror=this.onError.bind(this),s.onclose=this.onClose.bind(this),this.status=r.Status.CONNECTING,!0}destroy(){const e=this.ws;return e?(this.heartbeat(-1),e.close(1e3),this.packetManager.handleQueue(),this.ws=null,this.status=r.Status.DISCONNECTED,!0):(this.debug("Attempted to destroy WebSocket but no connection exists!"),!1)}onMessage(e){try{return this.onPacket(this.unpack(e.data)),!0}catch(e){return this.debug(e),!1}}setSequence(e){this.sequence=e>this.sequence?e:this.sequence}onPacket(e){if(!e)return this.debug("Received null packet"),!1;switch(this.client.emit("raw",e),e.op){case r.OPCodes.HELLO:return this.heartbeat(e.d.heartbeat_interval);case r.OPCodes.RECONNECT:return this.reconnect();case r.OPCodes.INVALID_SESSION:return e.d||(this.sessionID=null),this.debug("Session invalidated -- will identify with a new session"),this.identify(e.d?2500:0);case r.OPCodes.HEARTBEAT_ACK:return this.ackHeartbeat();case r.OPCodes.HEARTBEAT:return this.heartbeat();default:return this.packetManager.handle(e)}}onOpen(e){this.gateway=e.target.url,this.debug(`Connected to gateway ${this.gateway}`),this.identify()}reconnect(){this.debug("Attemping to reconnect in 5500ms..."),this.client.emit(r.Events.RECONNECTING),this.connect(this.gateway,5500,!0)}onError(e){this.client.emit(r.Events.ERROR,e)}onClose(e){if(this.debug(`Closed: ${e.code}`),this.closeSequence=this.sequence,this.emit("close",e),this.heartbeat(-1),r.WSCodes[e.code])return this.debug(r.WSCodes[e.code]),void this.destroy();this.reconnect()}ackHeartbeat(){this.debug(`Heartbeat acknowledged, latency of ${Date.now()-this.lastPingTimestamp}ms`),this.client._pong(this.lastPingTimestamp)}heartbeat(e){if(!isNaN(e))return void(-1===e?(this.debug("Clearing heartbeat interval"),this.client.clearInterval(this.heartbeatInterval),this.heartbeatInterval=null):(this.debug(`Setting a heartbeat interval for ${e}ms`),this.heartbeatInterval=this.client.setInterval(()=>this.heartbeat(),e)));this.debug("Sending a heartbeat"),this.lastPingTimestamp=Date.now(),this.send({op:r.OPCodes.HEARTBEAT,d:this.sequence})}identify(e){return e?this.client.setTimeout(this.identify.apply(this),e):this.sessionID?this.identifyResume():this.identifyNew()}identifyNew(){if(!this.client.token)return void this.debug("No token available to identify a new session with");const e=Object.assign({token:this.client.token},this.client.options.ws),{shardId:shardId,shardCount:shardCount}=this.client.options;shardCount>0&&(e.shard=[Number(shardId),Number(shardCount)]),this.debug("Identifying as a new session"),this.send({op:r.OPCodes.IDENTIFY,d:e})}identifyResume(){if(!this.sessionID)return this.debug("Warning: wanted to resume but session ID not available; identifying as a new session instead"),this.identifyNew();this.debug(`Attempting to resume session ${this.sessionID}`);const e={token:this.client.token,session_id:this.sessionID,seq:this.sequence};return this.send({op:r.OPCodes.RESUME,d:e})}}l.ENCODING=c?"etf":"json",l.WebSocket=u,e.exports=l}).call(t,n(5).Buffer)},function(module,exports,__webpack_require__){(function(process){const os=__webpack_require__(24),EventEmitter=__webpack_require__(12).EventEmitter,Constants=__webpack_require__(0),Permissions=__webpack_require__(9),Util=__webpack_require__(4),RESTManager=__webpack_require__(67),ClientDataManager=__webpack_require__(106),ClientManager=__webpack_require__(107),ClientDataResolver=__webpack_require__(39),ClientVoiceManager=__webpack_require__(187),WebSocketManager=__webpack_require__(142),ActionsManager=__webpack_require__(108),Collection=__webpack_require__(3),Presence=__webpack_require__(11).Presence,ShardClientUtil=__webpack_require__(186),VoiceBroadcast=__webpack_require__(188);class Client extends EventEmitter{constructor(e={}){super(),!e.shardId&&"SHARD_ID"in process.env&&(e.shardId=Number(process.env.SHARD_ID)),!e.shardCount&&"SHARD_COUNT"in process.env&&(e.shardCount=Number(process.env.SHARD_COUNT)),this.options=Util.mergeDefault(Constants.DefaultOptions,e),this._validateOptions(),this.rest=new RESTManager(this),this.dataManager=new ClientDataManager(this),this.manager=new ClientManager(this),this.ws=new WebSocketManager(this),this.resolver=new ClientDataResolver(this),this.actions=new ActionsManager(this),this.voice=this.browser?null:new ClientVoiceManager(this),this.shard=process.send?ShardClientUtil.singleton(this):null,this.users=new Collection,this.guilds=new Collection,this.channels=new Collection,this.presences=new Collection,!this.token&&"CLIENT_TOKEN"in process.env?this.token=process.env.CLIENT_TOKEN:this.token=null,this.user=null,this.readyAt=null,this.broadcasts=[],this.pings=[],this._timeouts=new Set,this._intervals=new Set,this.options.messageSweepInterval>0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get _pingTimestamp(){return this.ws.connection?this.ws.connection.lastPingTimestamp:0}get status(){return this.ws.connection.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get ping(){return this.pings.reduce((e,t)=>e+t,0)/this.pings.length}get voiceConnections(){return this.browser?new Collection:this.voice.connections}get emojis(){const e=new Collection;for(const t of this.guilds.values())for(const n of t.emojis.values())e.set(n.id,n);return e}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}get browser(){return"browser"===os.platform()}createVoiceBroadcast(){const e=new VoiceBroadcast(this);return this.broadcasts.push(e),e}login(e){return this.rest.methods.login(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const e of this._intervals)clearInterval(e);return this._timeouts.clear(),this._intervals.clear(),this.manager.destroy()}syncGuilds(e=this.guilds){this.user.bot||this.ws.send({op:12,d:e instanceof Collection?e.keyArray():e.map(e=>e.id)})}fetchUser(e,t=!0){return this.users.has(e)?Promise.resolve(this.users.get(e)):this.rest.methods.getUser(e,t)}fetchInvite(e){const t=this.resolver.resolveInviteCode(e);return this.rest.methods.getInvite(t)}fetchWebhook(e,t){return this.rest.methods.getWebhook(e,t)}fetchVoiceRegions(){return this.rest.methods.fetchVoiceRegions()}sweepMessages(e=this.options.messageCacheLifetime){if("number"!=typeof e||isNaN(e))throw new TypeError("The lifetime must be a number.");if(e<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const t=1e3*e,n=Date.now();let i=0,s=0;for(const e of this.channels.values())if(e.messages){i++;for(const i of e.messages.values())n-(i.editedTimestamp||i.createdTimestamp)>t&&(e.messages.delete(i.id),s++)}return this.emit("debug",`Swept ${s} messages older than ${e} seconds in ${i} text-based channels`),s}fetchApplication(e="@me"){return this.rest.methods.getApplication(e)}generateInvite(e){return e?e instanceof Array&&(e=Permissions.resolve(e)):e=0,this.fetchApplication().then(t=>`https://discordapp.com/oauth2/authorize?client_id=${t.id}&permissions=${e}&scope=bot`)}setTimeout(e,t,...n){const i=setTimeout(()=>{e();this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}_pong(e){this.pings.unshift(Date.now()-e),this.pings.length>3&&(this.pings.length=3),this.ws.lastHeartbeatAck=!0}_setPresence(e,t){if(this.presences.has(e))return void this.presences.get(e).update(t);this.presences.set(e,new Presence(t))}_eval(script){return eval(script)}_validateOptions(e=this.options){if("number"!=typeof e.shardCount||isNaN(e.shardCount))throw new TypeError("The shardCount option must be a number.");if("number"!=typeof e.shardId||isNaN(e.shardId))throw new TypeError("The shardId option must be a number.");if(e.shardCount<0)throw new RangeError("The shardCount option must be at least 0.");if(e.shardId<0)throw new RangeError("The shardId option must be at least 0.");if(0!==e.shardId&&e.shardId>=e.shardCount)throw new RangeError("The shardId option must be less than shardCount.");if("number"!=typeof e.messageCacheMaxSize||isNaN(e.messageCacheMaxSize))throw new TypeError("The messageCacheMaxSize option must be a number.");if("number"!=typeof e.messageCacheLifetime||isNaN(e.messageCacheLifetime))throw new TypeError("The messageCacheLifetime option must be a number.");if("number"!=typeof e.messageSweepInterval||isNaN(e.messageSweepInterval))throw new TypeError("The messageSweepInterval option must be a number.");if("boolean"!=typeof e.fetchAllMembers)throw new TypeError("The fetchAllMembers option must be a boolean.");if("boolean"!=typeof e.disableEveryone)throw new TypeError("The disableEveryone option must be a boolean.");if("number"!=typeof e.restWsBridgeTimeout||isNaN(e.restWsBridgeTimeout))throw new TypeError("The restWsBridgeTimeout option must be a number.");if(!(e.disabledEvents instanceof Array))throw new TypeError("The disabledEvents option must be an Array.")}}module.exports=Client}).call(exports,__webpack_require__(6))},function(e,t,n){const i=n(31),s=n(67),r=n(39),o=n(0),a=n(4);class c extends i{constructor(e,t,n){super(null,e,t),this.options=a.mergeDefault(o.DefaultOptions,n),this.rest=new s(this),this.resolver=new r(this),this._timeouts=new Set,this._intervals=new Set}setTimeout(e,t,...n){const i=setTimeout(()=>{e();this._timeouts.delete(i)},t,...n);return this._timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this._timeouts.delete(e)}setInterval(e,t,...n){const i=setInterval(e,t,...n);return this._intervals.add(i),i}clearInterval(e){clearInterval(e),this._intervals.delete(e)}destroy(){for(const e of this._timeouts)clearTimeout(e);for(const e of this._intervals)clearInterval(e);this._timeouts.clear(),this._intervals.clear()}}e.exports=c},function(e,t,n){function i(e){return"string"==typeof e?e:e instanceof Array?e.join("\n"):String(e)}const s=n(39);class r{constructor(e={}){this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.author=e.author,this.timestamp=e.timestamp,this.fields=e.fields||[],this.thumbnail=e.thumbnail,this.image=e.image,this.footer=e.footer,this.file=e.file}setTitle(e){if(e=i(e),e.length>256)throw new RangeError("RichEmbed titles may not exceed 256 characters.");return this.title=e,this}setDescription(e){if(e=i(e),e.length>2048)throw new RangeError("RichEmbed descriptions may not exceed 2048 characters.");return this.description=e,this}setURL(e){return this.url=e,this}setColor(e){return this.color=s.resolveColor(e),this}setAuthor(e,t,n){return this.author={name:i(e),icon_url:t,url:n},this}setTimestamp(e=new Date){return this.timestamp=e,this}addField(e,t,n=!1){if(this.fields.length>=25)throw new RangeError("RichEmbeds may not exceed 25 fields.");if(e=i(e),e.length>256)throw new RangeError("RichEmbed field names may not exceed 256 characters.");if(!/\S/.test(e))throw new RangeError("RichEmbed field names may not be empty.");if(t=i(t),t.length>1024)throw new RangeError("RichEmbed field values may not exceed 1024 characters.");if(!/\S/.test(t))throw new RangeError("RichEmbed field values may not be empty.");return this.fields.push({name:e,value:t,inline:n}),this}addBlankField(e=!1){return this.addField("​","​",e)}setThumbnail(e){return this.thumbnail={url:e},this}setImage(e){return this.image={url:e},this}setFooter(e,t){if(e=i(e),e.length>2048)throw new RangeError("RichEmbed footer text may not exceed 2048 characters.");return this.footer={text:e,icon_url:t},this}attachFile(e){if(this.file)throw new RangeError("You may not upload more than one file at once.");return this.file=e,this}}e.exports=r},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";function i(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function s(e){return 3*e.length/4-i(e)}function r(e){var t,n,s,r,o,a,c=e.length;o=i(e),a=new h(3*c/4-o),s=o>0?c-4:c;var u=0;for(t=0,n=0;t>16&255,a[u++]=r>>8&255,a[u++]=255&r;return 2===o?(r=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,a[u++]=255&r):1===o&&(r=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r),a}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function a(e,t,n){for(var i,s=[],r=t;rc?c:o+16383));return 1===i?(t=e[n-1],s+=u[t>>2],s+=u[t<<4&63],s+="=="):2===i&&(t=(e[n-2]<<8)+e[n-1],s+=u[t>>10],s+=u[t>>4&63],s+=u[t<<2&63],s+="="),r.push(s),r.join("")}t.byteLength=s,t.toByteArray=r,t.fromByteArray=c;for(var u=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=p.length;d>1,l=-7,h=n?s-1:0,p=n?-1:1,d=e[t+h];for(h+=p,r=d&(1<<-l)-1,d>>=-l,l+=a;l>0;r=256*r+e[t+h],h+=p,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=i;l>0;o=256*o+e[t+h],h+=p,l-=8);if(0===r)r=1-u;else{if(r===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),r-=u}return(d?-1:1)*o*Math.pow(2,r-i)},t.write=function(e,t,n,i,s,r){var o,a,c,u=8*r-s-1,l=(1<>1,p=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:r-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),t+=o+h>=1?p/c:p*Math.pow(2,1-h),t*c>=2&&(o++,c/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*c-1)*Math.pow(2,s),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,s),o=0));s>=8;e[n+d]=255&a,d+=f,a/=256,s-=8);for(o=o<0;e[n+d]=255&o,d+=f,o/=256,u-=8);e[n+d-f]|=128*m}},function(e,t,n){(function(e,i){var s;!function(r){function o(e){throw new RangeError(I[e])}function a(e,t){for(var n=e.length,i=[];n--;)i[n]=t(e[n]);return i}function c(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(C,"."),i+a(e.split("."),t).join(".")}function u(e){for(var t,n,i=[],s=0,r=e.length;s=55296&&t<=56319&&s65535&&(e-=65536,t+=O(e>>>10&1023|55296),e=56320|1023&e),t+=O(e)}).join("")}function h(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:y}function p(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function d(e,t,n){var i=0;for(e=n?U(e/R):e>>1,e+=U(e/t);e>L*x>>1;i+=y)e=U(e/L);return U(i+(L+1)*e/(e+A))}function f(e){var t,n,i,s,r,a,c,u,p,f,m=[],g=e.length,v=0,E=k,b=T;for(n=e.lastIndexOf(S),n<0&&(n=0),i=0;i=128&&o("not-basic"),m.push(e.charCodeAt(i));for(s=n>0?n+1:0;s=g&&o("invalid-input"),u=h(e.charCodeAt(s++)),(u>=y||u>U((w-v)/a))&&o("overflow"),v+=u*a,p=c<=b?_:c>=b+x?x:c-b,!(uU(w/f)&&o("overflow"),a*=f;t=m.length+1,b=d(v-r,t,0==r),U(v/t)>w-E&&o("overflow"),E+=U(v/t),v%=t,m.splice(v++,0,E)}return l(m)}function m(e){var t,n,i,s,r,a,c,l,h,f,m,g,v,E,b,A=[];for(e=u(e),g=e.length,t=k,n=0,r=T,a=0;a=t&&mU((w-n)/v)&&o("overflow"),n+=(c-t)*v,t=c,a=0;aw&&o("overflow"),m==t){for(l=n,h=y;f=h<=r?_:h>=r+x?x:h-r,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=y-_,U=Math.floor,O=String.fromCharCode;b={version:"1.4.1",ucs2:{decode:u,encode:l},decode:f,encode:m,toASCII:v,toUnicode:g},void 0!==(s=function(){return b}.call(t,n,t,e))&&(e.exports=s)}()}).call(t,n(104)(e),n(8))},function(e,t,n){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,r){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;e=e.split(t);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var u=0;u=0?(l=f.substr(0,m),h=f.substr(m+1)):(l=f,h=""),p=decodeURIComponent(l),d=decodeURIComponent(h),i(o,p)?s(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function i(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i0?this.tail.next=t:this.head=t,this.tail=t,++this.length},i.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},i.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},i.prototype.concat=function(e){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var t=s.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t}},function(e,t,n){e.exports=n(21).PassThrough},function(e,t,n){e.exports=n(21).Transform},function(e,t,n){e.exports=n(37)},function(e,t,n){(function(e,t){!function(e,n){"use strict";function i(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n=3.1.0 <4.0.0",type:"range"},"/home/travis/build/hydrabolt/discord.js"]],_from:"snekfetch@>=3.1.0 <4.0.0",_id:"snekfetch@3.1.2",_inCache:!0,_location:"/snekfetch",_nodeVersion:"7.9.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/snekfetch-3.1.2.tgz_1492882967312_0.8088863184675574"},_npmUser:{name:"crawl",email:"icrawltogo@gmail.com"},_npmVersion:"4.2.0",_phantomChildren:{},_requested:{raw:"snekfetch@^3.1.0",scope:null,escapedName:"snekfetch",name:"snekfetch",rawSpec:"^3.1.0",spec:">=3.1.0 <4.0.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz",_shasum:"3422a9191c1bb6610867db88e669db0b5adb7f42",_shrinkwrap:null,_spec:"snekfetch@^3.1.0",_where:"/home/travis/build/hydrabolt/discord.js",author:{name:"Gus Caplan",email:"me@gus.host"},bugs:{url:"https://github.com/GusCaplan/snekfetch/issues"},dependencies:{},description:"Just do http requests without all that weird nastiness from other libs",devDependencies:{},directories:{},dist:{shasum:"3422a9191c1bb6610867db88e669db0b5adb7f42",tarball:"https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz"},gitHead:"a79f6867d21ca58ffe6fc59eb77b06f257f8ad29",homepage:"https://github.com/GusCaplan/snekfetch#readme",license:"MIT",main:"index.js",maintainers:[{name:"crawl",email:"icrawltogo@gmail.com"},{name:"snek",email:"me@gus.host"}],name:"snekfetch",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/GusCaplan/snekfetch.git"},scripts:{},version:"3.1.2"}},function(e,t,n){(function(t){const i=n(27),s=n(93);class r{constructor(){this.boundary=`--snekfetch--${Math.random().toString().slice(2,7)}`,this.buffer=new t(0)}append(e,n,r){if(void 0!==n){let o=` --${this.boundary} Content-Disposition: form-data; name="${e}"`,a=null;if(r){o+=`; filename="${r}"`,a="application/octet-stream";const e=i.extname(r);e&&(a=s.lookup(e))}n instanceof t?a=s.buffer(n):"object"==typeof n?(a="application/json",n=t.from(JSON.stringify(n))):n=t.from(String(n)),a&&(o+=`