MOOver.js/node_modules/discord.js/webpack/discord.js
2020-10-30 22:52:39 +01:00

2 lines
No EOL
890 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see discord.js.LICENSE.txt */
!function webpackUniversalModuleDefinition(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Discord=n():e.Discord=n()}(window,(function(){return function(e){var n={};function __webpack_require__(t){if(n[t])return n[t].exports;var s=n[t]={i:t,l:!1,exports:{}};return e[t].call(s.exports,s,s.exports,__webpack_require__),s.l=!0,s.exports}return __webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,n,t){__webpack_require__.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,n){if(1&n&&(e=__webpack_require__(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(__webpack_require__.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var s in e)__webpack_require__.d(t,s,function(n){return e[n]}.bind(null,s));return t},__webpack_require__.n=function(e){var n=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s="./src/index.js")}({"./node_modules/@discordjs/collection/dist/index.js":function(module,exports,__webpack_require__){"use strict";eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Collection = void 0;\n/**\n * A Map with additional utility methods. This is used throughout discord.js rather than Arrays for anything that has\n * an ID, for significantly improved performance and ease-of-use.\n * @extends {Map}\n * @property {number} size - The amount of elements in this collection.\n */\nclass Collection extends Map {\n constructor(entries) {\n super(entries);\n /**\n * Cached array for the `array()` method - will be reset to `null` whenever `set()` or `delete()` are called\n * @name Collection#_array\n * @type {?Array}\n * @private\n */\n Object.defineProperty(this, '_array', { value: null, writable: true, configurable: true });\n /**\n * Cached array for the `keyArray()` method - will be reset to `null` whenever `set()` or `delete()` are called\n * @name Collection#_keyArray\n * @type {?Array}\n * @private\n */\n Object.defineProperty(this, '_keyArray', { value: null, writable: true, configurable: true });\n }\n /**\n * Identical to [Map.get()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get).\n * Gets an element with the specified key, and returns its value, or `undefined` if the element does not exist.\n * @param {*} key - The key to get from this collection\n * @returns {* | undefined}\n */\n get(key) {\n return super.get(key);\n }\n /**\n * Identical to [Map.set()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set).\n * Sets a new element in the collection with the specified key and value.\n * @param {*} key - The key of the element to add\n * @param {*} value - The value of the element to add\n * @returns {Collection}\n */\n set(key, value) {\n this._array = null;\n this._keyArray = null;\n return super.set(key, value);\n }\n /**\n * Identical to [Map.has()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has).\n * Checks if an element exists in the collection.\n * @param {*} key - The key of the element to check for\n * @returns {boolean} `true` if the element exists, `false` if it does not exist.\n */\n has(key) {\n return super.has(key);\n }\n /**\n * Identical to [Map.delete()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete).\n * Deletes an element from the collection.\n * @param {*} key - The key to delete from the collection\n * @returns {boolean} `true` if the element was removed, `false` if the element does not exist.\n */\n delete(key) {\n this._array = null;\n this._keyArray = null;\n return super.delete(key);\n }\n /**\n * Identical to [Map.clear()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear).\n * Removes all elements from the collection.\n * @returns {undefined}\n */\n clear() {\n return super.clear();\n }\n /**\n * Creates an ordered array of the values of this collection, and caches it internally. The array will only be\n * reconstructed if an item is added to or removed from the collection, or if you change the length of the array\n * itself. If you don't want this caching behavior, use `[...collection.values()]` or\n * `Array.from(collection.values())` instead.\n * @returns {Array}\n */\n array() {\n if (!this._array || this._array.length !== this.size)\n this._array = [...this.values()];\n return this._array;\n }\n /**\n * Creates an ordered array of the keys of this collection, and caches it internally. The array will only be\n * reconstructed if an item is added to or removed from the collection, or if you change the length of the array\n * itself. If you don't want this caching behavior, use `[...collection.keys()]` or\n * `Array.from(collection.keys())` instead.\n * @returns {Array}\n */\n keyArray() {\n if (!this._keyArray || this._keyArray.length !== this.size)\n this._keyArray = [...this.keys()];\n return this._keyArray;\n }\n first(amount) {\n if (typeof amount === 'undefined')\n return this.values().next().value;\n if (amount < 0)\n return this.last(amount * -1);\n amount = Math.min(this.size, amount);\n const iter = this.values();\n return Array.from({ length: amount }, () => iter.next().value);\n }\n firstKey(amount) {\n if (typeof amount === 'undefined')\n return this.keys().next().value;\n if (amount < 0)\n return this.lastKey(amount * -1);\n amount = Math.min(this.size, amount);\n const iter = this.keys();\n return Array.from({ length: amount }, () => iter.next().value);\n }\n last(amount) {\n const arr = this.array();\n if (typeof amount === 'undefined')\n return arr[arr.length - 1];\n if (amount < 0)\n return this.first(amount * -1);\n if (!amount)\n return [];\n return arr.slice(-amount);\n }\n lastKey(amount) {\n const arr = this.keyArray();\n if (typeof amount === 'undefined')\n return arr[arr.length - 1];\n if (amount < 0)\n return this.firstKey(amount * -1);\n if (!amount)\n return [];\n return arr.slice(-amount);\n }\n random(amount) {\n let arr = this.array();\n if (typeof amount === 'undefined')\n return arr[Math.floor(Math.random() * arr.length)];\n if (arr.length === 0 || !amount)\n return [];\n arr = arr.slice();\n return Array.from({ length: amount }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]);\n }\n randomKey(amount) {\n let arr = this.keyArray();\n if (typeof amount === 'undefined')\n return arr[Math.floor(Math.random() * arr.length)];\n if (arr.length === 0 || !amount)\n return [];\n arr = arr.slice();\n return Array.from({ length: amount }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]);\n }\n find(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n for (const [key, val] of this) {\n if (fn(val, key, this))\n return val;\n }\n return undefined;\n }\n findKey(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n for (const [key, val] of this) {\n if (fn(val, key, this))\n return key;\n }\n return undefined;\n }\n sweep(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n const previousSize = this.size;\n for (const [key, val] of this) {\n if (fn(val, key, this))\n this.delete(key);\n }\n return previousSize - this.size;\n }\n filter(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n const results = new this.constructor[Symbol.species]();\n for (const [key, val] of this) {\n if (fn(val, key, this))\n results.set(key, val);\n }\n return results;\n }\n partition(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n // TODO: consider removing the <K, V> from the constructors after TS 3.7.0 is released, as it infers it\n const results = [new this.constructor[Symbol.species](), new this.constructor[Symbol.species]()];\n for (const [key, val] of this) {\n if (fn(val, key, this)) {\n results[0].set(key, val);\n }\n else {\n results[1].set(key, val);\n }\n }\n return results;\n }\n flatMap(fn, thisArg) {\n const collections = this.map(fn, thisArg);\n return new this.constructor[Symbol.species]().concat(...collections);\n }\n map(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n const iter = this.entries();\n return Array.from({ length: this.size }, () => {\n const [key, value] = iter.next().value;\n return fn(value, key, this);\n });\n }\n mapValues(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n const coll = new this.constructor[Symbol.species]();\n for (const [key, val] of this)\n coll.set(key, fn(val, key, this));\n return coll;\n }\n some(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n for (const [key, val] of this) {\n if (fn(val, key, this))\n return true;\n }\n return false;\n }\n every(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n for (const [key, val] of this) {\n if (!fn(val, key, this))\n return false;\n }\n return true;\n }\n /**\n * Applies a function to produce a single value. Identical in behavior to\n * [Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).\n * @param {Function} fn Function used to reduce, taking four arguments; `accumulator`, `currentValue`, `currentKey`,\n * and `collection`\n * @param {*} [initialValue] Starting value for the accumulator\n * @returns {*}\n * @example collection.reduce((acc, guild) => acc + guild.memberCount, 0);\n */\n reduce(fn, initialValue) {\n let accumulator;\n if (typeof initialValue !== 'undefined') {\n accumulator = initialValue;\n for (const [key, val] of this)\n accumulator = fn(accumulator, val, key, this);\n return accumulator;\n }\n let first = true;\n for (const [key, val] of this) {\n if (first) {\n accumulator = val;\n first = false;\n continue;\n }\n accumulator = fn(accumulator, val, key, this);\n }\n // No items iterated.\n if (first) {\n throw new TypeError('Reduce of empty collection with no initial value');\n }\n return accumulator;\n }\n each(fn, thisArg) {\n this.forEach(fn, thisArg);\n return this;\n }\n tap(fn, thisArg) {\n if (typeof thisArg !== 'undefined')\n fn = fn.bind(thisArg);\n fn(this);\n return this;\n }\n /**\n * Creates an identical shallow copy of this collection.\n * @returns {Collection}\n * @example const newColl = someColl.clone();\n */\n clone() {\n return new this.constructor[Symbol.species](this);\n }\n /**\n * Combines this collection with others into a new collection. None of the source collections are modified.\n * @param {...Collection} collections Collections to merge\n * @returns {Collection}\n * @example const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);\n */\n concat(...collections) {\n const newColl = this.clone();\n for (const coll of collections) {\n for (const [key, val] of coll)\n newColl.set(key, val);\n }\n return newColl;\n }\n /**\n * Checks if this collection shares identical items with another.\n * This is different to checking for equality using equal-signs, because\n * the collections may be different objects, but contain the same data.\n * @param {Collection} collection Collection to compare with\n * @returns {boolean} Whether the collections have identical contents\n */\n equals(collection) {\n if (!collection)\n return false;\n if (this === collection)\n return true;\n if (this.size !== collection.size)\n return false;\n for (const [key, value] of this) {\n if (!collection.has(key) || value !== collection.get(key)) {\n return false;\n }\n }\n return true;\n }\n /**\n * The sort method sorts the items of a collection in place and returns it.\n * The sort is not necessarily stable in Node 10 or older.\n * The default sort order is according to string Unicode code points.\n * @param {Function} [compareFunction] Specifies a function that defines the sort order.\n * If omitted, the collection is sorted according to each character's Unicode code point value,\n * according to the string conversion of each element.\n * @returns {Collection}\n * @example collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);\n */\n sort(compareFunction = (x, y) => Number(x > y) || Number(x === y) - 1) {\n const entries = [...this.entries()];\n entries.sort((a, b) => compareFunction(a[1], b[1], a[0], b[0]));\n // Perform clean-up\n super.clear();\n this._array = null;\n this._keyArray = null;\n // Set the new entries\n for (const [k, v] of entries) {\n super.set(k, v);\n }\n return this;\n }\n /**\n * The intersect method returns a new structure containing items where the keys are present in both original structures.\n * @param {Collection} other The other Collection to filter against\n * @returns {Collection}\n */\n intersect(other) {\n return other.filter((_, k) => this.has(k));\n }\n /**\n * The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.\n * @param {Collection} other The other Collection to filter against\n * @returns {Collection}\n */\n difference(other) {\n return other.filter((_, k) => !this.has(k)).concat(this.filter((_, k) => !other.has(k)));\n }\n /**\n * The sorted method sorts the items of a collection and returns it.\n * The sort is not necessarily stable in Node 10 or older.\n * The default sort order is according to string Unicode code points.\n * @param {Function} [compareFunction] Specifies a function that defines the sort order.\n * If omitted, the collection is sorted according to each character's Unicode code point value,\n * according to the string conversion of each element.\n * @returns {Collection}\n * @example collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);\n */\n sorted(compareFunction = (x, y) => Number(x > y) || Number(x === y) - 1) {\n return new this.constructor[Symbol.species]([...this.entries()])\n .sort((av, bv, ak, bk) => compareFunction(av, bv, ak, bk));\n }\n}\nexports.Collection = Collection;\nCollection.default = Collection;\nmodule.exports = Collection;\nexports.default = Collection;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXMiOlsiaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBUUE7Ozs7O0dBS0c7QUFDSCxNQUFNLFVBQWlCLFNBQVEsR0FBUztJQU12QyxZQUFtQixPQUErQztRQUNqRSxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFFZjs7Ozs7V0FLRztRQUNILE1BQU0sQ0FBQyxjQUFjLENBQUMsSUFBSSxFQUFFLFFBQVEsRUFBRSxFQUFFLEtBQUssRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLElBQUksRUFBRSxZQUFZLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQztRQUUzRjs7Ozs7V0FLRztRQUNILE1BQU0sQ0FBQyxjQUFjLENBQUMsSUFBSSxFQUFFLFdBQVcsRUFBRSxFQUFFLEtBQUssRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLElBQUksRUFBRSxZQUFZLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQztJQUMvRixDQUFDO0lBRUQ7Ozs7O09BS0c7SUFDSSxHQUFHLENBQUMsR0FBTTtRQUNoQixPQUFPLEtBQUssQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDdkIsQ0FBQztJQUVEOzs7Ozs7T0FNRztJQUNJLEdBQUcsQ0FBQyxHQUFNLEVBQUUsS0FBUTtRQUMxQixJQUFJLENBQUMsTUFBTSxHQUFHLElBQUksQ0FBQztRQUNuQixJQUFJLENBQUMsU0FBUyxHQUFHLElBQUksQ0FBQztRQUN0QixPQUFPLEtBQUssQ0FBQyxHQUFHLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFDO0lBQzl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sZWN0aW9ufVxuXHQgKiBAZXhhbXBsZSBjb2xsZWN0aW9uLnNvcnRlZCgodXNlckEsIHVzZXJCKSA9PiB1c2VyQS5jcmVhdGVkVGltZXN0YW1wIC0gdXNlckIuY3JlYXRlZFRpbWVzdGFtcCk7XG5cdCAqL1xuXHRwdWJsaWMgc29ydGVkKGNvbXBhcmVGdW5jdGlvbjogKGZpcnN0VmFsdWU6IFYsIHNlY29uZFZhbHVlOiBWLCBmaXJzdEtleTogSywgc2Vjb25kS2V5OiBLKSA9PiBudW1iZXIgPSAoeCwgeSk6IG51bWJlciA9PiBOdW1iZXIoeCA+IHkpIHx8IE51bWJlcih4ID09PSB5KSAtIDEpOiB0aGlzIHtcblx0XHRyZXR1cm4gKG5ldyB0aGlzLmNvbnN0cnVjdG9yW1N5bWJvbC5zcGVjaWVzXShbLi4udGhpcy5lbnRyaWVzKCldKSBhcyB0aGlzKVxuXHRcdFx0LnNvcnQoKGF2LCBidiwgYWssIGJrKSA9PiBjb21wYXJlRnVuY3Rpb24oYXYsIGJ2LCBhaywgYmspKTtcblx0fVxufVxuXG5tb2R1bGUuZXhwb3J0cyA9IENvbGxlY3Rpb247XG5leHBvcnQgeyBDb2xsZWN0aW9uIH07XG5leHBvcnQgZGVmYXVsdCBDb2xsZWN0aW9uO1xuIl19\n\n//# sourceURL=webpack://Discord/./node_modules/@discordjs/collection/dist/index.js?")},"./node_modules/@discordjs/form-data/lib/browser.js":function(module,exports){eval("/* eslint-env browser */\nmodule.exports = typeof self == 'object' ? self.FormData : window.FormData;\n\n\n//# sourceURL=webpack://Discord/./node_modules/@discordjs/form-data/lib/browser.js?")},"./node_modules/abort-controller/browser.js":function(module,exports,__webpack_require__){"use strict";eval('/*globals self, window */\n\n\n/*eslint-disable @mysticatea/prettier */\nconst { AbortController, AbortSignal } =\n typeof self !== "undefined" ? self :\n typeof window !== "undefined" ? window :\n /* otherwise */ undefined\n/*eslint-enable @mysticatea/prettier */\n\nmodule.exports = AbortController\nmodule.exports.AbortSignal = AbortSignal\nmodule.exports.default = AbortController\n\n\n//# sourceURL=webpack://Discord/./node_modules/abort-controller/browser.js?')},"./node_modules/base64-js/index.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n\n\n//# sourceURL=webpack://Discord/./node_modules/base64-js/index.js?")},"./node_modules/buffer/index.js":function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(/*! base64-js */ \"./node_modules/base64-js/index.js\")\nvar ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\")\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\")\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://Discord/./node_modules/buffer/index.js?")},"./node_modules/core-util-is/lib/util.js":function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ \"./node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://Discord/./node_modules/core-util-is/lib/util.js?")},"./node_modules/events/events.js":function(module,exports,__webpack_require__){"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function eventListener() {\n if (errorListener !== undefined) {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n var errorListener;\n\n // Adding an error listener is not optional because\n // if an error is thrown on an event emitter we cannot\n // guarantee that the actual event we are waiting will\n // be fired. The result could be a silent way to create\n // memory or file descriptor leaks, which is something\n // we should avoid.\n if (name !== 'error') {\n errorListener = function errorListener(err) {\n emitter.removeListener(name, eventListener);\n reject(err);\n };\n\n emitter.once('error', errorListener);\n }\n\n emitter.once(name, eventListener);\n });\n}\n\n\n//# sourceURL=webpack://Discord/./node_modules/events/events.js?")},"./node_modules/ieee754/index.js":function(module,exports){eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n//# sourceURL=webpack://Discord/./node_modules/ieee754/index.js?")},"./node_modules/inherits/inherits_browser.js":function(module,exports){eval("if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n\n\n//# sourceURL=webpack://Discord/./node_modules/inherits/inherits_browser.js?")},"./node_modules/isarray/index.js":function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n//# sourceURL=webpack://Discord/./node_modules/isarray/index.js?")},"./node_modules/node-fetch/browser.js":function(module,exports,__webpack_require__){"use strict";eval("\n\n// ref: https://github.com/tc39/proposal-global\nvar getGlobal = function () {\n\t// the only reliable means to get the global object is\n\t// `Function('return this')()`\n\t// However, this causes CSP violations in Chrome apps.\n\tif (typeof self !== 'undefined') { return self; }\n\tif (typeof window !== 'undefined') { return window; }\n\tif (typeof global !== 'undefined') { return global; }\n\tthrow new Error('unable to locate global object');\n}\n\nvar global = getGlobal();\n\nmodule.exports = exports = global.fetch;\n\n// Needed for TypeScript and Webpack.\nexports.default = global.fetch.bind(global);\n\nexports.Headers = global.Headers;\nexports.Request = global.Request;\nexports.Response = global.Response;\n\n//# sourceURL=webpack://Discord/./node_modules/node-fetch/browser.js?")},"./node_modules/node-libs-browser/mock/empty.js":function(module,exports){eval("\n\n//# sourceURL=webpack://Discord/./node_modules/node-libs-browser/mock/empty.js?")},"./node_modules/process-nextick-args/index.js":function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nif (typeof process === 'undefined' ||\n !process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://Discord/./node_modules/process-nextick-args/index.js?")},"./node_modules/process/browser.js":function(module,exports){eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack://Discord/./node_modules/process/browser.js?")},"./node_modules/readable-stream/duplex-browser.js":function(module,exports,__webpack_require__){eval('module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ "./node_modules/readable-stream/lib/_stream_duplex.js");\n\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/duplex-browser.js?')},"./node_modules/readable-stream/lib/_stream_duplex.js":function(module,exports,__webpack_require__){"use strict";eval('// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// "Software"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn\'t have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ "./node_modules/process-nextick-args/index.js");\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = Object.create(__webpack_require__(/*! core-util-is */ "./node_modules/core-util-is/lib/util.js"));\nutil.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js");\n/*</replacement>*/\n\nvar Readable = __webpack_require__(/*! ./_stream_readable */ "./node_modules/readable-stream/lib/_stream_readable.js");\nvar Writable = __webpack_require__(/*! ./_stream_writable */ "./node_modules/readable-stream/lib/_stream_writable.js");\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once(\'end\', onend);\n}\n\nObject.defineProperty(Duplex.prototype, \'writableHighWaterMark\', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we\'re ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, \'destroyed\', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/lib/_stream_duplex.js?')},"./node_modules/readable-stream/lib/_stream_passthrough.js":function(module,exports,__webpack_require__){"use strict";eval('// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// "Software"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(/*! ./_stream_transform */ "./node_modules/readable-stream/lib/_stream_transform.js");\n\n/*<replacement>*/\nvar util = Object.create(__webpack_require__(/*! core-util-is */ "./node_modules/core-util-is/lib/util.js"));\nutil.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js");\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/lib/_stream_passthrough.js?')},"./node_modules/readable-stream/lib/_stream_readable.js":function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(/*! events */ \"./node_modules/events/events.js\").EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = Object.create(__webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\"));\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(/*! util */ 1);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ \"./node_modules/readable-stream/lib/internal/streams/BufferList.js\");\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/readable-stream/lib/internal/streams/destroy.js\");\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ \"./node_modules/string_decoder/lib/string_decoder.js\").StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/lib/_stream_readable.js?")},"./node_modules/readable-stream/lib/_stream_transform.js":function(module,exports,__webpack_require__){"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n\n/*<replacement>*/\nvar util = Object.create(__webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\"));\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/lib/_stream_transform.js?")},"./node_modules/readable-stream/lib/_stream_writable.js":function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = Object.create(__webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\"));\nutil.inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: __webpack_require__(/*! util-deprecate */ \"./node_modules/util-deprecate/browser.js\")\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(/*! ./internal/streams/stream */ \"./node_modules/readable-stream/lib/internal/streams/stream-browser.js\");\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ \"./node_modules/readable-stream/lib/internal/streams/destroy.js\");\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ \"./node_modules/readable-stream/lib/_stream_duplex.js\");\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /*<replacement>*/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /*</replacement>*/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\"), __webpack_require__(/*! ./../../timers-browserify/main.js */ \"./node_modules/timers-browserify/main.js\").setImmediate, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/lib/_stream_writable.js?")},"./node_modules/readable-stream/lib/internal/streams/BufferList.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\nvar util = __webpack_require__(/*! util */ 2);\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/lib/internal/streams/BufferList.js?")},"./node_modules/readable-stream/lib/internal/streams/destroy.js":function(module,exports,__webpack_require__){"use strict";eval("\n\n/*<replacement>*/\n\nvar pna = __webpack_require__(/*! process-nextick-args */ \"./node_modules/process-nextick-args/index.js\");\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/lib/internal/streams/destroy.js?")},"./node_modules/readable-stream/lib/internal/streams/stream-browser.js":function(module,exports,__webpack_require__){eval('module.exports = __webpack_require__(/*! events */ "./node_modules/events/events.js").EventEmitter;\n\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/lib/internal/streams/stream-browser.js?')},"./node_modules/readable-stream/passthrough.js":function(module,exports,__webpack_require__){eval('module.exports = __webpack_require__(/*! ./readable */ "./node_modules/readable-stream/readable-browser.js").PassThrough\n\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/passthrough.js?')},"./node_modules/readable-stream/readable-browser.js":function(module,exports,__webpack_require__){eval('exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ "./node_modules/readable-stream/lib/_stream_readable.js");\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ "./node_modules/readable-stream/lib/_stream_writable.js");\nexports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ "./node_modules/readable-stream/lib/_stream_duplex.js");\nexports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ "./node_modules/readable-stream/lib/_stream_transform.js");\nexports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ "./node_modules/readable-stream/lib/_stream_passthrough.js");\n\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/readable-browser.js?')},"./node_modules/readable-stream/transform.js":function(module,exports,__webpack_require__){eval('module.exports = __webpack_require__(/*! ./readable */ "./node_modules/readable-stream/readable-browser.js").Transform\n\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/transform.js?')},"./node_modules/readable-stream/writable-browser.js":function(module,exports,__webpack_require__){eval('module.exports = __webpack_require__(/*! ./lib/_stream_writable.js */ "./node_modules/readable-stream/lib/_stream_writable.js");\n\n\n//# sourceURL=webpack://Discord/./node_modules/readable-stream/writable-browser.js?')},"./node_modules/safe-buffer/index.js":function(module,exports,__webpack_require__){eval("/* eslint-disable node/no-deprecated-api */\nvar buffer = __webpack_require__(/*! buffer */ \"./node_modules/buffer/index.js\")\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n\n\n//# sourceURL=webpack://Discord/./node_modules/safe-buffer/index.js?")},"./node_modules/setimmediate/setImmediate.js":function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {\n "use strict";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== "function") {\n callback = new Function("" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: "Wait until any invocations of this algorithm started before this one have completed."\n // So if we\'re currently running a task, we\'ll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // "too much recursion" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can\'t be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage("", "*");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = "setImmediate$" + Math.random() + "$";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === "string" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener("message", onGlobalMessage, false);\n } else {\n global.attachEvent("onmessage", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, "*");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it\'s been called.\n var script = doc.createElement("script");\n script.onreadystatechange = function () {\n runIfPresent(handle);\n script.onreadystatechange = null;\n html.removeChild(script);\n script = null;\n };\n html.appendChild(script);\n };\n }\n\n function installSetTimeoutImplementation() {\n registerImmediate = function(handle) {\n setTimeout(runIfPresent, 0, handle);\n };\n }\n\n // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n // Don\'t get fooled by e.g. browserify environments.\n if ({}.toString.call(global.process) === "[object process]") {\n // For Node.js before 0.9\n installNextTickImplementation();\n\n } else if (canUsePostMessage()) {\n // For non-IE10 modern browsers\n installPostMessageImplementation();\n\n } else if (global.MessageChannel) {\n // For web workers, where supported\n installMessageChannelImplementation();\n\n } else if (doc && "onreadystatechange" in doc.createElement("script")) {\n // For IE 68\n installReadyStateChangeImplementation();\n\n } else {\n // For older browsers\n installSetTimeoutImplementation();\n }\n\n attachTo.setImmediate = setImmediate;\n attachTo.clearImmediate = clearImmediate;\n}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))\n\n//# sourceURL=webpack://Discord/./node_modules/setimmediate/setImmediate.js?')},"./node_modules/stream-browserify/index.js":function(module,exports,__webpack_require__){eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = __webpack_require__(/*! events */ \"./node_modules/events/events.js\").EventEmitter;\nvar inherits = __webpack_require__(/*! inherits */ \"./node_modules/inherits/inherits_browser.js\");\n\ninherits(Stream, EE);\nStream.Readable = __webpack_require__(/*! readable-stream/readable.js */ \"./node_modules/readable-stream/readable-browser.js\");\nStream.Writable = __webpack_require__(/*! readable-stream/writable.js */ \"./node_modules/readable-stream/writable-browser.js\");\nStream.Duplex = __webpack_require__(/*! readable-stream/duplex.js */ \"./node_modules/readable-stream/duplex-browser.js\");\nStream.Transform = __webpack_require__(/*! readable-stream/transform.js */ \"./node_modules/readable-stream/transform.js\");\nStream.PassThrough = __webpack_require__(/*! readable-stream/passthrough.js */ \"./node_modules/readable-stream/passthrough.js\");\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n\n\n//# sourceURL=webpack://Discord/./node_modules/stream-browserify/index.js?")},"./node_modules/string_decoder/lib/string_decoder.js":function(module,exports,__webpack_require__){"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer;\n/*</replacement>*/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n 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':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}\n\n//# sourceURL=webpack://Discord/./node_modules/string_decoder/lib/string_decoder.js?")},"./node_modules/timers-browserify/main.js":function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||\n (typeof self !== "undefined" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\n__webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js");\n// On some exotic environments, it\'s not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||\n (typeof global !== "undefined" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||\n (typeof global !== "undefined" && global.clearImmediate) ||\n (this && this.clearImmediate);\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))\n\n//# sourceURL=webpack://Discord/./node_modules/timers-browserify/main.js?')},"./node_modules/util-deprecate/browser.js":function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://Discord/./node_modules/util-deprecate/browser.js?")},"./node_modules/util/node_modules/inherits/inherits_browser.js":function(module,exports){eval("if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n\n//# sourceURL=webpack://Discord/./node_modules/util/node_modules/inherits/inherits_browser.js?")},"./node_modules/util/support/isBufferBrowser.js":function(module,exports){eval("module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n\n//# sourceURL=webpack://Discord/./node_modules/util/support/isBufferBrowser.js?")},"./node_modules/util/util.js":function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ \"./node_modules/util/support/isBufferBrowser.js\");\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = __webpack_require__(/*! inherits */ \"./node_modules/util/node_modules/inherits/inherits_browser.js\");\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb, null, ret) },\n function(rej) { process.nextTick(callbackifyOnRejected, rej, cb) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://Discord/./node_modules/util/util.js?")},"./node_modules/webpack/buildin/global.js":function(module,exports){eval('var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function("return this")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === "object") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it\'s\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack://Discord/(webpack)/buildin/global.js?')},"./package.json":function(module,exports){eval('module.exports = ({"version":"12.3.1","homepage":"https://github.com/discordjs/discord.js#readme"})\n\n//# sourceURL=webpack://Discord/./package.json?')},"./src/WebSocket.js":function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst { browser } = __webpack_require__(/*! ./util/Constants */ \"./src/util/Constants.js\");\n\nlet erlpack;\n\ntry {\n erlpack = __webpack_require__(/*! erlpack */ 4);\n if (!erlpack.pack) erlpack = null;\n} catch {} // eslint-disable-line no-empty\n\nlet TextDecoder;\n\nif (browser) {\n TextDecoder = window.TextDecoder; // eslint-disable-line no-undef\n exports.WebSocket = window.WebSocket; // eslint-disable-line no-undef\n} else {\n TextDecoder = __webpack_require__(/*! util */ \"./node_modules/util/util.js\").TextDecoder;\n exports.WebSocket = __webpack_require__(/*! ws */ 5);\n}\n\nconst ab = new TextDecoder();\n\nexports.encoding = erlpack ? 'etf' : 'json';\n\nexports.pack = erlpack ? erlpack.pack : JSON.stringify;\n\nexports.unpack = (data, type) => {\n if (exports.encoding === 'json' || type === 'json') {\n if (typeof data !== 'string') {\n data = ab.decode(data);\n }\n return JSON.parse(data);\n }\n if (!Buffer.isBuffer(data)) data = Buffer.from(new Uint8Array(data));\n return erlpack.unpack(data);\n};\n\nexports.create = (gateway, query = {}, ...args) => {\n const [g, q] = gateway.split('?');\n query.encoding = exports.encoding;\n query = new URLSearchParams(query);\n if (q) new URLSearchParams(q).forEach((v, k) => query.set(k, v));\n const ws = new exports.WebSocket(`${g}?${query}`, ...args);\n if (browser) ws.binaryType = 'arraybuffer';\n return ws;\n};\n\nfor (const state of ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']) exports[state] = exports.WebSocket[state];\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/buffer/index.js */ \"./node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://Discord/./src/WebSocket.js?")},"./src/client/BaseClient.js":function(module,exports,__webpack_require__){"use strict";eval('/* WEBPACK VAR INJECTION */(function(setImmediate, clearImmediate) {\n\n__webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js");\nconst EventEmitter = __webpack_require__(/*! events */ "./node_modules/events/events.js");\nconst RESTManager = __webpack_require__(/*! ../rest/RESTManager */ "./src/rest/RESTManager.js");\nconst { DefaultOptions } = __webpack_require__(/*! ../util/Constants */ "./src/util/Constants.js");\nconst Util = __webpack_require__(/*! ../util/Util */ "./src/util/Util.js");\n\n/**\n * The base class for all clients.\n * @extends {EventEmitter}\n */\nclass BaseClient extends EventEmitter {\n constructor(options = {}) {\n super();\n\n /**\n * Timeouts set by {@link BaseClient#setTimeout} that are still active\n * @type {Set<Timeout>}\n * @private\n */\n this._timeouts = new Set();\n\n /**\n * Intervals set by {@link BaseClient#setInterval} that are still active\n * @type {Set<Timeout>}\n * @private\n */\n this._intervals = new Set();\n\n /**\n * Intervals set by {@link BaseClient#setImmediate} that are still active\n * @type {Set<Immediate>}\n * @private\n */\n this._immediates = new Set();\n\n /**\n * The options the client was instantiated with\n * @type {ClientOptions}\n */\n this.options = Util.mergeDefault(DefaultOptions, options);\n\n /**\n * The REST manager of the client\n * @type {RESTManager}\n * @private\n */\n this.rest = new RESTManager(this, options._tokenType);\n }\n\n /**\n * API shortcut\n * @type {Object}\n * @readonly\n * @private\n */\n get api() {\n return this.rest.api;\n }\n\n /**\n * Destroys all assets used by the base client.\n */\n destroy() {\n for (const t of this._timeouts) this.clearTimeout(t);\n for (const i of this._intervals) this.clearInterval(i);\n for (const i of this._immediates) this.clearImmediate(i);\n this._timeouts.clear();\n this._intervals.clear();\n this._immediates.clear();\n }\n\n /**\n * Sets a timeout that will be automatically cancelled if the client is destroyed.\n * @param {Function} fn Function to execute\n * @param {number} delay Time to wait before executing (in milliseconds)\n * @param {...*} args Arguments for the function\n * @returns {Timeout}\n */\n setTimeout(fn, delay, ...args) {\n const timeout = setTimeout(() => {\n fn(...args);\n this._timeouts.delete(timeout);\n }, delay);\n this._timeouts.add(timeout);\n return timeout;\n }\n\n /**\n * Clears a timeout.\n * @param {Timeout} timeout Timeout to cancel\n */\n clearTimeout(timeout) {\n clearTimeout(timeout);\n this._timeouts.delete(timeout);\n }\n\n /**\n * Sets an interval that will be automatically cancelled if the client is destroyed.\n * @param {Function} fn Function to execute\n * @param {number} delay Time to wait between executions (in milliseconds)\n * @param {...*} args Arguments for the function\n * @returns {Timeout}\n */\n setInterval(fn, delay, ...args) {\n const interval = setInterval(fn, delay, ...args);\n this._intervals.add(interval);\n return interval;\n }\n\n /**\n * Clears an interval.\n * @param {Timeout} interval Interval to cancel\n */\n clearInterval(interval) {\n clearInterval(interval);\n this._intervals.delete(interval);\n }\n\n /**\n * Sets an immediate that will be automatically cancelled if the client is destroyed.\n * @param {Function} fn Function to execute\n * @param {...*} args Arguments for the function\n * @returns {Immediate}\n */\n setImmediate(fn, ...args) {\n const immediate = setImmediate(fn, ...args);\n this._immediates.add(immediate);\n return immediate;\n }\n\n /**\n * Clears an immediate.\n * @param {Immediate} immediate Immediate to cancel\n */\n clearImmediate(immediate) {\n clearImmediate(immediate);\n this._immediates.delete(immediate);\n }\n\n /**\n * Increments max listeners by one, if they are not zero.\n * @private\n */\n incrementMaxListeners() {\n const maxListeners = this.getMaxListeners();\n if (maxListeners !== 0) {\n this.setMaxListeners(maxListeners + 1);\n }\n }\n\n /**\n * Decrements max listeners by one, if they are not zero.\n * @private\n */\n decrementMaxListeners() {\n const maxListeners = this.getMaxListeners();\n if (maxListeners !== 0) {\n this.setMaxListeners(maxListeners - 1);\n }\n }\n\n toJSON(...props) {\n return Util.flatten(this, { domain: false }, ...props);\n }\n}\n\nmodule.exports = BaseClient;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").setImmediate, __webpack_require__(/*! ./../../node_modules/timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").clearImmediate))\n\n//# sourceURL=webpack://Discord/./src/client/BaseClient.js?')},"./src/client/Client.js":function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nconst BaseClient = __webpack_require__(/*! ./BaseClient */ \"./src/client/BaseClient.js\");\nconst ActionsManager = __webpack_require__(/*! ./actions/ActionsManager */ \"./src/client/actions/ActionsManager.js\");\nconst ClientVoiceManager = __webpack_require__(/*! ./voice/ClientVoiceManager */ 3);\nconst WebSocketManager = __webpack_require__(/*! ./websocket/WebSocketManager */ \"./src/client/websocket/WebSocketManager.js\");\nconst { Error, TypeError, RangeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst ChannelManager = __webpack_require__(/*! ../managers/ChannelManager */ \"./src/managers/ChannelManager.js\");\nconst GuildEmojiManager = __webpack_require__(/*! ../managers/GuildEmojiManager */ \"./src/managers/GuildEmojiManager.js\");\nconst GuildManager = __webpack_require__(/*! ../managers/GuildManager */ \"./src/managers/GuildManager.js\");\nconst UserManager = __webpack_require__(/*! ../managers/UserManager */ \"./src/managers/UserManager.js\");\nconst ShardClientUtil = __webpack_require__(/*! ../sharding/ShardClientUtil */ 7);\nconst ClientApplication = __webpack_require__(/*! ../structures/ClientApplication */ \"./src/structures/ClientApplication.js\");\nconst GuildPreview = __webpack_require__(/*! ../structures/GuildPreview */ \"./src/structures/GuildPreview.js\");\nconst Invite = __webpack_require__(/*! ../structures/Invite */ \"./src/structures/Invite.js\");\nconst VoiceRegion = __webpack_require__(/*! ../structures/VoiceRegion */ \"./src/structures/VoiceRegion.js\");\nconst Webhook = __webpack_require__(/*! ../structures/Webhook */ \"./src/structures/Webhook.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst { Events, browser, DefaultOptions } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst DataResolver = __webpack_require__(/*! ../util/DataResolver */ \"./src/util/DataResolver.js\");\nconst Intents = __webpack_require__(/*! ../util/Intents */ \"./src/util/Intents.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\nconst Structures = __webpack_require__(/*! ../util/Structures */ \"./src/util/Structures.js\");\n\n/**\n * The main hub for interacting with the Discord API, and the starting point for any bot.\n * @extends {BaseClient}\n */\nclass Client extends BaseClient {\n /**\n * @param {ClientOptions} [options] Options for the client\n */\n constructor(options = {}) {\n super(Object.assign({ _tokenType: 'Bot' }, options));\n\n // Obtain shard details from environment or if present, worker threads\n let data = process.env;\n try {\n // Test if worker threads module is present and used\n data = __webpack_require__(/*! worker_threads */ 8).workerData || data;\n } catch {\n // Do nothing\n }\n\n if (this.options.shards === DefaultOptions.shards) {\n if ('SHARDS' in data) {\n this.options.shards = JSON.parse(data.SHARDS);\n }\n }\n\n if (this.options.shardCount === DefaultOptions.shardCount) {\n if ('SHARD_COUNT' in data) {\n this.options.shardCount = Number(data.SHARD_COUNT);\n } else if (Array.isArray(this.options.shards)) {\n this.options.shardCount = this.options.shards.length;\n }\n }\n\n const typeofShards = typeof this.options.shards;\n\n if (typeofShards === 'undefined' && typeof this.options.shardCount === 'number') {\n this.options.shards = Array.from({ length: this.options.shardCount }, (_, i) => i);\n }\n\n if (typeofShards === 'number') this.options.shards = [this.options.shards];\n\n if (Array.isArray(this.options.shards)) {\n this.options.shards = [\n ...new Set(\n this.options.shards.filter(item => !isNaN(item) && item >= 0 && item < Infinity && item === (item | 0)),\n ),\n ];\n }\n\n this._validateOptions();\n\n /**\n * The WebSocket manager of the client\n * @type {WebSocketManager}\n */\n this.ws = new WebSocketManager(this);\n\n /**\n * The action manager of the client\n * @type {ActionsManager}\n * @private\n */\n this.actions = new ActionsManager(this);\n\n /**\n * The voice manager of the client (`null` in browsers)\n * @type {?ClientVoiceManager}\n */\n this.voice = !browser ? new ClientVoiceManager(this) : null;\n\n /**\n * Shard helpers for the client (only if the process was spawned from a {@link ShardingManager})\n * @type {?ShardClientUtil}\n */\n this.shard =\n !browser && process.env.SHARDING_MANAGER\n ? ShardClientUtil.singleton(this, process.env.SHARDING_MANAGER_MODE)\n : null;\n\n /**\n * All of the {@link User} objects that have been cached at any point, mapped by their IDs\n * @type {UserManager}\n */\n this.users = new UserManager(this);\n\n /**\n * All of the guilds the client is currently handling, mapped by their IDs -\n * as long as sharding isn't being used, this will be *every* guild the bot is a member of\n * @type {GuildManager}\n */\n this.guilds = new GuildManager(this);\n\n /**\n * All of the {@link Channel}s that the client is currently handling, mapped by their IDs -\n * as long as sharding isn't being used, this will be *every* channel in *every* guild the bot\n * is a member of. Note that DM channels will not be initially cached, and thus not be present\n * in the Manager without their explicit fetching or use.\n * @type {ChannelManager}\n */\n this.channels = new ChannelManager(this);\n\n const ClientPresence = Structures.get('ClientPresence');\n /**\n * The presence of the Client\n * @private\n * @type {ClientPresence}\n */\n this.presence = new ClientPresence(this);\n\n Object.defineProperty(this, 'token', { writable: true });\n if (!browser && !this.token && 'DISCORD_TOKEN' in process.env) {\n /**\n * Authorization token for the logged in bot.\n * If present, this defaults to `process.env.DISCORD_TOKEN` when instantiating the client\n * <warn>This should be kept private at all times.</warn>\n * @type {?string}\n */\n this.token = process.env.DISCORD_TOKEN;\n } else {\n this.token = null;\n }\n\n /**\n * User that the client is logged in as\n * @type {?ClientUser}\n */\n this.user = null;\n\n /**\n * Time at which the client was last regarded as being in the `READY` state\n * (each time the client disconnects and successfully reconnects, this will be overwritten)\n * @type {?Date}\n */\n this.readyAt = null;\n\n if (this.options.messageSweepInterval > 0) {\n this.setInterval(this.sweepMessages.bind(this), this.options.messageSweepInterval * 1000);\n }\n }\n\n /**\n * All custom emojis that the client has access to, mapped by their IDs\n * @type {GuildEmojiManager}\n * @readonly\n */\n get emojis() {\n const emojis = new GuildEmojiManager({ client: this });\n for (const guild of this.guilds.cache.values()) {\n if (guild.available) for (const emoji of guild.emojis.cache.values()) emojis.cache.set(emoji.id, emoji);\n }\n return emojis;\n }\n\n /**\n * Timestamp of the time the client was last `READY` at\n * @type {?number}\n * @readonly\n */\n get readyTimestamp() {\n return this.readyAt ? this.readyAt.getTime() : null;\n }\n\n /**\n * How long it has been since the client last entered the `READY` state in milliseconds\n * @type {?number}\n * @readonly\n */\n get uptime() {\n return this.readyAt ? Date.now() - this.readyAt : null;\n }\n\n /**\n * Logs the client in, establishing a websocket connection to Discord.\n * @param {string} [token=this.token] Token of the account to log in with\n * @returns {Promise<string>} Token of the account used\n * @example\n * client.login('my token');\n */\n async login(token = this.token) {\n if (!token || typeof token !== 'string') throw new Error('TOKEN_INVALID');\n this.token = token = token.replace(/^(Bot|Bearer)\\s*/i, '');\n this.emit(\n Events.DEBUG,\n `Provided token: ${token\n .split('.')\n .map((val, i) => (i > 1 ? val.replace(/./g, '*') : val))\n .join('.')}`,\n );\n\n if (this.options.presence) {\n this.options.ws.presence = await this.presence._parse(this.options.presence);\n }\n\n this.emit(Events.DEBUG, 'Preparing to connect to the gateway...');\n\n try {\n await this.ws.connect();\n return this.token;\n } catch (error) {\n this.destroy();\n throw error;\n }\n }\n\n /**\n * Logs out, terminates the connection to Discord, and destroys the client.\n * @returns {void}\n */\n destroy() {\n super.destroy();\n this.ws.destroy();\n this.token = null;\n }\n\n /**\n * Obtains an invite from Discord.\n * @param {InviteResolvable} invite Invite code or URL\n * @returns {Promise<Invite>}\n * @example\n * client.fetchInvite('https://discord.gg/bRCvFy9')\n * .then(invite => console.log(`Obtained invite with code: ${invite.code}`))\n * .catch(console.error);\n */\n fetchInvite(invite) {\n const code = DataResolver.resolveInviteCode(invite);\n return this.api\n .invites(code)\n .get({ query: { with_counts: true } })\n .then(data => new Invite(this, data));\n }\n\n /**\n * Obtains a webhook from Discord.\n * @param {Snowflake} id ID of the webhook\n * @param {string} [token] Token for the webhook\n * @returns {Promise<Webhook>}\n * @example\n * client.fetchWebhook('id', 'token')\n * .then(webhook => console.log(`Obtained webhook with name: ${webhook.name}`))\n * .catch(console.error);\n */\n fetchWebhook(id, token) {\n return this.api\n .webhooks(id, token)\n .get()\n .then(data => new Webhook(this, data));\n }\n\n /**\n * Obtains the available voice regions from Discord.\n * @returns {Promise<Collection<string, VoiceRegion>>}\n * @example\n * client.fetchVoiceRegions()\n * .then(regions => console.log(`Available regions are: ${regions.map(region => region.name).join(', ')}`))\n * .catch(console.error);\n */\n fetchVoiceRegions() {\n return this.api.voice.regions.get().then(res => {\n const regions = new Collection();\n for (const region of res) regions.set(region.id, new VoiceRegion(region));\n return regions;\n });\n }\n\n /**\n * Sweeps all text-based channels' messages and removes the ones older than the max message lifetime.\n * If the message has been edited, the time of the edit is used rather than the time of the original message.\n * @param {number} [lifetime=this.options.messageCacheLifetime] Messages that are older than this (in seconds)\n * will be removed from the caches. The default is based on {@link ClientOptions#messageCacheLifetime}\n * @returns {number} Amount of messages that were removed from the caches,\n * or -1 if the message cache lifetime is unlimited\n * @example\n * // Remove all messages older than 1800 seconds from the messages cache\n * const amount = client.sweepMessages(1800);\n * console.log(`Successfully removed ${amount} messages from the cache.`);\n */\n sweepMessages(lifetime = this.options.messageCacheLifetime) {\n if (typeof lifetime !== 'number' || isNaN(lifetime)) {\n throw new TypeError('INVALID_TYPE', 'lifetime', 'number');\n }\n if (lifetime <= 0) {\n this.emit(Events.DEBUG, \"Didn't sweep messages - lifetime is unlimited\");\n return -1;\n }\n\n const lifetimeMs = lifetime * 1000;\n const now = Date.now();\n let channels = 0;\n let messages = 0;\n\n for (const channel of this.channels.cache.values()) {\n if (!channel.messages) continue;\n channels++;\n\n messages += channel.messages.cache.sweep(\n message => now - (message.editedTimestamp || message.createdTimestamp) > lifetimeMs,\n );\n }\n\n this.emit(\n Events.DEBUG,\n `Swept ${messages} messages older than ${lifetime} seconds in ${channels} text-based channels`,\n );\n return messages;\n }\n\n /**\n * Obtains the OAuth Application of this bot from Discord.\n * @returns {Promise<ClientApplication>}\n */\n fetchApplication() {\n return this.api.oauth2\n .applications('@me')\n .get()\n .then(app => new ClientApplication(this, app));\n }\n\n /**\n * Obtains a guild preview from Discord, available for all guilds the bot is in and all Discoverable guilds.\n * @param {GuildResolvable} guild The guild to fetch the preview for\n * @returns {Promise<GuildPreview>}\n */\n fetchGuildPreview(guild) {\n const id = this.guilds.resolveID(guild);\n if (!id) throw new TypeError('INVALID_TYPE', 'guild', 'GuildResolvable');\n return this.api\n .guilds(id)\n .preview.get()\n .then(data => new GuildPreview(this, data));\n }\n\n /**\n * Generates a link that can be used to invite the bot to a guild.\n * @param {PermissionResolvable} [permissions] Permissions to request\n * @returns {Promise<string>}\n * @example\n * client.generateInvite(['SEND_MESSAGES', 'MANAGE_GUILD', 'MENTION_EVERYONE'])\n * .then(link => console.log(`Generated bot invite link: ${link}`))\n * .catch(console.error);\n */\n async generateInvite(permissions) {\n permissions = Permissions.resolve(permissions);\n const application = await this.fetchApplication();\n const query = new URLSearchParams({\n client_id: application.id,\n permissions: permissions,\n scope: 'bot',\n });\n return `${this.options.http.api}${this.api.oauth2.authorize}?${query}`;\n }\n\n toJSON() {\n return super.toJSON({\n readyAt: false,\n presences: false,\n });\n }\n\n /**\n * Calls {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval} on a script\n * with the client as `this`.\n * @param {string} script Script to eval\n * @returns {*}\n * @private\n */\n _eval(script) {\n return eval(script);\n }\n\n /**\n * Validates the client options.\n * @param {ClientOptions} [options=this.options] Options to validate\n * @private\n */\n _validateOptions(options = this.options) {\n if (typeof options.ws.intents !== 'undefined') {\n options.ws.intents = Intents.resolve(options.ws.intents);\n }\n if (typeof options.shardCount !== 'number' || isNaN(options.shardCount) || options.shardCount < 1) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'shardCount', 'a number greater than or equal to 1');\n }\n if (options.shards && !(options.shards === 'auto' || Array.isArray(options.shards))) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'shards', \"'auto', a number or array of numbers\");\n }\n if (options.shards && !options.shards.length) throw new RangeError('CLIENT_INVALID_PROVIDED_SHARDS');\n if (typeof options.messageCacheMaxSize !== 'number' || isNaN(options.messageCacheMaxSize)) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'messageCacheMaxSize', 'a number');\n }\n if (typeof options.messageCacheLifetime !== 'number' || isNaN(options.messageCacheLifetime)) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'The messageCacheLifetime', 'a number');\n }\n if (typeof options.messageSweepInterval !== 'number' || isNaN(options.messageSweepInterval)) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'messageSweepInterval', 'a number');\n }\n if (typeof options.fetchAllMembers !== 'boolean') {\n throw new TypeError('CLIENT_INVALID_OPTION', 'fetchAllMembers', 'a boolean');\n }\n if (typeof options.disableMentions !== 'string') {\n throw new TypeError('CLIENT_INVALID_OPTION', 'disableMentions', 'a string');\n }\n if (!Array.isArray(options.partials)) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'partials', 'an Array');\n }\n if (typeof options.restWsBridgeTimeout !== 'number' || isNaN(options.restWsBridgeTimeout)) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'restWsBridgeTimeout', 'a number');\n }\n if (typeof options.restRequestTimeout !== 'number' || isNaN(options.restRequestTimeout)) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'restRequestTimeout', 'a number');\n }\n if (typeof options.restSweepInterval !== 'number' || isNaN(options.restSweepInterval)) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'restSweepInterval', 'a number');\n }\n if (typeof options.retryLimit !== 'number' || isNaN(options.retryLimit)) {\n throw new TypeError('CLIENT_INVALID_OPTION', 'retryLimit', 'a number');\n }\n }\n}\n\nmodule.exports = Client;\n\n/**\n * Emitted for general warnings.\n * @event Client#warn\n * @param {string} info The warning\n */\n\n/**\n * Emitted for general debugging information.\n * @event Client#debug\n * @param {string} info The debug information\n */\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://Discord/./src/client/Client.js?")},"./src/client/WebhookClient.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst BaseClient = __webpack_require__(/*! ./BaseClient */ \"./src/client/BaseClient.js\");\nconst Webhook = __webpack_require__(/*! ../structures/Webhook */ \"./src/structures/Webhook.js\");\n\n/**\n * The webhook client.\n * @implements {Webhook}\n * @extends {BaseClient}\n */\nclass WebhookClient extends BaseClient {\n /**\n * @param {Snowflake} id ID of the webhook\n * @param {string} token Token of the webhook\n * @param {ClientOptions} [options] Options for the client\n * @example\n * // Create a new webhook and send a message\n * const hook = new Discord.WebhookClient('1234', 'abcdef');\n * hook.send('This will send a message').catch(console.error);\n */\n constructor(id, token, options) {\n super(options);\n Object.defineProperty(this, 'client', { value: this });\n this.id = id;\n Object.defineProperty(this, 'token', { value: token, writable: true, configurable: true });\n }\n}\n\nWebhook.applyToClass(WebhookClient);\n\nmodule.exports = WebhookClient;\n\n\n//# sourceURL=webpack://Discord/./src/client/WebhookClient.js?")},"./src/client/actions/Action.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { PartialTypes } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\n/*\n\nABOUT ACTIONS\n\nActions are similar to WebSocket Packet Handlers, but since introducing\nthe REST API methods, in order to prevent rewriting code to handle data,\n"actions" have been introduced. They\'re basically what Packet Handlers\nused to be but they\'re strictly for manipulating data and making sure\nthat WebSocket events don\'t clash with REST methods.\n\n*/\n\nclass GenericAction {\n constructor(client) {\n this.client = client;\n }\n\n handle(data) {\n return data;\n }\n\n getPayload(data, manager, id, partialType, cache) {\n const existing = manager.cache.get(id);\n if (!existing && this.client.options.partials.includes(partialType)) {\n return manager.add(data, cache);\n }\n return existing;\n }\n\n getChannel(data) {\n const id = data.channel_id || data.id;\n return (\n data.channel ||\n this.getPayload(\n {\n id,\n guild_id: data.guild_id,\n recipients: [data.author || { id: data.user_id }],\n },\n this.client.channels,\n id,\n PartialTypes.CHANNEL,\n )\n );\n }\n\n getMessage(data, channel, cache) {\n const id = data.message_id || data.id;\n return (\n data.message ||\n this.getPayload(\n {\n id,\n channel_id: channel.id,\n guild_id: data.guild_id || (channel.guild ? channel.guild.id : null),\n },\n channel.messages,\n id,\n PartialTypes.MESSAGE,\n cache,\n )\n );\n }\n\n getReaction(data, message, user) {\n const id = data.emoji.id || decodeURIComponent(data.emoji.name);\n return this.getPayload(\n {\n emoji: data.emoji,\n count: message.partial ? null : 0,\n me: user ? user.id === this.client.user.id : false,\n },\n message.reactions,\n id,\n PartialTypes.REACTION,\n );\n }\n\n getMember(data, guild) {\n const id = data.user.id;\n return this.getPayload(\n {\n user: {\n id,\n },\n },\n guild.members,\n id,\n PartialTypes.GUILD_MEMBER,\n );\n }\n\n getUser(data) {\n const id = data.user_id;\n return data.user || this.getPayload({ id }, this.client.users, id, PartialTypes.USER);\n }\n}\n\nmodule.exports = GenericAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/Action.js?')},"./src/client/actions/ActionsManager.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nclass ActionsManager {\n constructor(client) {\n this.client = client;\n\n this.register(__webpack_require__(/*! ./MessageCreate */ "./src/client/actions/MessageCreate.js"));\n this.register(__webpack_require__(/*! ./MessageDelete */ "./src/client/actions/MessageDelete.js"));\n this.register(__webpack_require__(/*! ./MessageDeleteBulk */ "./src/client/actions/MessageDeleteBulk.js"));\n this.register(__webpack_require__(/*! ./MessageUpdate */ "./src/client/actions/MessageUpdate.js"));\n this.register(__webpack_require__(/*! ./MessageReactionAdd */ "./src/client/actions/MessageReactionAdd.js"));\n this.register(__webpack_require__(/*! ./MessageReactionRemove */ "./src/client/actions/MessageReactionRemove.js"));\n this.register(__webpack_require__(/*! ./MessageReactionRemoveAll */ "./src/client/actions/MessageReactionRemoveAll.js"));\n this.register(__webpack_require__(/*! ./MessageReactionRemoveEmoji */ "./src/client/actions/MessageReactionRemoveEmoji.js"));\n this.register(__webpack_require__(/*! ./ChannelCreate */ "./src/client/actions/ChannelCreate.js"));\n this.register(__webpack_require__(/*! ./ChannelDelete */ "./src/client/actions/ChannelDelete.js"));\n this.register(__webpack_require__(/*! ./ChannelUpdate */ "./src/client/actions/ChannelUpdate.js"));\n this.register(__webpack_require__(/*! ./GuildDelete */ "./src/client/actions/GuildDelete.js"));\n this.register(__webpack_require__(/*! ./GuildUpdate */ "./src/client/actions/GuildUpdate.js"));\n this.register(__webpack_require__(/*! ./InviteCreate */ "./src/client/actions/InviteCreate.js"));\n this.register(__webpack_require__(/*! ./InviteDelete */ "./src/client/actions/InviteDelete.js"));\n this.register(__webpack_require__(/*! ./GuildMemberRemove */ "./src/client/actions/GuildMemberRemove.js"));\n this.register(__webpack_require__(/*! ./GuildBanRemove */ "./src/client/actions/GuildBanRemove.js"));\n this.register(__webpack_require__(/*! ./GuildRoleCreate */ "./src/client/actions/GuildRoleCreate.js"));\n this.register(__webpack_require__(/*! ./GuildRoleDelete */ "./src/client/actions/GuildRoleDelete.js"));\n this.register(__webpack_require__(/*! ./GuildRoleUpdate */ "./src/client/actions/GuildRoleUpdate.js"));\n this.register(__webpack_require__(/*! ./PresenceUpdate */ "./src/client/actions/PresenceUpdate.js"));\n this.register(__webpack_require__(/*! ./UserUpdate */ "./src/client/actions/UserUpdate.js"));\n this.register(__webpack_require__(/*! ./VoiceStateUpdate */ "./src/client/actions/VoiceStateUpdate.js"));\n this.register(__webpack_require__(/*! ./GuildEmojiCreate */ "./src/client/actions/GuildEmojiCreate.js"));\n this.register(__webpack_require__(/*! ./GuildEmojiDelete */ "./src/client/actions/GuildEmojiDelete.js"));\n this.register(__webpack_require__(/*! ./GuildEmojiUpdate */ "./src/client/actions/GuildEmojiUpdate.js"));\n this.register(__webpack_require__(/*! ./GuildEmojisUpdate */ "./src/client/actions/GuildEmojisUpdate.js"));\n this.register(__webpack_require__(/*! ./GuildRolesPositionUpdate */ "./src/client/actions/GuildRolesPositionUpdate.js"));\n this.register(__webpack_require__(/*! ./GuildChannelsPositionUpdate */ "./src/client/actions/GuildChannelsPositionUpdate.js"));\n this.register(__webpack_require__(/*! ./GuildIntegrationsUpdate */ "./src/client/actions/GuildIntegrationsUpdate.js"));\n this.register(__webpack_require__(/*! ./WebhooksUpdate */ "./src/client/actions/WebhooksUpdate.js"));\n }\n\n register(Action) {\n this[Action.name.replace(/Action$/, \'\')] = new Action(this.client);\n }\n}\n\nmodule.exports = ActionsManager;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/ActionsManager.js?')},"./src/client/actions/ChannelCreate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass ChannelCreateAction extends Action {\n handle(data) {\n const client = this.client;\n const existing = client.channels.cache.has(data.id);\n const channel = client.channels.add(data);\n if (!existing && channel) {\n /**\n * Emitted whenever a channel is created.\n * @event Client#channelCreate\n * @param {DMChannel|GuildChannel} channel The channel that was created\n */\n client.emit(Events.CHANNEL_CREATE, channel);\n }\n return { channel };\n }\n}\n\nmodule.exports = ChannelCreateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/ChannelCreate.js?')},"./src/client/actions/ChannelDelete.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst DMChannel = __webpack_require__(/*! ../../structures/DMChannel */ "./src/structures/DMChannel.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass ChannelDeleteAction extends Action {\n constructor(client) {\n super(client);\n this.deleted = new Map();\n }\n\n handle(data) {\n const client = this.client;\n let channel = client.channels.cache.get(data.id);\n\n if (channel) {\n client.channels.remove(channel.id);\n channel.deleted = true;\n if (channel.messages && !(channel instanceof DMChannel)) {\n for (const message of channel.messages.cache.values()) {\n message.deleted = true;\n }\n }\n /**\n * Emitted whenever a channel is deleted.\n * @event Client#channelDelete\n * @param {DMChannel|GuildChannel} channel The channel that was deleted\n */\n client.emit(Events.CHANNEL_DELETE, channel);\n }\n\n return { channel };\n }\n}\n\nmodule.exports = ChannelDeleteAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/ChannelDelete.js?')},"./src/client/actions/ChannelUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst Channel = __webpack_require__(/*! ../../structures/Channel */ "./src/structures/Channel.js");\nconst { ChannelTypes } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass ChannelUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n\n let channel = client.channels.cache.get(data.id);\n if (channel) {\n const old = channel._update(data);\n\n if (ChannelTypes[channel.type.toUpperCase()] !== data.type) {\n const newChannel = Channel.create(this.client, data, channel.guild);\n for (const [id, message] of channel.messages.cache) newChannel.messages.cache.set(id, message);\n newChannel._typing = new Map(channel._typing);\n channel = newChannel;\n this.client.channels.cache.set(channel.id, channel);\n }\n\n return {\n old,\n updated: channel,\n };\n }\n\n return {};\n }\n}\n\nmodule.exports = ChannelUpdateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/ChannelUpdate.js?')},"./src/client/actions/GuildBanRemove.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildBanRemove extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.cache.get(data.guild_id);\n const user = client.users.add(data.user);\n /**\n * Emitted whenever a member is unbanned from a guild.\n * @event Client#guildBanRemove\n * @param {Guild} guild The guild that the unban occurred in\n * @param {User} user The user that was unbanned\n */\n if (guild && user) client.emit(Events.GUILD_BAN_REMOVE, guild, user);\n }\n}\n\nmodule.exports = GuildBanRemove;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildBanRemove.js?')},"./src/client/actions/GuildChannelsPositionUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\n\nclass GuildChannelsPositionUpdate extends Action {\n handle(data) {\n const client = this.client;\n\n const guild = client.guilds.cache.get(data.guild_id);\n if (guild) {\n for (const partialChannel of data.channels) {\n const channel = guild.channels.cache.get(partialChannel.id);\n if (channel) channel.rawPosition = partialChannel.position;\n }\n }\n\n return { guild };\n }\n}\n\nmodule.exports = GuildChannelsPositionUpdate;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildChannelsPositionUpdate.js?')},"./src/client/actions/GuildDelete.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildDeleteAction extends Action {\n constructor(client) {\n super(client);\n this.deleted = new Map();\n }\n\n handle(data) {\n const client = this.client;\n\n let guild = client.guilds.cache.get(data.id);\n if (guild) {\n for (const channel of guild.channels.cache.values()) {\n if (channel.type === \'text\') channel.stopTyping(true);\n }\n\n if (data.unavailable) {\n // Guild is unavailable\n guild.available = false;\n\n /**\n * Emitted whenever a guild becomes unavailable, likely due to a server outage.\n * @event Client#guildUnavailable\n * @param {Guild} guild The guild that has become unavailable\n */\n client.emit(Events.GUILD_UNAVAILABLE, guild);\n\n // Stops the GuildDelete packet thinking a guild was actually deleted,\n // handles emitting of event itself\n return {\n guild: null,\n };\n }\n\n for (const channel of guild.channels.cache.values()) this.client.channels.remove(channel.id);\n if (guild.voice && guild.voice.connection) guild.voice.connection.disconnect();\n\n // Delete guild\n client.guilds.cache.delete(guild.id);\n guild.deleted = true;\n\n /**\n * Emitted whenever a guild kicks the client or the guild is deleted/left.\n * @event Client#guildDelete\n * @param {Guild} guild The guild that was deleted\n */\n client.emit(Events.GUILD_DELETE, guild);\n\n this.deleted.set(guild.id, guild);\n this.scheduleForDeletion(guild.id);\n } else {\n guild = this.deleted.get(data.id) || null;\n }\n\n return { guild };\n }\n\n scheduleForDeletion(id) {\n this.client.setTimeout(() => this.deleted.delete(id), this.client.options.restWsBridgeTimeout);\n }\n}\n\nmodule.exports = GuildDeleteAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildDelete.js?')},"./src/client/actions/GuildEmojiCreate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildEmojiCreateAction extends Action {\n handle(guild, createdEmoji) {\n const emoji = guild.emojis.add(createdEmoji);\n /**\n * Emitted whenever a custom emoji is created in a guild.\n * @event Client#emojiCreate\n * @param {GuildEmoji} emoji The emoji that was created\n */\n this.client.emit(Events.GUILD_EMOJI_CREATE, emoji);\n return { emoji };\n }\n}\n\nmodule.exports = GuildEmojiCreateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildEmojiCreate.js?')},"./src/client/actions/GuildEmojiDelete.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildEmojiDeleteAction extends Action {\n handle(emoji) {\n emoji.guild.emojis.cache.delete(emoji.id);\n emoji.deleted = true;\n /**\n * Emitted whenever a custom emoji is deleted in a guild.\n * @event Client#emojiDelete\n * @param {GuildEmoji} emoji The emoji that was deleted\n */\n this.client.emit(Events.GUILD_EMOJI_DELETE, emoji);\n return { emoji };\n }\n}\n\nmodule.exports = GuildEmojiDeleteAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildEmojiDelete.js?')},"./src/client/actions/GuildEmojiUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildEmojiUpdateAction extends Action {\n handle(current, data) {\n const old = current._update(data);\n /**\n * Emitted whenever a custom emoji is updated in a guild.\n * @event Client#emojiUpdate\n * @param {GuildEmoji} oldEmoji The old emoji\n * @param {GuildEmoji} newEmoji The new emoji\n */\n this.client.emit(Events.GUILD_EMOJI_UPDATE, old, current);\n return { emoji: current };\n }\n}\n\nmodule.exports = GuildEmojiUpdateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildEmojiUpdate.js?')},"./src/client/actions/GuildEmojisUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\n\nclass GuildEmojisUpdateAction extends Action {\n handle(data) {\n const guild = this.client.guilds.cache.get(data.guild_id);\n if (!guild || !guild.emojis) return;\n\n const deletions = new Map(guild.emojis.cache);\n\n for (const emoji of data.emojis) {\n // Determine type of emoji event\n const cachedEmoji = guild.emojis.cache.get(emoji.id);\n if (cachedEmoji) {\n deletions.delete(emoji.id);\n if (!cachedEmoji.equals(emoji)) {\n // Emoji updated\n this.client.actions.GuildEmojiUpdate.handle(cachedEmoji, emoji);\n }\n } else {\n // Emoji added\n this.client.actions.GuildEmojiCreate.handle(guild, emoji);\n }\n }\n\n for (const emoji of deletions.values()) {\n // Emoji deleted\n this.client.actions.GuildEmojiDelete.handle(emoji);\n }\n }\n}\n\nmodule.exports = GuildEmojisUpdateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildEmojisUpdate.js?')},"./src/client/actions/GuildIntegrationsUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildIntegrationsUpdate extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.cache.get(data.guild_id);\n /**\n * Emitted whenever a guild integration is updated\n * @event Client#guildIntegrationsUpdate\n * @param {Guild} guild The guild whose integrations were updated\n */\n if (guild) client.emit(Events.GUILD_INTEGRATIONS_UPDATE, guild);\n }\n}\n\nmodule.exports = GuildIntegrationsUpdate;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildIntegrationsUpdate.js?')},"./src/client/actions/GuildMemberRemove.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events, Status } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildMemberRemoveAction extends Action {\n handle(data, shard) {\n const client = this.client;\n const guild = client.guilds.cache.get(data.guild_id);\n let member = null;\n if (guild) {\n member = this.getMember(data, guild);\n guild.memberCount--;\n if (member) {\n member.deleted = true;\n guild.members.cache.delete(member.id);\n /**\n * Emitted whenever a member leaves a guild, or is kicked.\n * @event Client#guildMemberRemove\n * @param {GuildMember} member The member that has left/been kicked from the guild\n */\n if (shard.status === Status.READY) client.emit(Events.GUILD_MEMBER_REMOVE, member);\n }\n guild.voiceStates.cache.delete(data.user.id);\n }\n return { guild, member };\n }\n}\n\nmodule.exports = GuildMemberRemoveAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildMemberRemove.js?')},"./src/client/actions/GuildRoleCreate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildRoleCreate extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.cache.get(data.guild_id);\n let role;\n if (guild) {\n const already = guild.roles.cache.has(data.role.id);\n role = guild.roles.add(data.role);\n /**\n * Emitted whenever a role is created.\n * @event Client#roleCreate\n * @param {Role} role The role that was created\n */\n if (!already) client.emit(Events.GUILD_ROLE_CREATE, role);\n }\n return { role };\n }\n}\n\nmodule.exports = GuildRoleCreate;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildRoleCreate.js?')},"./src/client/actions/GuildRoleDelete.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildRoleDeleteAction extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.cache.get(data.guild_id);\n let role;\n\n if (guild) {\n role = guild.roles.cache.get(data.role_id);\n if (role) {\n guild.roles.cache.delete(data.role_id);\n role.deleted = true;\n /**\n * Emitted whenever a guild role is deleted.\n * @event Client#roleDelete\n * @param {Role} role The role that was deleted\n */\n client.emit(Events.GUILD_ROLE_DELETE, role);\n }\n }\n\n return { role };\n }\n}\n\nmodule.exports = GuildRoleDeleteAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildRoleDelete.js?')},"./src/client/actions/GuildRoleUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildRoleUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.cache.get(data.guild_id);\n\n if (guild) {\n let old = null;\n\n const role = guild.roles.cache.get(data.role.id);\n if (role) {\n old = role._update(data.role);\n /**\n * Emitted whenever a guild role is updated.\n * @event Client#roleUpdate\n * @param {Role} oldRole The role before the update\n * @param {Role} newRole The role after the update\n */\n client.emit(Events.GUILD_ROLE_UPDATE, old, role);\n }\n\n return {\n old,\n updated: role,\n };\n }\n\n return {\n old: null,\n updated: null,\n };\n }\n}\n\nmodule.exports = GuildRoleUpdateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildRoleUpdate.js?')},"./src/client/actions/GuildRolesPositionUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\n\nclass GuildRolesPositionUpdate extends Action {\n handle(data) {\n const client = this.client;\n\n const guild = client.guilds.cache.get(data.guild_id);\n if (guild) {\n for (const partialRole of data.roles) {\n const role = guild.roles.cache.get(partialRole.id);\n if (role) role.rawPosition = partialRole.position;\n }\n }\n\n return { guild };\n }\n}\n\nmodule.exports = GuildRolesPositionUpdate;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildRolesPositionUpdate.js?')},"./src/client/actions/GuildUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass GuildUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n\n const guild = client.guilds.cache.get(data.id);\n if (guild) {\n const old = guild._update(data);\n /**\n * Emitted whenever a guild is updated - e.g. name change.\n * @event Client#guildUpdate\n * @param {Guild} oldGuild The guild before the update\n * @param {Guild} newGuild The guild after the update\n */\n client.emit(Events.GUILD_UPDATE, old, guild);\n return {\n old,\n updated: guild,\n };\n }\n\n return {\n old: null,\n updated: null,\n };\n }\n}\n\nmodule.exports = GuildUpdateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/GuildUpdate.js?')},"./src/client/actions/InviteCreate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst Invite = __webpack_require__(/*! ../../structures/Invite */ "./src/structures/Invite.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass InviteCreateAction extends Action {\n handle(data) {\n const client = this.client;\n const channel = client.channels.cache.get(data.channel_id);\n const guild = client.guilds.cache.get(data.guild_id);\n if (!channel && !guild) return false;\n\n const inviteData = Object.assign(data, { channel, guild });\n const invite = new Invite(client, inviteData);\n /**\n * Emitted when an invite is created.\n * <info> This event only triggers if the client has `MANAGE_GUILD` permissions for the guild,\n * or `MANAGE_CHANNEL` permissions for the channel.</info>\n * @event Client#inviteCreate\n * @param {Invite} invite The invite that was created\n */\n client.emit(Events.INVITE_CREATE, invite);\n return { invite };\n }\n}\n\nmodule.exports = InviteCreateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/InviteCreate.js?')},"./src/client/actions/InviteDelete.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst Invite = __webpack_require__(/*! ../../structures/Invite */ "./src/structures/Invite.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass InviteDeleteAction extends Action {\n handle(data) {\n const client = this.client;\n const channel = client.channels.cache.get(data.channel_id);\n const guild = client.guilds.cache.get(data.guild_id);\n if (!channel && !guild) return false;\n\n const inviteData = Object.assign(data, { channel, guild });\n const invite = new Invite(client, inviteData);\n\n /**\n * Emitted when an invite is deleted.\n * <info> This event only triggers if the client has `MANAGE_GUILD` permissions for the guild,\n * or `MANAGE_CHANNEL` permissions for the channel.</info>\n * @event Client#inviteDelete\n * @param {Invite} invite The invite that was deleted\n */\n client.emit(Events.INVITE_DELETE, invite);\n return { invite };\n }\n}\n\nmodule.exports = InviteDeleteAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/InviteDelete.js?')},"./src/client/actions/MessageCreate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass MessageCreateAction extends Action {\n handle(data) {\n const client = this.client;\n const channel = client.channels.cache.get(data.channel_id);\n if (channel) {\n const existing = channel.messages.cache.get(data.id);\n if (existing) return { message: existing };\n const message = channel.messages.add(data);\n const user = message.author;\n let member = message.member;\n channel.lastMessageID = data.id;\n if (user) {\n user.lastMessageID = data.id;\n user.lastMessageChannelID = channel.id;\n }\n if (member) {\n member.lastMessageID = data.id;\n member.lastMessageChannelID = channel.id;\n }\n\n /**\n * Emitted whenever a message is created.\n * @event Client#message\n * @param {Message} message The created message\n */\n client.emit(Events.MESSAGE_CREATE, message);\n return { message };\n }\n\n return {};\n }\n}\n\nmodule.exports = MessageCreateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/MessageCreate.js?')},"./src/client/actions/MessageDelete.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass MessageDeleteAction extends Action {\n handle(data) {\n const client = this.client;\n const channel = this.getChannel(data);\n let message;\n if (channel) {\n message = this.getMessage(data, channel);\n if (message) {\n channel.messages.cache.delete(message.id);\n message.deleted = true;\n /**\n * Emitted whenever a message is deleted.\n * @event Client#messageDelete\n * @param {Message} message The deleted message\n */\n client.emit(Events.MESSAGE_DELETE, message);\n }\n }\n\n return { message };\n }\n}\n\nmodule.exports = MessageDeleteAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/MessageDelete.js?')},"./src/client/actions/MessageDeleteBulk.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst Collection = __webpack_require__(/*! ../../util/Collection */ "./src/util/Collection.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass MessageDeleteBulkAction extends Action {\n handle(data) {\n const client = this.client;\n const channel = client.channels.cache.get(data.channel_id);\n\n if (channel) {\n const ids = data.ids;\n const messages = new Collection();\n for (const id of ids) {\n const message = this.getMessage(\n {\n id,\n guild_id: data.guild_id,\n },\n channel,\n false,\n );\n if (message) {\n message.deleted = true;\n messages.set(message.id, message);\n channel.messages.cache.delete(id);\n }\n }\n\n /**\n * Emitted whenever messages are deleted in bulk.\n * @event Client#messageDeleteBulk\n * @param {Collection<Snowflake, Message>} messages The deleted messages, mapped by their ID\n */\n if (messages.size > 0) client.emit(Events.MESSAGE_BULK_DELETE, messages);\n return { messages };\n }\n return {};\n }\n}\n\nmodule.exports = MessageDeleteBulkAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/MessageDeleteBulk.js?')},"./src/client/actions/MessageReactionAdd.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\nconst { PartialTypes } = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\n/*\n{ user_id: 'id',\n message_id: 'id',\n emoji: { name: '<27>', id: null },\n channel_id: 'id' } }\n*/\n\nclass MessageReactionAdd extends Action {\n handle(data) {\n if (!data.emoji) return false;\n\n const user = this.getUser(data);\n if (!user) return false;\n\n // Verify channel\n const channel = this.getChannel(data);\n if (!channel || channel.type === 'voice') return false;\n\n // Verify message\n const message = this.getMessage(data, channel);\n if (!message) return false;\n\n // Verify reaction\n if (message.partial && !this.client.options.partials.includes(PartialTypes.REACTION)) return false;\n const existing = message.reactions.cache.get(data.emoji.id || data.emoji.name);\n if (existing && existing.users.cache.has(user.id)) return { message, reaction: existing, user };\n const reaction = message.reactions.add({\n emoji: data.emoji,\n count: message.partial ? null : 0,\n me: user.id === this.client.user.id,\n });\n if (!reaction) return false;\n reaction._add(user);\n /**\n * Emitted whenever a reaction is added to a cached message.\n * @event Client#messageReactionAdd\n * @param {MessageReaction} messageReaction The reaction object\n * @param {User} user The user that applied the guild or reaction emoji\n */\n this.client.emit(Events.MESSAGE_REACTION_ADD, reaction, user);\n\n return { message, reaction, user };\n }\n}\n\nmodule.exports = MessageReactionAdd;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/MessageReactionAdd.js?")},"./src/client/actions/MessageReactionRemove.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/Action.js\");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\n/*\n{ user_id: 'id',\n message_id: 'id',\n emoji: { name: '<27>', id: null },\n channel_id: 'id' } }\n*/\n\nclass MessageReactionRemove extends Action {\n handle(data) {\n if (!data.emoji) return false;\n\n const user = this.getUser(data);\n if (!user) return false;\n\n // Verify channel\n const channel = this.getChannel(data);\n if (!channel || channel.type === 'voice') return false;\n\n // Verify message\n const message = this.getMessage(data, channel);\n if (!message) return false;\n\n // Verify reaction\n const reaction = this.getReaction(data, message, user);\n if (!reaction) return false;\n reaction._remove(user);\n /**\n * Emitted whenever a reaction is removed from a cached message.\n * @event Client#messageReactionRemove\n * @param {MessageReaction} messageReaction The reaction object\n * @param {User} user The user whose emoji or reaction emoji was removed\n */\n this.client.emit(Events.MESSAGE_REACTION_REMOVE, reaction, user);\n\n return { message, reaction, user };\n }\n}\n\nmodule.exports = MessageReactionRemove;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/MessageReactionRemove.js?")},"./src/client/actions/MessageReactionRemoveAll.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass MessageReactionRemoveAll extends Action {\n handle(data) {\n // Verify channel\n const channel = this.getChannel(data);\n if (!channel || channel.type === \'voice\') return false;\n\n // Verify message\n const message = this.getMessage(data, channel);\n if (!message) return false;\n\n message.reactions.cache.clear();\n this.client.emit(Events.MESSAGE_REACTION_REMOVE_ALL, message);\n\n return { message };\n }\n}\n\n/**\n * Emitted whenever all reactions are removed from a cached message.\n * @event Client#messageReactionRemoveAll\n * @param {Message} message The message the reactions were removed from\n */\n\nmodule.exports = MessageReactionRemoveAll;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/MessageReactionRemoveAll.js?')},"./src/client/actions/MessageReactionRemoveEmoji.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass MessageReactionRemoveEmoji extends Action {\n handle(data) {\n const channel = this.getChannel(data);\n if (!channel || channel.type === \'voice\') return false;\n\n const message = this.getMessage(data, channel);\n if (!message) return false;\n\n const reaction = this.getReaction(data, message);\n if (!reaction) return false;\n if (!message.partial) message.reactions.cache.delete(reaction.emoji.id || reaction.emoji.name);\n\n /**\n * Emitted when a bot removes an emoji reaction from a cached message.\n * @event Client#messageReactionRemoveEmoji\n * @param {MessageReaction} reaction The reaction that was removed\n */\n this.client.emit(Events.MESSAGE_REACTION_REMOVE_EMOJI, reaction);\n return { reaction };\n }\n}\n\nmodule.exports = MessageReactionRemoveEmoji;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/MessageReactionRemoveEmoji.js?')},"./src/client/actions/MessageUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\n\nclass MessageUpdateAction extends Action {\n handle(data) {\n const channel = this.getChannel(data);\n if (channel) {\n const { id, channel_id, guild_id, author, timestamp, type } = data;\n const message = this.getMessage({ id, channel_id, guild_id, author, timestamp, type }, channel);\n if (message) {\n message.patch(data);\n return {\n old: message._edits[0],\n updated: message,\n };\n }\n }\n\n return {};\n }\n}\n\nmodule.exports = MessageUpdateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/MessageUpdate.js?')},"./src/client/actions/PresenceUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass PresenceUpdateAction extends Action {\n handle(data) {\n let user = this.client.users.cache.get(data.user.id);\n if (!user && data.user.username) user = this.client.users.add(data.user);\n if (!user) return;\n\n if (data.user && data.user.username) {\n if (!user.equals(data.user)) this.client.actions.UserUpdate.handle(data.user);\n }\n\n const guild = this.client.guilds.cache.get(data.guild_id);\n if (!guild) return;\n\n let oldPresence = guild.presences.cache.get(user.id);\n if (oldPresence) oldPresence = oldPresence._clone();\n let member = guild.members.cache.get(user.id);\n if (!member && data.status !== \'offline\') {\n member = guild.members.add({\n user,\n roles: data.roles,\n deaf: false,\n mute: false,\n });\n this.client.emit(Events.GUILD_MEMBER_AVAILABLE, member);\n }\n guild.presences.add(Object.assign(data, { guild }));\n if (member && this.client.listenerCount(Events.PRESENCE_UPDATE)) {\n /**\n * Emitted whenever a guild member\'s presence (e.g. status, activity) is changed.\n * @event Client#presenceUpdate\n * @param {?Presence} oldPresence The presence before the update, if one at all\n * @param {Presence} newPresence The presence after the update\n */\n this.client.emit(Events.PRESENCE_UPDATE, oldPresence, member.presence);\n }\n }\n}\n\nmodule.exports = PresenceUpdateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/PresenceUpdate.js?')},"./src/client/actions/UserUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass UserUpdateAction extends Action {\n handle(data) {\n const client = this.client;\n\n const newUser = client.users.cache.get(data.id);\n const oldUser = newUser._update(data);\n\n if (!oldUser.equals(newUser)) {\n /**\n * Emitted whenever a user\'s details (e.g. username) are changed.\n * Triggered by the Discord gateway events USER_UPDATE, GUILD_MEMBER_UPDATE, and PRESENCE_UPDATE.\n * @event Client#userUpdate\n * @param {User} oldUser The user before the update\n * @param {User} newUser The user after the update\n */\n client.emit(Events.USER_UPDATE, oldUser, newUser);\n return {\n old: oldUser,\n updated: newUser,\n };\n }\n\n return {\n old: null,\n updated: null,\n };\n }\n}\n\nmodule.exports = UserUpdateAction;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/UserUpdate.js?')},"./src/client/actions/VoiceStateUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\nconst Structures = __webpack_require__(/*! ../../util/Structures */ "./src/util/Structures.js");\n\nclass VoiceStateUpdate extends Action {\n handle(data) {\n const client = this.client;\n const guild = client.guilds.cache.get(data.guild_id);\n if (guild) {\n const VoiceState = Structures.get(\'VoiceState\');\n // Update the state\n const oldState = guild.voiceStates.cache.has(data.user_id)\n ? guild.voiceStates.cache.get(data.user_id)._clone()\n : new VoiceState(guild, { user_id: data.user_id });\n\n const newState = guild.voiceStates.add(data);\n\n // Get the member\n let member = guild.members.cache.get(data.user_id);\n if (member && data.member) {\n member._patch(data.member);\n } else if (data.member && data.member.user && data.member.joined_at) {\n member = guild.members.add(data.member);\n }\n\n // Emit event\n if (member && member.user.id === client.user.id) {\n client.emit(\'debug\', `[VOICE] received voice state update: ${JSON.stringify(data)}`);\n client.voice.onVoiceStateUpdate(data);\n }\n\n /**\n * Emitted whenever a member changes voice state - e.g. joins/leaves a channel, mutes/unmutes.\n * @event Client#voiceStateUpdate\n * @param {VoiceState} oldState The voice state before the update\n * @param {VoiceState} newState The voice state after the update\n */\n client.emit(Events.VOICE_STATE_UPDATE, oldState, newState);\n }\n }\n}\n\nmodule.exports = VoiceStateUpdate;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/VoiceStateUpdate.js?')},"./src/client/actions/WebhooksUpdate.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Action = __webpack_require__(/*! ./Action */ "./src/client/actions/Action.js");\nconst { Events } = __webpack_require__(/*! ../../util/Constants */ "./src/util/Constants.js");\n\nclass WebhooksUpdate extends Action {\n handle(data) {\n const client = this.client;\n const channel = client.channels.cache.get(data.channel_id);\n /**\n * Emitted whenever a guild text channel has its webhooks changed.\n * @event Client#webhookUpdate\n * @param {TextChannel} channel The channel that had a webhook update\n */\n if (channel) client.emit(Events.WEBHOOKS_UPDATE, channel);\n }\n}\n\nmodule.exports = WebhooksUpdate;\n\n\n//# sourceURL=webpack://Discord/./src/client/actions/WebhooksUpdate.js?')},"./src/client/websocket/WebSocketManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\nconst WebSocketShard = __webpack_require__(/*! ./WebSocketShard */ \"./src/client/websocket/WebSocketShard.js\");\nconst PacketHandlers = __webpack_require__(/*! ./handlers */ \"./src/client/websocket/handlers/index.js\");\nconst { Error: DJSError } = __webpack_require__(/*! ../../errors */ \"./src/errors/index.js\");\nconst Collection = __webpack_require__(/*! ../../util/Collection */ \"./src/util/Collection.js\");\nconst { Events, ShardEvents, Status, WSCodes, WSEvents } = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\nconst Util = __webpack_require__(/*! ../../util/Util */ \"./src/util/Util.js\");\n\nconst BeforeReadyWhitelist = [\n WSEvents.READY,\n WSEvents.RESUMED,\n WSEvents.GUILD_CREATE,\n WSEvents.GUILD_DELETE,\n WSEvents.GUILD_MEMBERS_CHUNK,\n WSEvents.GUILD_MEMBER_ADD,\n WSEvents.GUILD_MEMBER_REMOVE,\n];\n\nconst UNRECOVERABLE_CLOSE_CODES = Object.keys(WSCodes).slice(1).map(Number);\nconst UNRESUMABLE_CLOSE_CODES = [1000, 4006, 4007];\n\n/**\n * The WebSocket manager for this client.\n * <info>This class forwards raw dispatch events,\n * read more about it here {@link https://discord.com/developers/docs/topics/gateway}</info>\n * @extends EventEmitter\n */\nclass WebSocketManager extends EventEmitter {\n constructor(client) {\n super();\n\n /**\n * The client that instantiated this WebSocketManager\n * @type {Client}\n * @readonly\n * @name WebSocketManager#client\n */\n Object.defineProperty(this, 'client', { value: client });\n\n /**\n * The gateway this manager uses\n * @type {?string}\n */\n this.gateway = undefined;\n\n /**\n * The amount of shards this manager handles\n * @private\n * @type {number}\n */\n this.totalShards = this.client.options.shards.length;\n\n /**\n * A collection of all shards this manager handles\n * @type {Collection<number, WebSocketShard>}\n */\n this.shards = new Collection();\n\n /**\n * An array of shards to be connected or that need to reconnect\n * @type {Set<WebSocketShard>}\n * @private\n * @name WebSocketManager#shardQueue\n */\n Object.defineProperty(this, 'shardQueue', { value: new Set(), writable: true });\n\n /**\n * An array of queued events before this WebSocketManager became ready\n * @type {object[]}\n * @private\n * @name WebSocketManager#packetQueue\n */\n Object.defineProperty(this, 'packetQueue', { value: [] });\n\n /**\n * The current status of this WebSocketManager\n * @type {number}\n */\n this.status = Status.IDLE;\n\n /**\n * If this manager was destroyed. It will prevent shards from reconnecting\n * @type {boolean}\n * @private\n */\n this.destroyed = false;\n\n /**\n * If this manager is currently reconnecting one or multiple shards\n * @type {boolean}\n * @private\n */\n this.reconnecting = false;\n\n /**\n * The current session limit of the client\n * @private\n * @type {?Object}\n * @prop {number} total Total number of identifies available\n * @prop {number} remaining Number of identifies remaining\n * @prop {number} reset_after Number of milliseconds after which the limit resets\n */\n this.sessionStartLimit = undefined;\n }\n\n /**\n * The average ping of all WebSocketShards\n * @type {number}\n * @readonly\n */\n get ping() {\n const sum = this.shards.reduce((a, b) => a + b.ping, 0);\n return sum / this.shards.size;\n }\n\n /**\n * Emits a debug message.\n * @param {string} message The debug message\n * @param {?WebSocketShard} [shard] The shard that emitted this message, if any\n * @private\n */\n debug(message, shard) {\n this.client.emit(Events.DEBUG, `[WS => ${shard ? `Shard ${shard.id}` : 'Manager'}] ${message}`);\n }\n\n /**\n * Connects this manager to the gateway.\n * @private\n */\n async connect() {\n const invalidToken = new DJSError(WSCodes[4004]);\n const {\n url: gatewayURL,\n shards: recommendedShards,\n session_start_limit: sessionStartLimit,\n } = await this.client.api.gateway.bot.get().catch(error => {\n throw error.httpStatus === 401 ? invalidToken : error;\n });\n\n this.sessionStartLimit = sessionStartLimit;\n\n const { total, remaining, reset_after } = sessionStartLimit;\n\n this.debug(`Fetched Gateway Information\n URL: ${gatewayURL}\n Recommended Shards: ${recommendedShards}`);\n\n this.debug(`Session Limit Information\n Total: ${total}\n Remaining: ${remaining}`);\n\n this.gateway = `${gatewayURL}/`;\n\n let { shards } = this.client.options;\n\n if (shards === 'auto') {\n this.debug(`Using the recommended shard count provided by Discord: ${recommendedShards}`);\n this.totalShards = this.client.options.shardCount = recommendedShards;\n shards = this.client.options.shards = Array.from({ length: recommendedShards }, (_, i) => i);\n }\n\n this.totalShards = shards.length;\n this.debug(`Spawning shards: ${shards.join(', ')}`);\n this.shardQueue = new Set(shards.map(id => new WebSocketShard(this, id)));\n\n await this._handleSessionLimit(remaining, reset_after);\n\n return this.createShards();\n }\n\n /**\n * Handles the creation of a shard.\n * @returns {Promise<boolean>}\n * @private\n */\n async createShards() {\n // If we don't have any shards to handle, return\n if (!this.shardQueue.size) return false;\n\n const [shard] = this.shardQueue;\n\n this.shardQueue.delete(shard);\n\n if (!shard.eventsAttached) {\n shard.on(ShardEvents.ALL_READY, unavailableGuilds => {\n /**\n * Emitted when a shard turns ready.\n * @event Client#shardReady\n * @param {number} id The shard ID that turned ready\n * @param {?Set<string>} unavailableGuilds Set of unavailable guild IDs, if any\n */\n this.client.emit(Events.SHARD_READY, shard.id, unavailableGuilds);\n\n if (!this.shardQueue.size) this.reconnecting = false;\n this.checkShardsReady();\n });\n\n shard.on(ShardEvents.CLOSE, event => {\n if (event.code === 1000 ? this.destroyed : UNRECOVERABLE_CLOSE_CODES.includes(event.code)) {\n /**\n * Emitted when a shard's WebSocket disconnects and will no longer reconnect.\n * @event Client#shardDisconnect\n * @param {CloseEvent} event The WebSocket close event\n * @param {number} id The shard ID that disconnected\n */\n this.client.emit(Events.SHARD_DISCONNECT, event, shard.id);\n this.debug(WSCodes[event.code], shard);\n return;\n }\n\n if (UNRESUMABLE_CLOSE_CODES.includes(event.code)) {\n // These event codes cannot be resumed\n shard.sessionID = undefined;\n }\n\n /**\n * Emitted when a shard is attempting to reconnect or re-identify.\n * @event Client#shardReconnecting\n * @param {number} id The shard ID that is attempting to reconnect\n */\n this.client.emit(Events.SHARD_RECONNECTING, shard.id);\n\n this.shardQueue.add(shard);\n\n if (shard.sessionID) {\n this.debug(`Session ID is present, attempting an immediate reconnect...`, shard);\n this.reconnect(true);\n } else {\n shard.destroy({ reset: true, emit: false, log: false });\n this.reconnect();\n }\n });\n\n shard.on(ShardEvents.INVALID_SESSION, () => {\n this.client.emit(Events.SHARD_RECONNECTING, shard.id);\n });\n\n shard.on(ShardEvents.DESTROYED, () => {\n this.debug('Shard was destroyed but no WebSocket connection was present! Reconnecting...', shard);\n\n this.client.emit(Events.SHARD_RECONNECTING, shard.id);\n\n this.shardQueue.add(shard);\n this.reconnect();\n });\n\n shard.eventsAttached = true;\n }\n\n this.shards.set(shard.id, shard);\n\n try {\n await shard.connect();\n } catch (error) {\n if (error && error.code && UNRECOVERABLE_CLOSE_CODES.includes(error.code)) {\n throw new DJSError(WSCodes[error.code]);\n // Undefined if session is invalid, error event for regular closes\n } else if (!error || error.code) {\n this.debug('Failed to connect to the gateway, requeueing...', shard);\n this.shardQueue.add(shard);\n } else {\n throw error;\n }\n }\n // If we have more shards, add a 5s delay\n if (this.shardQueue.size) {\n this.debug(`Shard Queue Size: ${this.shardQueue.size}; continuing in 5 seconds...`);\n await Util.delayFor(5000);\n await this._handleSessionLimit();\n return this.createShards();\n }\n\n return true;\n }\n\n /**\n * Handles reconnects for this manager.\n * @param {boolean} [skipLimit=false] IF this reconnect should skip checking the session limit\n * @private\n * @returns {Promise<boolean>}\n */\n async reconnect(skipLimit = false) {\n if (this.reconnecting || this.status !== Status.READY) return false;\n this.reconnecting = true;\n try {\n if (!skipLimit) await this._handleSessionLimit();\n await this.createShards();\n } catch (error) {\n this.debug(`Couldn't reconnect or fetch information about the gateway. ${error}`);\n if (error.httpStatus !== 401) {\n this.debug(`Possible network error occurred. Retrying in 5s...`);\n await Util.delayFor(5000);\n this.reconnecting = false;\n return this.reconnect();\n }\n // If we get an error at this point, it means we cannot reconnect anymore\n if (this.client.listenerCount(Events.INVALIDATED)) {\n /**\n * Emitted when the client's session becomes invalidated.\n * You are expected to handle closing the process gracefully and preventing a boot loop\n * if you are listening to this event.\n * @event Client#invalidated\n */\n this.client.emit(Events.INVALIDATED);\n // Destroy just the shards. This means you have to handle the cleanup yourself\n this.destroy();\n } else {\n this.client.destroy();\n }\n } finally {\n this.reconnecting = false;\n }\n return true;\n }\n\n /**\n * Broadcasts a packet to every shard this manager handles.\n * @param {Object} packet The packet to send\n * @private\n */\n broadcast(packet) {\n for (const shard of this.shards.values()) shard.send(packet);\n }\n\n /**\n * Destroys this manager and all its shards.\n * @private\n */\n destroy() {\n if (this.destroyed) return;\n this.debug(`Manager was destroyed. Called by:\\n${new Error('MANAGER_DESTROYED').stack}`);\n this.destroyed = true;\n this.shardQueue.clear();\n for (const shard of this.shards.values()) shard.destroy({ closeCode: 1000, reset: true, emit: false, log: false });\n }\n\n /**\n * Handles the timeout required if we cannot identify anymore.\n * @param {number} [remaining] The amount of remaining identify sessions that can be done today\n * @param {number} [resetAfter] The amount of time in which the identify counter resets\n * @private\n */\n async _handleSessionLimit(remaining, resetAfter) {\n if (typeof remaining === 'undefined' && typeof resetAfter === 'undefined') {\n const { session_start_limit } = await this.client.api.gateway.bot.get();\n this.sessionStartLimit = session_start_limit;\n remaining = session_start_limit.remaining;\n resetAfter = session_start_limit.reset_after;\n this.debug(`Session Limit Information\n Total: ${session_start_limit.total}\n Remaining: ${remaining}`);\n }\n if (!remaining) {\n this.debug(`Exceeded identify threshold. Will attempt a connection in ${resetAfter}ms`);\n await Util.delayFor(resetAfter);\n }\n }\n\n /**\n * Processes a packet and queues it if this WebSocketManager is not ready.\n * @param {Object} [packet] The packet to be handled\n * @param {WebSocketShard} [shard] The shard that will handle this packet\n * @returns {boolean}\n * @private\n */\n handlePacket(packet, shard) {\n if (packet && this.status !== Status.READY) {\n if (!BeforeReadyWhitelist.includes(packet.t)) {\n this.packetQueue.push({ packet, shard });\n return false;\n }\n }\n\n if (this.packetQueue.length) {\n const item = this.packetQueue.shift();\n this.client.setImmediate(() => {\n this.handlePacket(item.packet, item.shard);\n });\n }\n\n if (packet && PacketHandlers[packet.t]) {\n PacketHandlers[packet.t](this.client, packet, shard);\n }\n\n return true;\n }\n\n /**\n * Checks whether the client is ready to be marked as ready.\n * @private\n */\n async checkShardsReady() {\n if (this.status === Status.READY) return;\n if (this.shards.size !== this.totalShards || this.shards.some(s => s.status !== Status.READY)) {\n return;\n }\n\n this.status = Status.NEARLY;\n\n if (this.client.options.fetchAllMembers) {\n try {\n const promises = this.client.guilds.cache.map(guild => {\n if (guild.available) return guild.members.fetch();\n // Return empty promise if guild is unavailable\n return Promise.resolve();\n });\n await Promise.all(promises);\n } catch (err) {\n this.debug(`Failed to fetch all members before ready! ${err}\\n${err.stack}`);\n }\n }\n\n this.triggerClientReady();\n }\n\n /**\n * Causes the client to be marked as ready and emits the ready event.\n * @private\n */\n triggerClientReady() {\n this.status = Status.READY;\n\n this.client.readyAt = new Date();\n\n /**\n * Emitted when the client becomes ready to start working.\n * @event Client#ready\n */\n this.client.emit(Events.CLIENT_READY);\n\n this.handlePacket();\n }\n}\n\nmodule.exports = WebSocketManager;\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/WebSocketManager.js?")},"./src/client/websocket/WebSocketShard.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\nconst WebSocket = __webpack_require__(/*! ../../WebSocket */ \"./src/WebSocket.js\");\nconst { browser, Status, Events, ShardEvents, OPCodes, WSEvents } = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nconst STATUS_KEYS = Object.keys(Status);\nconst CONNECTION_STATE = Object.keys(WebSocket.WebSocket);\n\nlet zlib;\n\nif (!browser) {\n try {\n zlib = __webpack_require__(/*! zlib-sync */ 6);\n } catch {} // eslint-disable-line no-empty\n}\n\n/**\n * Represents a Shard's WebSocket connection\n */\nclass WebSocketShard extends EventEmitter {\n constructor(manager, id) {\n super();\n\n /**\n * The WebSocketManager of the shard\n * @type {WebSocketManager}\n */\n this.manager = manager;\n\n /**\n * The ID of the shard\n * @type {number}\n */\n this.id = id;\n\n /**\n * The current status of the shard\n * @type {Status}\n */\n this.status = Status.IDLE;\n\n /**\n * The current sequence of the shard\n * @type {number}\n * @private\n */\n this.sequence = -1;\n\n /**\n * The sequence of the shard after close\n * @type {number}\n * @private\n */\n this.closeSequence = 0;\n\n /**\n * The current session ID of the shard\n * @type {string}\n * @private\n */\n this.sessionID = undefined;\n\n /**\n * The previous heartbeat ping of the shard\n * @type {number}\n */\n this.ping = -1;\n\n /**\n * The last time a ping was sent (a timestamp)\n * @type {number}\n * @private\n */\n this.lastPingTimestamp = -1;\n\n /**\n * If we received a heartbeat ack back. Used to identify zombie connections\n * @type {boolean}\n * @private\n */\n this.lastHeartbeatAcked = true;\n\n /**\n * Contains the rate limit queue and metadata\n * @name WebSocketShard#ratelimit\n * @type {Object}\n * @private\n */\n Object.defineProperty(this, 'ratelimit', {\n value: {\n queue: [],\n total: 120,\n remaining: 120,\n time: 60e3,\n timer: null,\n },\n });\n\n /**\n * The WebSocket connection for the current shard\n * @name WebSocketShard#connection\n * @type {?WebSocket}\n * @private\n */\n Object.defineProperty(this, 'connection', { value: null, writable: true });\n\n /**\n * @external Inflate\n * @see {@link https://www.npmjs.com/package/zlib-sync}\n */\n\n /**\n * The compression to use\n * @name WebSocketShard#inflate\n * @type {?Inflate}\n * @private\n */\n Object.defineProperty(this, 'inflate', { value: null, writable: true });\n\n /**\n * The HELLO timeout\n * @name WebSocketShard#helloTimeout\n * @type {?NodeJS.Timer}\n * @private\n */\n Object.defineProperty(this, 'helloTimeout', { value: undefined, writable: true });\n\n /**\n * If the manager attached its event handlers on the shard\n * @name WebSocketShard#eventsAttached\n * @type {boolean}\n * @private\n */\n Object.defineProperty(this, 'eventsAttached', { value: false, writable: true });\n\n /**\n * A set of guild IDs this shard expects to receive\n * @name WebSocketShard#expectedGuilds\n * @type {?Set<string>}\n * @private\n */\n Object.defineProperty(this, 'expectedGuilds', { value: undefined, writable: true });\n\n /**\n * The ready timeout\n * @name WebSocketShard#readyTimeout\n * @type {?NodeJS.Timer}\n * @private\n */\n Object.defineProperty(this, 'readyTimeout', { value: undefined, writable: true });\n\n /**\n * Time when the WebSocket connection was opened\n * @name WebSocketShard#connectedAt\n * @type {number}\n * @private\n */\n Object.defineProperty(this, 'connectedAt', { value: 0, writable: true });\n }\n\n /**\n * Emits a debug event.\n * @param {string} message The debug message\n * @private\n */\n debug(message) {\n this.manager.debug(message, this);\n }\n\n /**\n * Connects the shard to the gateway.\n * @private\n * @returns {Promise<void>} A promise that will resolve if the shard turns ready successfully,\n * or reject if we couldn't connect\n */\n connect() {\n const { gateway, client } = this.manager;\n\n if (this.connection && this.connection.readyState === WebSocket.OPEN && this.status === Status.READY) {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n const cleanup = () => {\n this.removeListener(ShardEvents.CLOSE, onClose);\n this.removeListener(ShardEvents.READY, onReady);\n this.removeListener(ShardEvents.RESUMED, onResumed);\n this.removeListener(ShardEvents.INVALID_SESSION, onInvalidOrDestroyed);\n this.removeListener(ShardEvents.DESTROYED, onInvalidOrDestroyed);\n };\n\n const onReady = () => {\n cleanup();\n resolve();\n };\n\n const onResumed = () => {\n cleanup();\n resolve();\n };\n\n const onClose = event => {\n cleanup();\n reject(event);\n };\n\n const onInvalidOrDestroyed = () => {\n cleanup();\n // eslint-disable-next-line prefer-promise-reject-errors\n reject();\n };\n\n this.once(ShardEvents.READY, onReady);\n this.once(ShardEvents.RESUMED, onResumed);\n this.once(ShardEvents.CLOSE, onClose);\n this.once(ShardEvents.INVALID_SESSION, onInvalidOrDestroyed);\n this.once(ShardEvents.DESTROYED, onInvalidOrDestroyed);\n\n if (this.connection && this.connection.readyState === WebSocket.OPEN) {\n this.debug('An open connection was found, attempting an immediate identify.');\n this.identify();\n return;\n }\n\n if (this.connection) {\n this.debug(`A connection object was found. Cleaning up before continuing.\n State: ${CONNECTION_STATE[this.connection.readyState]}`);\n this.destroy({ emit: false });\n }\n\n const wsQuery = { v: client.options.ws.version };\n\n if (zlib) {\n this.inflate = new zlib.Inflate({\n chunkSize: 65535,\n flush: zlib.Z_SYNC_FLUSH,\n to: WebSocket.encoding === 'json' ? 'string' : '',\n });\n wsQuery.compress = 'zlib-stream';\n }\n\n this.debug(\n `[CONNECT]\n Gateway : ${gateway}\n Version : ${client.options.ws.version}\n Encoding : ${WebSocket.encoding}\n Compression: ${zlib ? 'zlib-stream' : 'none'}`,\n );\n\n this.status = this.status === Status.DISCONNECTED ? Status.RECONNECTING : Status.CONNECTING;\n this.setHelloTimeout();\n\n this.connectedAt = Date.now();\n\n const ws = (this.connection = WebSocket.create(gateway, wsQuery));\n ws.onopen = this.onOpen.bind(this);\n ws.onmessage = this.onMessage.bind(this);\n ws.onerror = this.onError.bind(this);\n ws.onclose = this.onClose.bind(this);\n });\n }\n\n /**\n * Called whenever a connection is opened to the gateway.\n * @private\n */\n onOpen() {\n this.debug(`[CONNECTED] ${this.connection.url} in ${Date.now() - this.connectedAt}ms`);\n this.status = Status.NEARLY;\n }\n\n /**\n * Called whenever a message is received.\n * @param {MessageEvent} event Event received\n * @private\n */\n onMessage({ data }) {\n let raw;\n if (data instanceof ArrayBuffer) data = new Uint8Array(data);\n if (zlib) {\n const l = data.length;\n const flush =\n l >= 4 && data[l - 4] === 0x00 && data[l - 3] === 0x00 && data[l - 2] === 0xff && data[l - 1] === 0xff;\n\n this.inflate.push(data, flush && zlib.Z_SYNC_FLUSH);\n if (!flush) return;\n raw = this.inflate.result;\n } else {\n raw = data;\n }\n let packet;\n try {\n packet = WebSocket.unpack(raw);\n this.manager.client.emit(Events.RAW, packet, this.id);\n if (packet.op === OPCodes.DISPATCH) this.manager.emit(packet.t, packet.d, this.id);\n } catch (err) {\n this.manager.client.emit(Events.SHARD_ERROR, err, this.id);\n return;\n }\n this.onPacket(packet);\n }\n\n /**\n * Called whenever an error occurs with the WebSocket.\n * @param {ErrorEvent} event The error that occurred\n * @private\n */\n onError(event) {\n const error = event && event.error ? event.error : event;\n if (!error) return;\n\n /**\n * Emitted whenever a shard's WebSocket encounters a connection error.\n * @event Client#shardError\n * @param {Error} error The encountered error\n * @param {number} shardID The shard that encountered this error\n */\n this.manager.client.emit(Events.SHARD_ERROR, error, this.id);\n }\n\n /**\n * @external CloseEvent\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent}\n */\n\n /**\n * @external ErrorEvent\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent}\n */\n\n /**\n * @external MessageEvent\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent}\n */\n\n /**\n * Called whenever a connection to the gateway is closed.\n * @param {CloseEvent} event Close event that was received\n * @private\n */\n onClose(event) {\n if (this.sequence !== -1) this.closeSequence = this.sequence;\n this.sequence = -1;\n\n this.debug(`[CLOSE]\n Event Code: ${event.code}\n Clean : ${event.wasClean}\n Reason : ${event.reason || 'No reason received'}`);\n\n this.setHeartbeatTimer(-1);\n this.setHelloTimeout(-1);\n // If we still have a connection object, clean up its listeners\n if (this.connection) this._cleanupConnection();\n\n this.status = Status.DISCONNECTED;\n\n /**\n * Emitted when a shard's WebSocket closes.\n * @private\n * @event WebSocketShard#close\n * @param {CloseEvent} event The received event\n */\n this.emit(ShardEvents.CLOSE, event);\n }\n\n /**\n * Called whenever a packet is received.\n * @param {Object} packet The received packet\n * @private\n */\n onPacket(packet) {\n if (!packet) {\n this.debug(`Received broken packet: '${packet}'.`);\n return;\n }\n\n switch (packet.t) {\n case WSEvents.READY:\n /**\n * Emitted when the shard receives the READY payload and is now waiting for guilds\n * @event WebSocketShard#ready\n */\n this.emit(ShardEvents.READY);\n\n this.sessionID = packet.d.session_id;\n this.expectedGuilds = new Set(packet.d.guilds.map(d => d.id));\n this.status = Status.WAITING_FOR_GUILDS;\n this.debug(`[READY] Session ${this.sessionID}.`);\n this.lastHeartbeatAcked = true;\n this.sendHeartbeat('ReadyHeartbeat');\n break;\n case WSEvents.RESUMED: {\n /**\n * Emitted when the shard resumes successfully\n * @event WebSocketShard#resumed\n */\n this.emit(ShardEvents.RESUMED);\n\n this.status = Status.READY;\n const replayed = packet.s - this.closeSequence;\n this.debug(`[RESUMED] Session ${this.sessionID} | Replayed ${replayed} events.`);\n this.lastHeartbeatAcked = true;\n this.sendHeartbeat('ResumeHeartbeat');\n break;\n }\n }\n\n if (packet.s > this.sequence) this.sequence = packet.s;\n\n switch (packet.op) {\n case OPCodes.HELLO:\n this.setHelloTimeout(-1);\n this.setHeartbeatTimer(packet.d.heartbeat_interval);\n this.identify();\n break;\n case OPCodes.RECONNECT:\n this.debug('[RECONNECT] Discord asked us to reconnect');\n this.destroy({ closeCode: 4000 });\n break;\n case OPCodes.INVALID_SESSION:\n this.debug(`[INVALID SESSION] Resumable: ${packet.d}.`);\n // If we can resume the session, do so immediately\n if (packet.d) {\n this.identifyResume();\n return;\n }\n // Reset the sequence\n this.sequence = -1;\n // Reset the session ID as it's invalid\n this.sessionID = undefined;\n // Set the status to reconnecting\n this.status = Status.RECONNECTING;\n // Finally, emit the INVALID_SESSION event\n this.emit(ShardEvents.INVALID_SESSION);\n break;\n case OPCodes.HEARTBEAT_ACK:\n this.ackHeartbeat();\n break;\n case OPCodes.HEARTBEAT:\n this.sendHeartbeat('HeartbeatRequest', true);\n break;\n default:\n this.manager.handlePacket(packet, this);\n if (this.status === Status.WAITING_FOR_GUILDS && packet.t === WSEvents.GUILD_CREATE) {\n this.expectedGuilds.delete(packet.d.id);\n this.checkReady();\n }\n }\n }\n\n /**\n * Checks if the shard can be marked as ready\n * @private\n */\n checkReady() {\n // Step 0. Clear the ready timeout, if it exists\n if (this.readyTimeout) {\n this.manager.client.clearTimeout(this.readyTimeout);\n this.readyTimeout = undefined;\n }\n // Step 1. If we don't have any other guilds pending, we are ready\n if (!this.expectedGuilds.size) {\n this.debug('Shard received all its guilds. Marking as fully ready.');\n this.status = Status.READY;\n\n /**\n * Emitted when the shard is fully ready.\n * This event is emitted if:\n * * all guilds were received by this shard\n * * the ready timeout expired, and some guilds are unavailable\n * @event WebSocketShard#allReady\n * @param {?Set<string>} unavailableGuilds Set of unavailable guilds, if any\n */\n this.emit(ShardEvents.ALL_READY);\n return;\n }\n // Step 2. Create a 15s timeout that will mark the shard as ready if there are still unavailable guilds\n this.readyTimeout = this.manager.client.setTimeout(() => {\n this.debug(`Shard did not receive any more guild packets in 15 seconds.\n Unavailable guild count: ${this.expectedGuilds.size}`);\n\n this.readyTimeout = undefined;\n\n this.status = Status.READY;\n\n this.emit(ShardEvents.ALL_READY, this.expectedGuilds);\n }, 15000);\n }\n\n /**\n * Sets the HELLO packet timeout.\n * @param {number} [time] If set to -1, it will clear the hello timeout timeout\n * @private\n */\n setHelloTimeout(time) {\n if (time === -1) {\n if (this.helloTimeout) {\n this.debug('Clearing the HELLO timeout.');\n this.manager.client.clearTimeout(this.helloTimeout);\n this.helloTimeout = undefined;\n }\n return;\n }\n this.debug('Setting a HELLO timeout for 20s.');\n this.helloTimeout = this.manager.client.setTimeout(() => {\n this.debug('Did not receive HELLO in time. Destroying and connecting again.');\n this.destroy({ reset: true, closeCode: 4009 });\n }, 20000);\n }\n\n /**\n * Sets the heartbeat timer for this shard.\n * @param {number} time If -1, clears the interval, any other number sets an interval\n * @private\n */\n setHeartbeatTimer(time) {\n if (time === -1) {\n if (this.heartbeatInterval) {\n this.debug('Clearing the heartbeat interval.');\n this.manager.client.clearInterval(this.heartbeatInterval);\n this.heartbeatInterval = undefined;\n }\n return;\n }\n this.debug(`Setting a heartbeat interval for ${time}ms.`);\n // Sanity checks\n if (this.heartbeatInterval) this.manager.client.clearInterval(this.heartbeatInterval);\n this.heartbeatInterval = this.manager.client.setInterval(() => this.sendHeartbeat(), time);\n }\n\n /**\n * Sends a heartbeat to the WebSocket.\n * If this shard didn't receive a heartbeat last time, it will destroy it and reconnect\n * @param {string} [tag='HeartbeatTimer'] What caused this heartbeat to be sent\n * @param {boolean} [ignoreHeartbeatAck] If we should send the heartbeat forcefully.\n * @private\n */\n sendHeartbeat(\n tag = 'HeartbeatTimer',\n ignoreHeartbeatAck = [Status.WAITING_FOR_GUILDS, Status.IDENTIFYING, Status.RESUMING].includes(this.status),\n ) {\n if (ignoreHeartbeatAck && !this.lastHeartbeatAcked) {\n this.debug(`[${tag}] Didn't process heartbeat ack yet but we are still connected. Sending one now.`);\n } else if (!this.lastHeartbeatAcked) {\n this.debug(\n `[${tag}] Didn't receive a heartbeat ack last time, assuming zombie connection. Destroying and reconnecting.\n Status : ${STATUS_KEYS[this.status]}\n Sequence : ${this.sequence}\n Connection State: ${this.connection ? CONNECTION_STATE[this.connection.readyState] : 'No Connection??'}`,\n );\n\n this.destroy({ closeCode: 4009, reset: true });\n return;\n }\n\n this.debug(`[${tag}] Sending a heartbeat.`);\n this.lastHeartbeatAcked = false;\n this.lastPingTimestamp = Date.now();\n this.send({ op: OPCodes.HEARTBEAT, d: this.sequence }, true);\n }\n\n /**\n * Acknowledges a heartbeat.\n * @private\n */\n ackHeartbeat() {\n this.lastHeartbeatAcked = true;\n const latency = Date.now() - this.lastPingTimestamp;\n this.debug(`Heartbeat acknowledged, latency of ${latency}ms.`);\n this.ping = latency;\n }\n\n /**\n * Identifies the client on the connection.\n * @private\n * @returns {void}\n */\n identify() {\n return this.sessionID ? this.identifyResume() : this.identifyNew();\n }\n\n /**\n * Identifies as a new connection on the gateway.\n * @private\n */\n identifyNew() {\n const { client } = this.manager;\n if (!client.token) {\n this.debug('[IDENTIFY] No token available to identify a new session.');\n return;\n }\n\n this.status = Status.IDENTIFYING;\n\n // Clone the identify payload and assign the token and shard info\n const d = {\n ...client.options.ws,\n token: client.token,\n shard: [this.id, Number(client.options.shardCount)],\n };\n\n this.debug(`[IDENTIFY] Shard ${this.id}/${client.options.shardCount}`);\n this.send({ op: OPCodes.IDENTIFY, d }, true);\n }\n\n /**\n * Resumes a session on the gateway.\n * @private\n */\n identifyResume() {\n if (!this.sessionID) {\n this.debug('[RESUME] No session ID was present; identifying as a new session.');\n this.identifyNew();\n return;\n }\n\n this.status = Status.RESUMING;\n\n this.debug(`[RESUME] Session ${this.sessionID}, sequence ${this.closeSequence}`);\n\n const d = {\n token: this.manager.client.token,\n session_id: this.sessionID,\n seq: this.closeSequence,\n };\n\n this.send({ op: OPCodes.RESUME, d }, true);\n }\n\n /**\n * Adds a packet to the queue to be sent to the gateway.\n * <warn>If you use this method, make sure you understand that you need to provide\n * a full [Payload](https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-commands).\n * Do not use this method if you don't know what you're doing.</warn>\n * @param {Object} data The full packet to send\n * @param {boolean} [important=false] If this packet should be added first in queue\n */\n send(data, important = false) {\n this.ratelimit.queue[important ? 'unshift' : 'push'](data);\n this.processQueue();\n }\n\n /**\n * Sends data, bypassing the queue.\n * @param {Object} data Packet to send\n * @returns {void}\n * @private\n */\n _send(data) {\n if (!this.connection || this.connection.readyState !== WebSocket.OPEN) {\n this.debug(`Tried to send packet '${JSON.stringify(data)}' but no WebSocket is available!`);\n this.destroy({ close: 4000 });\n return;\n }\n\n this.connection.send(WebSocket.pack(data), err => {\n if (err) this.manager.client.emit(Events.SHARD_ERROR, err, this.id);\n });\n }\n\n /**\n * Processes the current WebSocket queue.\n * @returns {void}\n * @private\n */\n processQueue() {\n if (this.ratelimit.remaining === 0) return;\n if (this.ratelimit.queue.length === 0) return;\n if (this.ratelimit.remaining === this.ratelimit.total) {\n this.ratelimit.timer = this.manager.client.setTimeout(() => {\n this.ratelimit.remaining = this.ratelimit.total;\n this.processQueue();\n }, this.ratelimit.time);\n }\n while (this.ratelimit.remaining > 0) {\n const item = this.ratelimit.queue.shift();\n if (!item) return;\n this._send(item);\n this.ratelimit.remaining--;\n }\n }\n\n /**\n * Destroys this shard and closes its WebSocket connection.\n * @param {Object} [options={ closeCode: 1000, reset: false, emit: true, log: true }] Options for destroying the shard\n * @private\n */\n destroy({ closeCode = 1000, reset = false, emit = true, log = true } = {}) {\n if (log) {\n this.debug(`[DESTROY]\n Close Code : ${closeCode}\n Reset : ${reset}\n Emit DESTROYED: ${emit}`);\n }\n\n // Step 0: Remove all timers\n this.setHeartbeatTimer(-1);\n this.setHelloTimeout(-1);\n\n // Step 1: Close the WebSocket connection, if any, otherwise, emit DESTROYED\n if (this.connection) {\n // If the connection is currently opened, we will (hopefully) receive close\n if (this.connection.readyState === WebSocket.OPEN) {\n this.connection.close(closeCode);\n } else {\n // Connection is not OPEN\n this.debug(`WS State: ${CONNECTION_STATE[this.connection.readyState]}`);\n // Remove listeners from the connection\n this._cleanupConnection();\n // Attempt to close the connection just in case\n try {\n this.connection.close(closeCode);\n } catch {\n // No-op\n }\n // Emit the destroyed event if needed\n if (emit) this._emitDestroyed();\n }\n } else if (emit) {\n // We requested a destroy, but we had no connection. Emit destroyed\n this._emitDestroyed();\n }\n\n // Step 2: Null the connection object\n this.connection = null;\n\n // Step 3: Set the shard status to DISCONNECTED\n this.status = Status.DISCONNECTED;\n\n // Step 4: Cache the old sequence (use to attempt a resume)\n if (this.sequence !== -1) this.closeSequence = this.sequence;\n\n // Step 5: Reset the sequence and session ID if requested\n if (reset) {\n this.sequence = -1;\n this.sessionID = undefined;\n }\n\n // Step 6: reset the ratelimit data\n this.ratelimit.remaining = this.ratelimit.total;\n this.ratelimit.queue.length = 0;\n if (this.ratelimit.timer) {\n this.manager.client.clearTimeout(this.ratelimit.timer);\n this.ratelimit.timer = null;\n }\n }\n\n /**\n * Cleans up the WebSocket connection listeners.\n * @private\n */\n _cleanupConnection() {\n this.connection.onopen = this.connection.onclose = this.connection.onerror = this.connection.onmessage = null;\n }\n\n /**\n * Emits the DESTROYED event on the shard\n * @private\n */\n _emitDestroyed() {\n /**\n * Emitted when a shard is destroyed, but no WebSocket connection was present.\n * @private\n * @event WebSocketShard#destroyed\n */\n this.emit(ShardEvents.DESTROYED);\n }\n}\n\nmodule.exports = WebSocketShard;\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/WebSocketShard.js?")},"./src/client/websocket/handlers sync recursive ^\\.\\/.*\\.js$":function(module,exports,__webpack_require__){eval('var map = {\n\t"./CHANNEL_CREATE.js": "./src/client/websocket/handlers/CHANNEL_CREATE.js",\n\t"./CHANNEL_DELETE.js": "./src/client/websocket/handlers/CHANNEL_DELETE.js",\n\t"./CHANNEL_PINS_UPDATE.js": "./src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js",\n\t"./CHANNEL_UPDATE.js": "./src/client/websocket/handlers/CHANNEL_UPDATE.js",\n\t"./GUILD_BAN_ADD.js": "./src/client/websocket/handlers/GUILD_BAN_ADD.js",\n\t"./GUILD_BAN_REMOVE.js": "./src/client/websocket/handlers/GUILD_BAN_REMOVE.js",\n\t"./GUILD_CREATE.js": "./src/client/websocket/handlers/GUILD_CREATE.js",\n\t"./GUILD_DELETE.js": "./src/client/websocket/handlers/GUILD_DELETE.js",\n\t"./GUILD_EMOJIS_UPDATE.js": "./src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js",\n\t"./GUILD_INTEGRATIONS_UPDATE.js": "./src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js",\n\t"./GUILD_MEMBERS_CHUNK.js": "./src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js",\n\t"./GUILD_MEMBER_ADD.js": "./src/client/websocket/handlers/GUILD_MEMBER_ADD.js",\n\t"./GUILD_MEMBER_REMOVE.js": "./src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js",\n\t"./GUILD_MEMBER_UPDATE.js": "./src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js",\n\t"./GUILD_ROLE_CREATE.js": "./src/client/websocket/handlers/GUILD_ROLE_CREATE.js",\n\t"./GUILD_ROLE_DELETE.js": "./src/client/websocket/handlers/GUILD_ROLE_DELETE.js",\n\t"./GUILD_ROLE_UPDATE.js": "./src/client/websocket/handlers/GUILD_ROLE_UPDATE.js",\n\t"./GUILD_UPDATE.js": "./src/client/websocket/handlers/GUILD_UPDATE.js",\n\t"./INVITE_CREATE.js": "./src/client/websocket/handlers/INVITE_CREATE.js",\n\t"./INVITE_DELETE.js": "./src/client/websocket/handlers/INVITE_DELETE.js",\n\t"./MESSAGE_CREATE.js": "./src/client/websocket/handlers/MESSAGE_CREATE.js",\n\t"./MESSAGE_DELETE.js": "./src/client/websocket/handlers/MESSAGE_DELETE.js",\n\t"./MESSAGE_DELETE_BULK.js": "./src/client/websocket/handlers/MESSAGE_DELETE_BULK.js",\n\t"./MESSAGE_REACTION_ADD.js": "./src/client/websocket/handlers/MESSAGE_REACTION_ADD.js",\n\t"./MESSAGE_REACTION_REMOVE.js": "./src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js",\n\t"./MESSAGE_REACTION_REMOVE_ALL.js": "./src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js",\n\t"./MESSAGE_REACTION_REMOVE_EMOJI.js": "./src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js",\n\t"./MESSAGE_UPDATE.js": "./src/client/websocket/handlers/MESSAGE_UPDATE.js",\n\t"./PRESENCE_UPDATE.js": "./src/client/websocket/handlers/PRESENCE_UPDATE.js",\n\t"./READY.js": "./src/client/websocket/handlers/READY.js",\n\t"./RESUMED.js": "./src/client/websocket/handlers/RESUMED.js",\n\t"./TYPING_START.js": "./src/client/websocket/handlers/TYPING_START.js",\n\t"./USER_UPDATE.js": "./src/client/websocket/handlers/USER_UPDATE.js",\n\t"./VOICE_SERVER_UPDATE.js": "./src/client/websocket/handlers/VOICE_SERVER_UPDATE.js",\n\t"./VOICE_STATE_UPDATE.js": "./src/client/websocket/handlers/VOICE_STATE_UPDATE.js",\n\t"./WEBHOOKS_UPDATE.js": "./src/client/websocket/handlers/WEBHOOKS_UPDATE.js",\n\t"./index.js": "./src/client/websocket/handlers/index.js"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error("Cannot find module \'" + req + "\'");\n\t\te.code = \'MODULE_NOT_FOUND\';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = "./src/client/websocket/handlers sync recursive ^\\\\.\\\\/.*\\\\.js$";\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers_sync_^\\.\\/.*\\.js$?')},"./src/client/websocket/handlers/CHANNEL_CREATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.ChannelCreate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/CHANNEL_CREATE.js?")},"./src/client/websocket/handlers/CHANNEL_DELETE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.ChannelDelete.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/CHANNEL_DELETE.js?")},"./src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { Events } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nmodule.exports = (client, { d: data }) => {\n const channel = client.channels.cache.get(data.channel_id);\n const time = new Date(data.last_pin_timestamp);\n\n if (channel && !Number.isNaN(time.getTime())) {\n // Discord sends null for last_pin_timestamp if the last pinned message was removed\n channel.lastPinTimestamp = time.getTime() || null;\n\n /**\n * Emitted whenever the pins of a channel are updated. Due to the nature of the WebSocket event,\n * not much information can be provided easily here - you need to manually check the pins yourself.\n * @event Client#channelPinsUpdate\n * @param {DMChannel|TextChannel} channel The channel that the pins update occurred in\n * @param {Date} time The time of the pins update\n */\n client.emit(Events.CHANNEL_PINS_UPDATE, channel, time);\n }\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js?')},"./src/client/websocket/handlers/CHANNEL_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { Events } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nmodule.exports = (client, packet) => {\n const { old, updated } = client.actions.ChannelUpdate.handle(packet.d);\n if (old && updated) {\n /**\n * Emitted whenever a channel is updated - e.g. name change, topic change, channel type change.\n * @event Client#channelUpdate\n * @param {DMChannel|GuildChannel} oldChannel The channel before the update\n * @param {DMChannel|GuildChannel} newChannel The channel after the update\n */\n client.emit(Events.CHANNEL_UPDATE, old, updated);\n }\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/CHANNEL_UPDATE.js?')},"./src/client/websocket/handlers/GUILD_BAN_ADD.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { Events } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nmodule.exports = (client, { d: data }) => {\n const guild = client.guilds.cache.get(data.guild_id);\n const user = client.users.add(data.user);\n\n /**\n * Emitted whenever a member is banned from a guild.\n * @event Client#guildBanAdd\n * @param {Guild} guild The guild that the ban occurred in\n * @param {User} user The user that was banned\n */\n if (guild && user) client.emit(Events.GUILD_BAN_ADD, guild, user);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_BAN_ADD.js?')},"./src/client/websocket/handlers/GUILD_BAN_REMOVE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.GuildBanRemove.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_BAN_REMOVE.js?")},"./src/client/websocket/handlers/GUILD_CREATE.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { Events, Status } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nmodule.exports = async (client, { d: data }, shard) => {\n let guild = client.guilds.cache.get(data.id);\n if (guild) {\n if (!guild.available && !data.unavailable) {\n // A newly available guild\n guild._patch(data);\n // If the client was ready before and we had unavailable guilds, fetch them\n if (client.ws.status === Status.READY && client.options.fetchAllMembers) {\n await guild.members\n .fetch()\n .catch(err => client.emit(Events.DEBUG, `Failed to fetch all members: ${err}\\n${err.stack}`));\n }\n }\n } else {\n // A new guild\n data.shardID = shard.id;\n guild = client.guilds.add(data);\n if (client.ws.status === Status.READY) {\n /**\n * Emitted whenever the client joins a guild.\n * @event Client#guildCreate\n * @param {Guild} guild The created guild\n */\n if (client.options.fetchAllMembers) {\n await guild.members\n .fetch()\n .catch(err => client.emit(Events.DEBUG, `Failed to fetch all members: ${err}\\n${err.stack}`));\n }\n client.emit(Events.GUILD_CREATE, guild);\n }\n }\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_CREATE.js?')},"./src/client/websocket/handlers/GUILD_DELETE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.GuildDelete.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_DELETE.js?")},"./src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.GuildEmojisUpdate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js?")},"./src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.GuildIntegrationsUpdate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js?")},"./src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Collection = __webpack_require__(/*! ../../../util/Collection */ "./src/util/Collection.js");\nconst { Events } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nmodule.exports = (client, { d: data }) => {\n const guild = client.guilds.cache.get(data.guild_id);\n if (!guild) return;\n const members = new Collection();\n\n for (const member of data.members) members.set(member.user.id, guild.members.add(member));\n if (data.presences) {\n for (const presence of data.presences) guild.presences.add(Object.assign(presence, { guild }));\n }\n /**\n * Emitted whenever a chunk of guild members is received (all members come from the same guild).\n * @event Client#guildMembersChunk\n * @param {Collection<Snowflake, GuildMember>} members The members in the chunk\n * @param {Guild} guild The guild related to the member chunk\n * @param {Object} chunk Properties of the received chunk\n * @param {number} chunk.index Index of the received chunk\n * @param {number} chunk.count Number of chunks the client should receive\n * @param {?string} chunk.nonce Nonce for this chunk\n */\n client.emit(Events.GUILD_MEMBERS_CHUNK, members, guild, {\n count: data.chunk_count,\n index: data.chunk_index,\n nonce: data.nonce,\n });\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js?')},"./src/client/websocket/handlers/GUILD_MEMBER_ADD.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { Events, Status } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nmodule.exports = (client, { d: data }, shard) => {\n const guild = client.guilds.cache.get(data.guild_id);\n if (guild) {\n guild.memberCount++;\n const member = guild.members.add(data);\n if (shard.status === Status.READY) {\n /**\n * Emitted whenever a user joins a guild.\n * @event Client#guildMemberAdd\n * @param {GuildMember} member The member that has joined a guild\n */\n client.emit(Events.GUILD_MEMBER_ADD, member);\n }\n }\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_MEMBER_ADD.js?')},"./src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet, shard) => {\n client.actions.GuildMemberRemove.handle(packet.d, shard);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js?")},"./src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { Status, Events } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nmodule.exports = (client, { d: data }, shard) => {\n let user = client.users.cache.get(data.user.id);\n if (!user && data.user.username) user = client.users.add(data.user);\n if (user && data.user && data.user.username) {\n if (!user.equals(data.user)) client.actions.UserUpdate.handle(data.user);\n }\n\n const guild = client.guilds.cache.get(data.guild_id);\n if (guild) {\n const member = guild.members.cache.get(data.user.id);\n if (member) {\n const old = member._update(data);\n if (shard.status === Status.READY) {\n /**\n * Emitted whenever a guild member changes - i.e. new role, removed role, nickname.\n * Also emitted when the user\'s details (e.g. username) change.\n * @event Client#guildMemberUpdate\n * @param {GuildMember} oldMember The member before the update\n * @param {GuildMember} newMember The member after the update\n */\n client.emit(Events.GUILD_MEMBER_UPDATE, old, member);\n }\n }\n }\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js?')},"./src/client/websocket/handlers/GUILD_ROLE_CREATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.GuildRoleCreate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_ROLE_CREATE.js?")},"./src/client/websocket/handlers/GUILD_ROLE_DELETE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.GuildRoleDelete.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_ROLE_DELETE.js?")},"./src/client/websocket/handlers/GUILD_ROLE_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.GuildRoleUpdate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_ROLE_UPDATE.js?")},"./src/client/websocket/handlers/GUILD_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.GuildUpdate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/GUILD_UPDATE.js?")},"./src/client/websocket/handlers/INVITE_CREATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.InviteCreate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/INVITE_CREATE.js?")},"./src/client/websocket/handlers/INVITE_DELETE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.InviteDelete.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/INVITE_DELETE.js?")},"./src/client/websocket/handlers/MESSAGE_CREATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.MessageCreate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/MESSAGE_CREATE.js?")},"./src/client/websocket/handlers/MESSAGE_DELETE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.MessageDelete.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/MESSAGE_DELETE.js?")},"./src/client/websocket/handlers/MESSAGE_DELETE_BULK.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.MessageDeleteBulk.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/MESSAGE_DELETE_BULK.js?")},"./src/client/websocket/handlers/MESSAGE_REACTION_ADD.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.MessageReactionAdd.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/MESSAGE_REACTION_ADD.js?")},"./src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.MessageReactionRemove.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js?")},"./src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.MessageReactionRemoveAll.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js?")},"./src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.MessageReactionRemoveEmoji.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js?")},"./src/client/websocket/handlers/MESSAGE_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { Events } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nmodule.exports = (client, packet) => {\n const { old, updated } = client.actions.MessageUpdate.handle(packet.d);\n if (old && updated) {\n /**\n * Emitted whenever a message is updated - e.g. embed or content change.\n * @event Client#messageUpdate\n * @param {Message} oldMessage The message before the update\n * @param {Message} newMessage The message after the update\n */\n client.emit(Events.MESSAGE_UPDATE, old, updated);\n }\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/MESSAGE_UPDATE.js?')},"./src/client/websocket/handlers/PRESENCE_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.PresenceUpdate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/PRESENCE_UPDATE.js?")},"./src/client/websocket/handlers/READY.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nlet ClientUser;\n\nmodule.exports = (client, { d: data }, shard) => {\n if (client.user) {\n client.user._patch(data.user);\n } else {\n if (!ClientUser) ClientUser = __webpack_require__(/*! ../../../structures/ClientUser */ "./src/structures/ClientUser.js");\n const clientUser = new ClientUser(client, data.user);\n client.user = clientUser;\n client.users.cache.set(clientUser.id, clientUser);\n }\n\n for (const guild of data.guilds) {\n guild.shardID = shard.id;\n client.guilds.add(guild);\n }\n\n shard.checkReady();\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/READY.js?')},"./src/client/websocket/handlers/RESUMED.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { Events } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nmodule.exports = (client, packet, shard) => {\n const replayed = shard.sequence - shard.closeSequence;\n /**\n * Emitted when a shard resumes successfully.\n * @event Client#shardResume\n * @param {number} id The shard ID that resumed\n * @param {number} replayedEvents The amount of replayed events\n */\n client.emit(Events.SHARD_RESUME, shard.id, replayed);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/RESUMED.js?')},"./src/client/websocket/handlers/TYPING_START.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst { Events } = __webpack_require__(/*! ../../../util/Constants */ \"./src/util/Constants.js\");\nconst textBasedChannelTypes = ['dm', 'text', 'news'];\n\nmodule.exports = (client, { d: data }) => {\n const channel = client.channels.cache.get(data.channel_id);\n const user = client.users.cache.get(data.user_id);\n const timestamp = new Date(data.timestamp * 1000);\n\n if (channel && user) {\n if (!textBasedChannelTypes.includes(channel.type)) {\n client.emit(Events.WARN, `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`);\n return;\n }\n\n if (channel._typing.has(user.id)) {\n const typing = channel._typing.get(user.id);\n\n typing.lastTimestamp = timestamp;\n typing.elapsedTime = Date.now() - typing.since;\n client.clearTimeout(typing.timeout);\n typing.timeout = tooLate(channel, user);\n } else {\n const since = new Date();\n const lastTimestamp = new Date();\n channel._typing.set(user.id, {\n user,\n since,\n lastTimestamp,\n elapsedTime: Date.now() - since,\n timeout: tooLate(channel, user),\n });\n\n /**\n * Emitted whenever a user starts typing in a channel.\n * @event Client#typingStart\n * @param {Channel} channel The channel the user started typing in\n * @param {User} user The user that started typing\n */\n client.emit(Events.TYPING_START, channel, user);\n }\n }\n};\n\nfunction tooLate(channel, user) {\n return channel.client.setTimeout(() => {\n channel._typing.delete(user.id);\n }, 10000);\n}\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/TYPING_START.js?")},"./src/client/websocket/handlers/USER_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.UserUpdate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/USER_UPDATE.js?")},"./src/client/websocket/handlers/VOICE_SERVER_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.emit('debug', `[VOICE] received voice server: ${JSON.stringify(packet)}`);\n client.voice.onVoiceServer(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/VOICE_SERVER_UPDATE.js?")},"./src/client/websocket/handlers/VOICE_STATE_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.VoiceStateUpdate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/VOICE_STATE_UPDATE.js?")},"./src/client/websocket/handlers/WEBHOOKS_UPDATE.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (client, packet) => {\n client.actions.WebhooksUpdate.handle(packet.d);\n};\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/WEBHOOKS_UPDATE.js?")},"./src/client/websocket/handlers/index.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst { WSEvents } = __webpack_require__(/*! ../../../util/Constants */ "./src/util/Constants.js");\n\nconst handlers = {};\n\nfor (const name of Object.keys(WSEvents)) {\n try {\n handlers[name] = __webpack_require__("./src/client/websocket/handlers sync recursive ^\\\\.\\\\/.*\\\\.js$")(`./${name}.js`);\n } catch {} // eslint-disable-line no-empty\n}\n\nmodule.exports = handlers;\n\n\n//# sourceURL=webpack://Discord/./src/client/websocket/handlers/index.js?')},"./src/errors/DJSError.js":function(module,exports,__webpack_require__){"use strict";eval("\n\n// Heavily inspired by node's `internal/errors` module\n\nconst kCode = Symbol('code');\nconst messages = new Map();\n\n/**\n * Extend an error of some sort into a DiscordjsError.\n * @param {Error} Base Base error to extend\n * @returns {DiscordjsError}\n */\nfunction makeDiscordjsError(Base) {\n return class DiscordjsError extends Base {\n constructor(key, ...args) {\n super(message(key, args));\n this[kCode] = key;\n if (Error.captureStackTrace) Error.captureStackTrace(this, DiscordjsError);\n }\n\n get name() {\n return `${super.name} [${this[kCode]}]`;\n }\n\n get code() {\n return this[kCode];\n }\n };\n}\n\n/**\n * Format the message for an error.\n * @param {string} key Error key\n * @param {Array<*>} args Arguments to pass for util format or as function args\n * @returns {string} Formatted string\n */\nfunction message(key, args) {\n if (typeof key !== 'string') throw new Error('Error message key must be a string');\n const msg = messages.get(key);\n if (!msg) throw new Error(`An invalid error message key was used: ${key}.`);\n if (typeof msg === 'function') return msg(...args);\n if (args === undefined || args.length === 0) return msg;\n args.unshift(msg);\n return String(...args);\n}\n\n/**\n * Register an error code and message.\n * @param {string} sym Unique name for the error\n * @param {*} val Value of the error\n */\nfunction register(sym, val) {\n messages.set(sym, typeof val === 'function' ? val : String(val));\n}\n\nmodule.exports = {\n register,\n Error: makeDiscordjsError(Error),\n TypeError: makeDiscordjsError(TypeError),\n RangeError: makeDiscordjsError(RangeError),\n};\n\n\n//# sourceURL=webpack://Discord/./src/errors/DJSError.js?")},"./src/errors/Messages.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst { register } = __webpack_require__(/*! ./DJSError */ \"./src/errors/DJSError.js\");\n\nconst Messages = {\n CLIENT_INVALID_OPTION: (prop, must) => `The ${prop} option must be ${must}`,\n CLIENT_INVALID_PROVIDED_SHARDS: 'None of the provided shards were valid.',\n\n TOKEN_INVALID: 'An invalid token was provided.',\n TOKEN_MISSING: 'Request to use token, but token was unavailable to the client.',\n\n WS_CLOSE_REQUESTED: 'WebSocket closed due to user request.',\n WS_CONNECTION_EXISTS: 'There is already an existing WebSocket connection.',\n WS_NOT_OPEN: (data = 'data') => `Websocket not open to send ${data}`,\n\n BITFIELD_INVALID: 'Invalid bitfield flag or number.',\n\n SHARDING_INVALID: 'Invalid shard settings were provided.',\n SHARDING_REQUIRED: 'This session would have handled too many guilds - Sharding is required.',\n INVALID_INTENTS: 'Invalid intent provided for WebSocket intents.',\n DISALLOWED_INTENTS: 'Privileged intent provided is not enabled or whitelisted.',\n SHARDING_NO_SHARDS: 'No shards have been spawned.',\n SHARDING_IN_PROCESS: 'Shards are still being spawned.',\n SHARDING_ALREADY_SPAWNED: count => `Already spawned ${count} shards.`,\n SHARDING_PROCESS_EXISTS: id => `Shard ${id} already has an active process.`,\n SHARDING_READY_TIMEOUT: id => `Shard ${id}'s Client took too long to become ready.`,\n SHARDING_READY_DISCONNECTED: id => `Shard ${id}'s Client disconnected before becoming ready.`,\n SHARDING_READY_DIED: id => `Shard ${id}'s process exited before its Client became ready.`,\n\n COLOR_RANGE: 'Color must be within the range 0 - 16777215 (0xFFFFFF).',\n COLOR_CONVERT: 'Unable to convert color to a number.',\n\n EMBED_FIELD_NAME: 'MessageEmbed field names may not be empty.',\n EMBED_FIELD_VALUE: 'MessageEmbed field values may not be empty.',\n\n FILE_NOT_FOUND: file => `File could not be found: ${file}`,\n\n USER_NO_DMCHANNEL: 'No DM Channel exists!',\n\n VOICE_INVALID_HEARTBEAT: 'Tried to set voice heartbeat but no valid interval was specified.',\n VOICE_USER_MISSING: \"Couldn't resolve the user to create stream.\",\n VOICE_JOIN_CHANNEL: (full = false) =>\n `You do not have permission to join this voice channel${full ? '; it is full.' : '.'}`,\n VOICE_CONNECTION_TIMEOUT: 'Connection not established within 15 seconds.',\n VOICE_TOKEN_ABSENT: 'Token not provided from voice server packet.',\n VOICE_SESSION_ABSENT: 'Session ID not supplied.',\n VOICE_INVALID_ENDPOINT: 'Invalid endpoint received.',\n VOICE_NO_BROWSER: 'Voice connections are not available in browsers.',\n VOICE_CONNECTION_ATTEMPTS_EXCEEDED: attempts => `Too many connection attempts (${attempts}).`,\n VOICE_JOIN_SOCKET_CLOSED: 'Tried to send join packet, but the WebSocket is not open.',\n VOICE_PLAY_INTERFACE_NO_BROADCAST: 'A broadcast cannot be played in this context.',\n VOICE_PLAY_INTERFACE_BAD_TYPE: 'Unknown stream type',\n VOICE_PRISM_DEMUXERS_NEED_STREAM: 'To play a webm/ogg stream, you need to pass a ReadableStream.',\n\n VOICE_STATE_UNCACHED_MEMBER: 'The member of this voice state is uncached.',\n VOICE_STATE_NOT_OWN: 'You cannot self-deafen/mute on VoiceStates that do not belong to the ClientUser.',\n VOICE_STATE_INVALID_TYPE: name => `${name} must be a boolean.`,\n\n UDP_SEND_FAIL: 'Tried to send a UDP packet, but there is no socket available.',\n UDP_ADDRESS_MALFORMED: 'Malformed UDP address or port.',\n UDP_CONNECTION_EXISTS: 'There is already an existing UDP connection.',\n\n REQ_RESOURCE_TYPE: 'The resource must be a string, Buffer or a valid file stream.',\n\n IMAGE_FORMAT: format => `Invalid image format: ${format}`,\n IMAGE_SIZE: size => `Invalid image size: ${size}`,\n\n MESSAGE_BULK_DELETE_TYPE: 'The messages must be an Array, Collection, or number.',\n MESSAGE_NONCE_TYPE: 'Message nonce must fit in an unsigned 64-bit integer.',\n\n TYPING_COUNT: 'Count must be at least 1',\n\n SPLIT_MAX_LEN: 'Chunk exceeds the max length and contains no split characters.',\n\n BAN_RESOLVE_ID: (ban = false) => `Couldn't resolve the user ID to ${ban ? 'ban' : 'unban'}.`,\n FETCH_BAN_RESOLVE_ID: \"Couldn't resolve the user ID to fetch the ban.\",\n\n PRUNE_DAYS_TYPE: 'Days must be a number',\n\n GUILD_CHANNEL_RESOLVE: 'Could not resolve channel to a guild channel.',\n GUILD_VOICE_CHANNEL_RESOLVE: 'Could not resolve channel to a guild voice channel.',\n GUILD_CHANNEL_ORPHAN: 'Could not find a parent to this guild channel.',\n GUILD_OWNED: 'Guild is owned by the client.',\n GUILD_MEMBERS_TIMEOUT: \"Members didn't arrive in time.\",\n GUILD_UNCACHED_ME: 'The client user as a member of this guild is uncached.',\n\n INVALID_TYPE: (name, expected, an = false) => `Supplied ${name} is not a${an ? 'n' : ''} ${expected}.`,\n\n WEBHOOK_MESSAGE: 'The message was not sent by a webhook.',\n\n EMOJI_TYPE: 'Emoji must be a string or GuildEmoji/ReactionEmoji',\n EMOJI_MANAGED: 'Emoji is managed and has no Author.',\n MISSING_MANAGE_EMOJIS_PERMISSION: guild =>\n `Client must have Manage Emoji permission in guild ${guild} to see emoji authors.`,\n\n REACTION_RESOLVE_USER: \"Couldn't resolve the user ID to remove from the reaction.\",\n\n VANITY_URL: 'This guild does not have the VANITY_URL feature enabled.',\n\n DELETE_GROUP_DM_CHANNEL: \"Bots don't have access to Group DM Channels and cannot delete them\",\n FETCH_GROUP_DM_CHANNEL: \"Bots don't have access to Group DM Channels and cannot fetch them\",\n\n MEMBER_FETCH_NONCE_LENGTH: 'Nonce length must not exceed 32 characters.',\n};\n\nfor (const [name, message] of Object.entries(Messages)) register(name, message);\n\n\n//# sourceURL=webpack://Discord/./src/errors/Messages.js?")},"./src/errors/index.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nmodule.exports = __webpack_require__(/*! ./DJSError */ "./src/errors/DJSError.js");\nmodule.exports.Messages = __webpack_require__(/*! ./Messages */ "./src/errors/Messages.js");\n\n\n//# sourceURL=webpack://Discord/./src/errors/index.js?')},"./src/index.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Util = __webpack_require__(/*! ./util/Util */ "./src/util/Util.js");\n\nmodule.exports = {\n // "Root" classes (starting points)\n BaseClient: __webpack_require__(/*! ./client/BaseClient */ "./src/client/BaseClient.js"),\n Client: __webpack_require__(/*! ./client/Client */ "./src/client/Client.js"),\n Shard: __webpack_require__(/*! ./sharding/Shard */ 9),\n ShardClientUtil: __webpack_require__(/*! ./sharding/ShardClientUtil */ 10),\n ShardingManager: __webpack_require__(/*! ./sharding/ShardingManager */ 11),\n WebhookClient: __webpack_require__(/*! ./client/WebhookClient */ "./src/client/WebhookClient.js"),\n\n // Utilities\n ActivityFlags: __webpack_require__(/*! ./util/ActivityFlags */ "./src/util/ActivityFlags.js"),\n BitField: __webpack_require__(/*! ./util/BitField */ "./src/util/BitField.js"),\n Collection: __webpack_require__(/*! ./util/Collection */ "./src/util/Collection.js"),\n Constants: __webpack_require__(/*! ./util/Constants */ "./src/util/Constants.js"),\n DataResolver: __webpack_require__(/*! ./util/DataResolver */ "./src/util/DataResolver.js"),\n BaseManager: __webpack_require__(/*! ./managers/BaseManager */ "./src/managers/BaseManager.js"),\n DiscordAPIError: __webpack_require__(/*! ./rest/DiscordAPIError */ "./src/rest/DiscordAPIError.js"),\n HTTPError: __webpack_require__(/*! ./rest/HTTPError */ "./src/rest/HTTPError.js"),\n MessageFlags: __webpack_require__(/*! ./util/MessageFlags */ "./src/util/MessageFlags.js"),\n Intents: __webpack_require__(/*! ./util/Intents */ "./src/util/Intents.js"),\n Permissions: __webpack_require__(/*! ./util/Permissions */ "./src/util/Permissions.js"),\n Speaking: __webpack_require__(/*! ./util/Speaking */ "./src/util/Speaking.js"),\n Snowflake: __webpack_require__(/*! ./util/Snowflake */ "./src/util/Snowflake.js"),\n SnowflakeUtil: __webpack_require__(/*! ./util/Snowflake */ "./src/util/Snowflake.js"),\n Structures: __webpack_require__(/*! ./util/Structures */ "./src/util/Structures.js"),\n SystemChannelFlags: __webpack_require__(/*! ./util/SystemChannelFlags */ "./src/util/SystemChannelFlags.js"),\n UserFlags: __webpack_require__(/*! ./util/UserFlags */ "./src/util/UserFlags.js"),\n Util: Util,\n version: __webpack_require__(/*! ../package.json */ "./package.json").version,\n\n // Managers\n ChannelManager: __webpack_require__(/*! ./managers/ChannelManager */ "./src/managers/ChannelManager.js"),\n GuildChannelManager: __webpack_require__(/*! ./managers/GuildChannelManager */ "./src/managers/GuildChannelManager.js"),\n GuildEmojiManager: __webpack_require__(/*! ./managers/GuildEmojiManager */ "./src/managers/GuildEmojiManager.js"),\n GuildEmojiRoleManager: __webpack_require__(/*! ./managers/GuildEmojiRoleManager */ "./src/managers/GuildEmojiRoleManager.js"),\n GuildMemberManager: __webpack_require__(/*! ./managers/GuildMemberManager */ "./src/managers/GuildMemberManager.js"),\n GuildMemberRoleManager: __webpack_require__(/*! ./managers/GuildMemberRoleManager */ "./src/managers/GuildMemberRoleManager.js"),\n GuildManager: __webpack_require__(/*! ./managers/GuildManager */ "./src/managers/GuildManager.js"),\n ReactionManager: __webpack_require__(/*! ./managers/ReactionManager */ "./src/managers/ReactionManager.js"),\n ReactionUserManager: __webpack_require__(/*! ./managers/ReactionUserManager */ "./src/managers/ReactionUserManager.js"),\n MessageManager: __webpack_require__(/*! ./managers/MessageManager */ "./src/managers/MessageManager.js"),\n PresenceManager: __webpack_require__(/*! ./managers/PresenceManager */ "./src/managers/PresenceManager.js"),\n RoleManager: __webpack_require__(/*! ./managers/RoleManager */ "./src/managers/RoleManager.js"),\n UserManager: __webpack_require__(/*! ./managers/UserManager */ "./src/managers/UserManager.js"),\n\n // Shortcuts to Util methods\n discordSort: Util.discordSort,\n escapeMarkdown: Util.escapeMarkdown,\n fetchRecommendedShards: Util.fetchRecommendedShards,\n resolveColor: Util.resolveColor,\n resolveString: Util.resolveString,\n splitMessage: Util.splitMessage,\n\n // Structures\n Base: __webpack_require__(/*! ./structures/Base */ "./src/structures/Base.js"),\n Activity: __webpack_require__(/*! ./structures/Presence */ "./src/structures/Presence.js").Activity,\n APIMessage: __webpack_require__(/*! ./structures/APIMessage */ "./src/structures/APIMessage.js"),\n BaseGuildEmoji: __webpack_require__(/*! ./structures/BaseGuildEmoji */ "./src/structures/BaseGuildEmoji.js"),\n CategoryChannel: __webpack_require__(/*! ./structures/CategoryChannel */ "./src/structures/CategoryChannel.js"),\n Channel: __webpack_require__(/*! ./structures/Channel */ "./src/structures/Channel.js"),\n ClientApplication: __webpack_require__(/*! ./structures/ClientApplication */ "./src/structures/ClientApplication.js"),\n get ClientUser() {\n // This is a getter so that it properly extends any custom User class\n return __webpack_require__(/*! ./structures/ClientUser */ "./src/structures/ClientUser.js");\n },\n Collector: __webpack_require__(/*! ./structures/interfaces/Collector */ "./src/structures/interfaces/Collector.js"),\n DMChannel: __webpack_require__(/*! ./structures/DMChannel */ "./src/structures/DMChannel.js"),\n Emoji: __webpack_require__(/*! ./structures/Emoji */ "./src/structures/Emoji.js"),\n Guild: __webpack_require__(/*! ./structures/Guild */ "./src/structures/Guild.js"),\n GuildAuditLogs: __webpack_require__(/*! ./structures/GuildAuditLogs */ "./src/structures/GuildAuditLogs.js"),\n GuildChannel: __webpack_require__(/*! ./structures/GuildChannel */ "./src/structures/GuildChannel.js"),\n GuildEmoji: __webpack_require__(/*! ./structures/GuildEmoji */ "./src/structures/GuildEmoji.js"),\n GuildMember: __webpack_require__(/*! ./structures/GuildMember */ "./src/structures/GuildMember.js"),\n GuildPreview: __webpack_require__(/*! ./structures/GuildPreview */ "./src/structures/GuildPreview.js"),\n Integration: __webpack_require__(/*! ./structures/Integration */ "./src/structures/Integration.js"),\n Invite: __webpack_require__(/*! ./structures/Invite */ "./src/structures/Invite.js"),\n Message: __webpack_require__(/*! ./structures/Message */ "./src/structures/Message.js"),\n MessageAttachment: __webpack_require__(/*! ./structures/MessageAttachment */ "./src/structures/MessageAttachment.js"),\n MessageCollector: __webpack_require__(/*! ./structures/MessageCollector */ "./src/structures/MessageCollector.js"),\n MessageEmbed: __webpack_require__(/*! ./structures/MessageEmbed */ "./src/structures/MessageEmbed.js"),\n MessageMentions: __webpack_require__(/*! ./structures/MessageMentions */ "./src/structures/MessageMentions.js"),\n MessageReaction: __webpack_require__(/*! ./structures/MessageReaction */ "./src/structures/MessageReaction.js"),\n NewsChannel: __webpack_require__(/*! ./structures/NewsChannel */ "./src/structures/NewsChannel.js"),\n PermissionOverwrites: __webpack_require__(/*! ./structures/PermissionOverwrites */ "./src/structures/PermissionOverwrites.js"),\n Presence: __webpack_require__(/*! ./structures/Presence */ "./src/structures/Presence.js").Presence,\n ClientPresence: __webpack_require__(/*! ./structures/ClientPresence */ "./src/structures/ClientPresence.js"),\n ReactionCollector: __webpack_require__(/*! ./structures/ReactionCollector */ "./src/structures/ReactionCollector.js"),\n ReactionEmoji: __webpack_require__(/*! ./structures/ReactionEmoji */ "./src/structures/ReactionEmoji.js"),\n RichPresenceAssets: __webpack_require__(/*! ./structures/Presence */ "./src/structures/Presence.js").RichPresenceAssets,\n Role: __webpack_require__(/*! ./structures/Role */ "./src/structures/Role.js"),\n StoreChannel: __webpack_require__(/*! ./structures/StoreChannel */ "./src/structures/StoreChannel.js"),\n Team: __webpack_require__(/*! ./structures/Team */ "./src/structures/Team.js"),\n TeamMember: __webpack_require__(/*! ./structures/TeamMember */ "./src/structures/TeamMember.js"),\n TextChannel: __webpack_require__(/*! ./structures/TextChannel */ "./src/structures/TextChannel.js"),\n User: __webpack_require__(/*! ./structures/User */ "./src/structures/User.js"),\n VoiceChannel: __webpack_require__(/*! ./structures/VoiceChannel */ "./src/structures/VoiceChannel.js"),\n VoiceRegion: __webpack_require__(/*! ./structures/VoiceRegion */ "./src/structures/VoiceRegion.js"),\n VoiceState: __webpack_require__(/*! ./structures/VoiceState */ "./src/structures/VoiceState.js"),\n Webhook: __webpack_require__(/*! ./structures/Webhook */ "./src/structures/Webhook.js"),\n\n WebSocket: __webpack_require__(/*! ./WebSocket */ "./src/WebSocket.js"),\n};\n\n\n//# sourceURL=webpack://Discord/./src/index.js?')},"./src/managers/BaseManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nlet Structures;\n\n/**\n * Manages the API methods of a data model and holds its cache.\n * @abstract\n */\nclass BaseManager {\n constructor(client, iterable, holds, cacheType = Collection, ...cacheOptions) {\n if (!Structures) Structures = __webpack_require__(/*! ../util/Structures */ \"./src/util/Structures.js\");\n /**\n * The data structure belonging to this manager\n * @name BaseManager#holds\n * @type {Function}\n * @private\n * @readonly\n */\n Object.defineProperty(this, 'holds', { value: Structures.get(holds.name) || holds });\n\n /**\n * The client that instantiated this Manager\n * @name BaseManager#client\n * @type {Client}\n * @readonly\n */\n Object.defineProperty(this, 'client', { value: client });\n\n /**\n * The type of Collection of the Manager\n * @type {Collection}\n */\n this.cacheType = cacheType;\n\n /**\n * Holds the cache for the data model\n * @type {Collection}\n */\n this.cache = new cacheType(...cacheOptions);\n if (iterable) for (const i of iterable) this.add(i);\n }\n\n add(data, cache = true, { id, extras = [] } = {}) {\n const existing = this.cache.get(id || data.id);\n if (existing && existing._patch && cache) existing._patch(data);\n if (existing) return existing;\n\n const entry = this.holds ? new this.holds(this.client, data, ...extras) : data;\n if (cache) this.cache.set(id || entry.id, entry);\n return entry;\n }\n\n /**\n * Resolves a data entry to a data Object.\n * @param {string|Object} idOrInstance The id or instance of something in this Manager\n * @returns {?Object} An instance from this Manager\n */\n resolve(idOrInstance) {\n if (idOrInstance instanceof this.holds) return idOrInstance;\n if (typeof idOrInstance === 'string') return this.cache.get(idOrInstance) || null;\n return null;\n }\n\n /**\n * Resolves a data entry to a instance ID.\n * @param {string|Object} idOrInstance The id or instance of something in this Manager\n * @returns {?Snowflake}\n */\n resolveID(idOrInstance) {\n if (idOrInstance instanceof this.holds) return idOrInstance.id;\n if (typeof idOrInstance === 'string') return idOrInstance;\n return null;\n }\n\n valueOf() {\n return this.cache;\n }\n}\n\nmodule.exports = BaseManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/BaseManager.js?")},"./src/managers/ChannelManager.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ "./src/managers/BaseManager.js");\nconst Channel = __webpack_require__(/*! ../structures/Channel */ "./src/structures/Channel.js");\nconst { Events } = __webpack_require__(/*! ../util/Constants */ "./src/util/Constants.js");\n\n/**\n * A manager of channels belonging to a client\n * @extends {BaseManager}\n */\nclass ChannelManager extends BaseManager {\n constructor(client, iterable) {\n super(client, iterable, Channel);\n }\n\n /**\n * The cache of Channels\n * @type {Collection<Snowflake, Channel>}\n * @name ChannelManager#cache\n */\n\n add(data, guild, cache = true) {\n const existing = this.cache.get(data.id);\n if (existing) {\n if (existing._patch && cache) existing._patch(data);\n if (guild) guild.channels.add(existing);\n return existing;\n }\n\n const channel = Channel.create(this.client, data, guild);\n\n if (!channel) {\n this.client.emit(Events.DEBUG, `Failed to find guild, or unknown type for channel ${data.id} ${data.type}`);\n return null;\n }\n\n if (cache) this.cache.set(channel.id, channel);\n\n return channel;\n }\n\n remove(id) {\n const channel = this.cache.get(id);\n if (channel.guild) channel.guild.channels.cache.delete(id);\n this.cache.delete(id);\n }\n\n /**\n * Data that can be resolved to give a Channel object. This can be:\n * * A Channel object\n * * A Snowflake\n * @typedef {Channel|Snowflake} ChannelResolvable\n */\n\n /**\n * Resolves a ChannelResolvable to a Channel object.\n * @method resolve\n * @memberof ChannelManager\n * @instance\n * @param {ChannelResolvable} channel The channel resolvable to resolve\n * @returns {?Channel}\n */\n\n /**\n * Resolves a ChannelResolvable to a channel ID string.\n * @method resolveID\n * @memberof ChannelManager\n * @instance\n * @param {ChannelResolvable} channel The channel resolvable to resolve\n * @returns {?Snowflake}\n */\n\n /**\n * Obtains a channel from Discord, or the channel cache if it\'s already available.\n * @param {Snowflake} id ID of the channel\n * @param {boolean} [cache=true] Whether to cache the new channel object if it isn\'t already\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<Channel>}\n * @example\n * // Fetch a channel by its id\n * client.channels.fetch(\'222109930545610754\')\n * .then(channel => console.log(channel.name))\n * .catch(console.error);\n */\n async fetch(id, cache = true, force = false) {\n if (!force) {\n const existing = this.cache.get(id);\n if (existing && !existing.partial) return existing;\n }\n\n const data = await this.client.api.channels(id).get();\n return this.add(data, null, cache);\n }\n}\n\nmodule.exports = ChannelManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/ChannelManager.js?')},"./src/managers/GuildChannelManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ \"./src/managers/BaseManager.js\");\nconst GuildChannel = __webpack_require__(/*! ../structures/GuildChannel */ \"./src/structures/GuildChannel.js\");\nconst PermissionOverwrites = __webpack_require__(/*! ../structures/PermissionOverwrites */ \"./src/structures/PermissionOverwrites.js\");\nconst { ChannelTypes } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\n\n/**\n * Manages API methods for GuildChannels and stores their cache.\n * @extends {BaseManager}\n */\nclass GuildChannelManager extends BaseManager {\n constructor(guild, iterable) {\n super(guild.client, iterable, GuildChannel);\n\n /**\n * The guild this Manager belongs to\n * @type {Guild}\n */\n this.guild = guild;\n }\n\n /**\n * The cache of this Manager\n * @type {Collection<Snowflake, GuildChannel>}\n * @name GuildChannelManager#cache\n */\n\n add(channel) {\n const existing = this.cache.get(channel.id);\n if (existing) return existing;\n this.cache.set(channel.id, channel);\n return channel;\n }\n\n /**\n * Data that can be resolved to give a Guild Channel object. This can be:\n * * A GuildChannel object\n * * A Snowflake\n * @typedef {GuildChannel|Snowflake} GuildChannelResolvable\n */\n\n /**\n * Resolves a GuildChannelResolvable to a Channel object.\n * @method resolve\n * @memberof GuildChannelManager\n * @instance\n * @param {GuildChannelResolvable} channel The GuildChannel resolvable to resolve\n * @returns {?GuildChannel}\n */\n\n /**\n * Resolves a GuildChannelResolvable to a channel ID string.\n * @method resolveID\n * @memberof GuildChannelManager\n * @instance\n * @param {GuildChannelResolvable} channel The GuildChannel resolvable to resolve\n * @returns {?Snowflake}\n */\n\n /**\n * Creates a new channel in the guild.\n * @param {string} name The name of the new channel\n * @param {Object} [options] Options\n * @param {string} [options.type='text'] The type of the new channel, either `text`, `voice`, or `category`\n * @param {string} [options.topic] The topic for the new channel\n * @param {boolean} [options.nsfw] Whether the new channel is nsfw\n * @param {number} [options.bitrate] Bitrate of the new channel in bits (only voice)\n * @param {number} [options.userLimit] Maximum amount of users allowed in the new channel (only voice)\n * @param {ChannelResolvable} [options.parent] Parent of the new channel\n * @param {OverwriteResolvable[]|Collection<Snowflake, OverwriteResolvable>} [options.permissionOverwrites]\n * Permission overwrites of the new channel\n * @param {number} [options.position] Position of the new channel\n * @param {number} [options.rateLimitPerUser] The ratelimit per user for the channel\n * @param {string} [options.reason] Reason for creating the channel\n * @returns {Promise<GuildChannel>}\n * @example\n * // Create a new text channel\n * guild.channels.create('new-general', { reason: 'Needed a cool new channel' })\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Create a new channel with permission overwrites\n * guild.channels.create('new-voice', {\n * type: 'voice',\n * permissionOverwrites: [\n * {\n * id: message.author.id,\n * deny: ['VIEW_CHANNEL'],\n * },\n * ],\n * })\n */\n async create(name, options = {}) {\n let {\n type,\n topic,\n nsfw,\n bitrate,\n userLimit,\n parent,\n permissionOverwrites,\n position,\n rateLimitPerUser,\n reason,\n } = options;\n if (parent) parent = this.client.channels.resolveID(parent);\n if (permissionOverwrites) {\n permissionOverwrites = permissionOverwrites.map(o => PermissionOverwrites.resolve(o, this.guild));\n }\n\n const data = await this.client.api.guilds(this.guild.id).channels.post({\n data: {\n name,\n topic,\n type: type ? ChannelTypes[type.toUpperCase()] : ChannelTypes.TEXT,\n nsfw,\n bitrate,\n user_limit: userLimit,\n parent_id: parent,\n position,\n permission_overwrites: permissionOverwrites,\n rate_limit_per_user: rateLimitPerUser,\n },\n reason,\n });\n return this.client.actions.ChannelCreate.handle(data).channel;\n }\n}\n\nmodule.exports = GuildChannelManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/GuildChannelManager.js?")},"./src/managers/GuildEmojiManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ \"./src/managers/BaseManager.js\");\nconst { TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst GuildEmoji = __webpack_require__(/*! ../structures/GuildEmoji */ \"./src/structures/GuildEmoji.js\");\nconst ReactionEmoji = __webpack_require__(/*! ../structures/ReactionEmoji */ \"./src/structures/ReactionEmoji.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst DataResolver = __webpack_require__(/*! ../util/DataResolver */ \"./src/util/DataResolver.js\");\n\n/**\n * Manages API methods for GuildEmojis and stores their cache.\n * @extends {BaseManager}\n */\nclass GuildEmojiManager extends BaseManager {\n constructor(guild, iterable) {\n super(guild.client, iterable, GuildEmoji);\n /**\n * The guild this manager belongs to\n * @type {Guild}\n */\n this.guild = guild;\n }\n\n /**\n * The cache of GuildEmojis\n * @type {Collection<Snowflake, GuildEmoji>}\n * @name GuildEmojiManager#cache\n */\n\n add(data, cache) {\n return super.add(data, cache, { extras: [this.guild] });\n }\n\n /**\n * Creates a new custom emoji in the guild.\n * @param {BufferResolvable|Base64Resolvable} attachment The image for the emoji\n * @param {string} name The name for the emoji\n * @param {Object} [options] Options\n * @param {Collection<Snowflake, Role>|RoleResolvable[]} [options.roles] Roles to limit the emoji to\n * @param {string} [options.reason] Reason for creating the emoji\n * @returns {Promise<Emoji>} The created emoji\n * @example\n * // Create a new emoji from a url\n * guild.emojis.create('https://i.imgur.com/w3duR07.png', 'rip')\n * .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`))\n * .catch(console.error);\n * @example\n * // Create a new emoji from a file on your computer\n * guild.emojis.create('./memes/banana.png', 'banana')\n * .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`))\n * .catch(console.error);\n */\n async create(attachment, name, { roles, reason } = {}) {\n attachment = await DataResolver.resolveImage(attachment);\n if (!attachment) throw new TypeError('REQ_RESOURCE_TYPE');\n\n const data = { image: attachment, name };\n if (roles) {\n data.roles = [];\n for (let role of roles instanceof Collection ? roles.values() : roles) {\n role = this.guild.roles.resolve(role);\n if (!role) {\n return Promise.reject(\n new TypeError('INVALID_TYPE', 'options.roles', 'Array or Collection of Roles or Snowflakes', true),\n );\n }\n data.roles.push(role.id);\n }\n }\n\n return this.client.api\n .guilds(this.guild.id)\n .emojis.post({ data, reason })\n .then(emoji => this.client.actions.GuildEmojiCreate.handle(this.guild, emoji).emoji);\n }\n\n /**\n * Data that can be resolved into an GuildEmoji object. This can be:\n * * A custom emoji ID\n * * A GuildEmoji object\n * * A ReactionEmoji object\n * @typedef {Snowflake|GuildEmoji|ReactionEmoji} EmojiResolvable\n */\n\n /**\n * Resolves an EmojiResolvable to an Emoji object.\n * @param {EmojiResolvable} emoji The Emoji resolvable to identify\n * @returns {?GuildEmoji}\n */\n resolve(emoji) {\n if (emoji instanceof ReactionEmoji) return super.resolve(emoji.id);\n return super.resolve(emoji);\n }\n\n /**\n * Resolves an EmojiResolvable to an Emoji ID string.\n * @param {EmojiResolvable} emoji The Emoji resolvable to identify\n * @returns {?Snowflake}\n */\n resolveID(emoji) {\n if (emoji instanceof ReactionEmoji) return emoji.id;\n return super.resolveID(emoji);\n }\n\n /**\n * Data that can be resolved to give an emoji identifier. This can be:\n * * The unicode representation of an emoji\n * * An EmojiResolvable\n * @typedef {string|EmojiResolvable} EmojiIdentifierResolvable\n */\n\n /**\n * Resolves an EmojiResolvable to an emoji identifier.\n * @param {EmojiIdentifierResolvable} emoji The emoji resolvable to resolve\n * @returns {?string}\n */\n resolveIdentifier(emoji) {\n const emojiResolvable = this.resolve(emoji);\n if (emojiResolvable) return emojiResolvable.identifier;\n if (emoji instanceof ReactionEmoji) return emoji.identifier;\n if (typeof emoji === 'string') {\n if (!emoji.includes('%')) return encodeURIComponent(emoji);\n else return emoji;\n }\n return null;\n }\n}\n\nmodule.exports = GuildEmojiManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/GuildEmojiManager.js?")},"./src/managers/GuildEmojiRoleManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst { TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\n\n/**\n * Manages API methods for roles belonging to emojis and stores their cache.\n */\nclass GuildEmojiRoleManager {\n constructor(emoji) {\n /**\n * The emoji belonging to this manager\n * @type {GuildEmoji}\n */\n this.emoji = emoji;\n /**\n * The guild belonging to this manager\n * @type {Guild}\n */\n this.guild = emoji.guild;\n /**\n * The client belonging to this manager\n * @type {Client}\n * @readonly\n */\n Object.defineProperty(this, 'client', { value: emoji.client });\n }\n\n /**\n * The filtered collection of roles of the guild emoji\n * @type {Collection<Snowflake, Role>}\n * @private\n * @readonly\n */\n get _roles() {\n return this.guild.roles.cache.filter(role => this.emoji._roles.includes(role.id));\n }\n\n /**\n * The cache of roles belonging to this emoji\n * @type {Collection<Snowflake, Role>}\n * @readonly\n */\n get cache() {\n return this._roles;\n }\n\n /**\n * Adds a role (or multiple roles) to the list of roles that can use this emoji.\n * @param {RoleResolvable|RoleResolvable[]|Collection<Snowflake, Role>} roleOrRoles The role or roles to add\n * @returns {Promise<GuildEmoji>}\n */\n add(roleOrRoles) {\n if (roleOrRoles instanceof Collection) return this.add(roleOrRoles.keyArray());\n if (!Array.isArray(roleOrRoles)) return this.add([roleOrRoles]);\n roleOrRoles = roleOrRoles.map(r => this.guild.roles.resolve(r));\n\n if (roleOrRoles.includes(null)) {\n return Promise.reject(new TypeError('INVALID_TYPE', 'roles', 'Array or Collection of Roles or Snowflakes', true));\n }\n\n const newRoles = [...new Set(roleOrRoles.concat(...this._roles.values()))];\n return this.set(newRoles);\n }\n\n /**\n * Removes a role (or multiple roles) from the list of roles that can use this emoji.\n * @param {RoleResolvable|RoleResolvable[]|Collection<Snowflake, Role>} roleOrRoles The role or roles to remove\n * @returns {Promise<GuildEmoji>}\n */\n remove(roleOrRoles) {\n if (roleOrRoles instanceof Collection) return this.remove(roleOrRoles.keyArray());\n if (!Array.isArray(roleOrRoles)) return this.remove([roleOrRoles]);\n roleOrRoles = roleOrRoles.map(r => this.guild.roles.resolveID(r));\n\n if (roleOrRoles.includes(null)) {\n return Promise.reject(new TypeError('INVALID_TYPE', 'roles', 'Array or Collection of Roles or Snowflakes', true));\n }\n\n const newRoles = this._roles.keyArray().filter(role => !roleOrRoles.includes(role));\n return this.set(newRoles);\n }\n\n /**\n * Sets the role(s) that can use this emoji.\n * @param {Collection<Snowflake, Role>|RoleResolvable[]} roles The roles or role IDs to apply\n * @returns {Promise<GuildEmoji>}\n * @example\n * // Set the emoji's roles to a single role\n * guildEmoji.roles.set(['391156570408615936'])\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Remove all roles from an emoji\n * guildEmoji.roles.set([])\n * .then(console.log)\n * .catch(console.error);\n */\n set(roles) {\n return this.emoji.edit({ roles });\n }\n\n clone() {\n const clone = new this.constructor(this.emoji);\n clone._patch(this._roles.keyArray().slice());\n return clone;\n }\n\n /**\n * Patches the roles for this manager's cache\n * @param {Snowflake[]} roles The new roles\n * @private\n */\n _patch(roles) {\n this.emoji._roles = roles;\n }\n}\n\nmodule.exports = GuildEmojiRoleManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/GuildEmojiRoleManager.js?")},"./src/managers/GuildManager.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ "./src/managers/BaseManager.js");\nconst Guild = __webpack_require__(/*! ../structures/Guild */ "./src/structures/Guild.js");\nconst GuildChannel = __webpack_require__(/*! ../structures/GuildChannel */ "./src/structures/GuildChannel.js");\nconst GuildEmoji = __webpack_require__(/*! ../structures/GuildEmoji */ "./src/structures/GuildEmoji.js");\nconst GuildMember = __webpack_require__(/*! ../structures/GuildMember */ "./src/structures/GuildMember.js");\nconst Invite = __webpack_require__(/*! ../structures/Invite */ "./src/structures/Invite.js");\nconst Role = __webpack_require__(/*! ../structures/Role */ "./src/structures/Role.js");\nconst {\n Events,\n VerificationLevels,\n DefaultMessageNotifications,\n ExplicitContentFilterLevels,\n} = __webpack_require__(/*! ../util/Constants */ "./src/util/Constants.js");\nconst DataResolver = __webpack_require__(/*! ../util/DataResolver */ "./src/util/DataResolver.js");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ "./src/util/Permissions.js");\nconst { resolveColor } = __webpack_require__(/*! ../util/Util */ "./src/util/Util.js");\n\n/**\n * Manages API methods for Guilds and stores their cache.\n * @extends {BaseManager}\n */\nclass GuildManager extends BaseManager {\n constructor(client, iterable) {\n super(client, iterable, Guild);\n }\n\n /**\n * The cache of this Manager\n * @type {Collection<Snowflake, Guild>}\n * @name GuildManager#cache\n */\n\n /**\n * Data that resolves to give a Guild object. This can be:\n * * A Guild object\n * * A GuildChannel object\n * * A GuildEmoji object\n * * A Role object\n * * A Snowflake\n * * An Invite object\n * @typedef {Guild|GuildChannel|GuildMember|GuildEmoji|Role|Snowflake|Invite} GuildResolvable\n */\n\n /**\n * Partial data for a Role.\n * @typedef {Object} PartialRoleData\n * @property {number} [id] The ID for this role, used to set channel overrides,\n * this is a placeholder and will be replaced by the API after consumption\n * @property {string} [name] The name of the role\n * @property {ColorResolvable} [color] The color of the role, either a hex string or a base 10 number\n * @property {boolean} [hoist] Whether or not the role should be hoisted\n * @property {number} [position] The position of the role\n * @property {PermissionResolvable|number} [permissions] The permissions of the role\n * @property {boolean} [mentionable] Whether or not the role should be mentionable\n */\n\n /**\n * Partial overwrite data.\n * @typedef {Object} PartialOverwriteData\n * @property {number|Snowflake} id The Role or User ID for this overwrite\n * @property {string} [type] The type of this overwrite\n * @property {PermissionResolvable} [allow] The permissions to allow\n * @property {PermissionResolvable} [deny] The permissions to deny\n */\n\n /**\n * Partial data for a Channel.\n * @typedef {Object} PartialChannelData\n * @property {number} [id] The ID for this channel, used to set its parent,\n * this is a placeholder and will be replaced by the API after consumption\n * @property {number} [parentID] The parent ID for this channel\n * @property {string} [type] The type of the channel\n * @property {string} name The name of the channel\n * @property {string} [topic] The topic of the text channel\n * @property {boolean} [nsfw] Whether the channel is NSFW\n * @property {number} [bitrate] The bitrate of the voice channel\n * @property {number} [userLimit] The user limit of the channel\n * @property {PartialOverwriteData} [permissionOverwrites]\n * Overwrites of the channel\n * @property {number} [rateLimitPerUser] The rate limit per user of the channel in seconds\n */\n\n /**\n * Resolves a GuildResolvable to a Guild object.\n * @method resolve\n * @memberof GuildManager\n * @instance\n * @param {GuildResolvable} guild The guild resolvable to identify\n * @returns {?Guild}\n */\n resolve(guild) {\n if (\n guild instanceof GuildChannel ||\n guild instanceof GuildMember ||\n guild instanceof GuildEmoji ||\n guild instanceof Role ||\n (guild instanceof Invite && guild.guild)\n ) {\n return super.resolve(guild.guild);\n }\n return super.resolve(guild);\n }\n\n /**\n * Resolves a GuildResolvable to a Guild ID string.\n * @method resolveID\n * @memberof GuildManager\n * @instance\n * @param {GuildResolvable} guild The guild resolvable to identify\n * @returns {?Snowflake}\n */\n resolveID(guild) {\n if (\n guild instanceof GuildChannel ||\n guild instanceof GuildMember ||\n guild instanceof GuildEmoji ||\n guild instanceof Role ||\n (guild instanceof Invite && guild.guild)\n ) {\n return super.resolveID(guild.guild.id);\n }\n return super.resolveID(guild);\n }\n\n /**\n * Creates a guild.\n * <warn>This is only available to bots in fewer than 10 guilds.</warn>\n * @param {string} name The name of the guild\n * @param {Object} [options] Options for the creating\n * @param {PartialChannelData[]} [options.channels] The channels for this guild\n * @param {DefaultMessageNotifications} [options.defaultMessageNotifications] The default message notifications\n * for the guild\n * @param {ExplicitContentFilterLevel} [options.explicitContentFilter] The explicit content filter level for the guild\n * @param {BufferResolvable|Base64Resolvable} [options.icon=null] The icon for the guild\n * @param {string} [options.region] The region for the server, defaults to the closest one available\n * @param {PartialRoleData[]} [options.roles] The roles for this guild,\n * the first element of this array is used to change properties of the guild\'s everyone role.\n * @param {VerificationLevel} [options.verificationLevel] The verification level for the guild\n * @returns {Promise<Guild>} The guild that was created\n */\n async create(\n name,\n {\n channels = [],\n defaultMessageNotifications,\n explicitContentFilter,\n icon = null,\n region,\n roles = [],\n verificationLevel,\n } = {},\n ) {\n icon = await DataResolver.resolveImage(icon);\n if (typeof verificationLevel !== \'undefined\' && typeof verificationLevel !== \'number\') {\n verificationLevel = VerificationLevels.indexOf(verificationLevel);\n }\n if (typeof defaultMessageNotifications !== \'undefined\' && typeof defaultMessageNotifications !== \'number\') {\n defaultMessageNotifications = DefaultMessageNotifications.indexOf(defaultMessageNotifications);\n }\n if (typeof explicitContentFilter !== \'undefined\' && typeof explicitContentFilter !== \'number\') {\n explicitContentFilter = ExplicitContentFilterLevels.indexOf(explicitContentFilter);\n }\n for (const channel of channels) {\n channel.parent_id = channel.parentID;\n delete channel.parentID;\n if (!channel.permissionOverwrites) continue;\n for (const overwrite of channel.permissionOverwrites) {\n if (overwrite.allow) overwrite.allow = Permissions.resolve(overwrite.allow);\n if (overwrite.deny) overwrite.deny = Permissions.resolve(overwrite.deny);\n }\n channel.permission_overwrites = channel.permissionOverwrites;\n delete channel.permissionOverwrites;\n }\n for (const role of roles) {\n if (role.color) role.color = resolveColor(role.color);\n if (role.permissions) role.permissions = Permissions.resolve(role.permissions);\n }\n return new Promise((resolve, reject) =>\n this.client.api.guilds\n .post({\n data: {\n name,\n region,\n icon,\n verification_level: verificationLevel,\n default_message_notifications: defaultMessageNotifications,\n explicit_content_filter: explicitContentFilter,\n channels,\n roles,\n },\n })\n .then(data => {\n if (this.client.guilds.cache.has(data.id)) return resolve(this.client.guilds.cache.get(data.id));\n\n const handleGuild = guild => {\n if (guild.id === data.id) {\n this.client.clearTimeout(timeout);\n this.client.removeListener(Events.GUILD_CREATE, handleGuild);\n this.client.decrementMaxListeners();\n resolve(guild);\n }\n };\n this.client.incrementMaxListeners();\n this.client.on(Events.GUILD_CREATE, handleGuild);\n\n const timeout = this.client.setTimeout(() => {\n this.client.removeListener(Events.GUILD_CREATE, handleGuild);\n this.client.decrementMaxListeners();\n resolve(this.client.guilds.add(data));\n }, 10000);\n return undefined;\n }, reject),\n );\n }\n\n /**\n * Obtains a guild from Discord, or the guild cache if it\'s already available.\n * @param {Snowflake} id ID of the guild\n * @param {boolean} [cache=true] Whether to cache the new guild object if it isn\'t already\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<Guild>}\n * @example\n * // Fetch a guild by its id\n * client.guilds.fetch(\'222078108977594368\')\n * .then(guild => console.log(guild.name))\n * .catch(console.error);\n */\n async fetch(id, cache = true, force = false) {\n if (!force) {\n const existing = this.cache.get(id);\n if (existing) return existing;\n }\n\n const data = await this.client.api.guilds(id).get({ query: { with_counts: true } });\n return this.add(data, cache);\n }\n}\n\nmodule.exports = GuildManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/GuildManager.js?')},"./src/managers/GuildMemberManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ \"./src/managers/BaseManager.js\");\nconst { Error, TypeError, RangeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst GuildMember = __webpack_require__(/*! ../structures/GuildMember */ \"./src/structures/GuildMember.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst { Events, OPCodes } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\n\n/**\n * Manages API methods for GuildMembers and stores their cache.\n * @extends {BaseManager}\n */\nclass GuildMemberManager extends BaseManager {\n constructor(guild, iterable) {\n super(guild.client, iterable, GuildMember);\n /**\n * The guild this manager belongs to\n * @type {Guild}\n */\n this.guild = guild;\n }\n\n /**\n * The cache of this Manager\n * @type {Collection<Snowflake, GuildMember>}\n * @name GuildMemberManager#cache\n */\n\n add(data, cache = true) {\n return super.add(data, cache, { id: data.user.id, extras: [this.guild] });\n }\n\n /**\n * Data that resolves to give a GuildMember object. This can be:\n * * A GuildMember object\n * * A User resolvable\n * @typedef {GuildMember|UserResolvable} GuildMemberResolvable\n */\n\n /**\n * Resolves a GuildMemberResolvable to a GuildMember object.\n * @param {GuildMemberResolvable} member The user that is part of the guild\n * @returns {?GuildMember}\n */\n resolve(member) {\n const memberResolvable = super.resolve(member);\n if (memberResolvable) return memberResolvable;\n const userResolvable = this.client.users.resolveID(member);\n if (userResolvable) return super.resolve(userResolvable);\n return null;\n }\n\n /**\n * Resolves a GuildMemberResolvable to a member ID string.\n * @param {GuildMemberResolvable} member The user that is part of the guild\n * @returns {?Snowflake}\n */\n resolveID(member) {\n const memberResolvable = super.resolveID(member);\n if (memberResolvable) return memberResolvable;\n const userResolvable = this.client.users.resolveID(member);\n return this.cache.has(userResolvable) ? userResolvable : null;\n }\n\n /**\n * Options used to fetch a single member from a guild.\n * @typedef {Object} FetchMemberOptions\n * @property {UserResolvable} user The user to fetch\n * @property {boolean} [cache=true] Whether or not to cache the fetched member\n * @property {boolean} [force=false] Whether to skip the cache check and request the API\n */\n\n /**\n * Options used to fetch multiple members from a guild.\n * @typedef {Object} FetchMembersOptions\n * @property {UserResolvable|UserResolvable[]} user The user(s) to fetch\n * @property {?string} query Limit fetch to members with similar usernames\n * @property {number} [limit=0] Maximum number of members to request\n * @property {boolean} [withPresences=false] Whether or not to include the presences\n * @property {number} [time=120e3] Timeout for receipt of members\n * @property {?string} nonce Nonce for this request (32 characters max - default to base 16 now timestamp)\n * @property {boolean} [force=false] Whether to skip the cache check and request the API\n */\n\n /**\n * Fetches member(s) from Discord, even if they're offline.\n * @param {UserResolvable|FetchMemberOptions|FetchMembersOptions} [options] If a UserResolvable, the user to fetch.\n * If undefined, fetches all members.\n * If a query, it limits the results to users with similar usernames.\n * @returns {Promise<GuildMember>|Promise<Collection<Snowflake, GuildMember>>}\n * @example\n * // Fetch all members from a guild\n * guild.members.fetch()\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Fetch a single member\n * guild.members.fetch('66564597481480192')\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Fetch a single member without checking cache\n * guild.members.fetch({ user, force: true })\n * .then(console.log)\n * .catch(console.error)\n * @example\n * // Fetch a single member without caching\n * guild.members.fetch({ user, cache: false })\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Fetch by an array of users including their presences\n * guild.members.fetch({ user: ['66564597481480192', '191615925336670208'], withPresences: true })\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Fetch by query\n * guild.members.fetch({ query: 'hydra', limit: 1 })\n * .then(console.log)\n * .catch(console.error);\n */\n fetch(options) {\n if (!options) return this._fetchMany();\n const user = this.client.users.resolveID(options);\n if (user) return this._fetchSingle({ user, cache: true });\n if (options.user) {\n if (Array.isArray(options.user)) {\n options.user = options.user.map(u => this.client.users.resolveID(u));\n return this._fetchMany(options);\n } else {\n options.user = this.client.users.resolveID(options.user);\n }\n if (!options.limit && !options.withPresences) return this._fetchSingle(options);\n }\n return this._fetchMany(options);\n }\n\n /**\n * Prunes members from the guild based on how long they have been inactive.\n * <info>It's recommended to set options.count to `false` for large guilds.</info>\n * @param {Object} [options] Prune options\n * @param {number} [options.days=7] Number of days of inactivity required to kick\n * @param {boolean} [options.dry=false] Get number of users that will be kicked, without actually kicking them\n * @param {boolean} [options.count=true] Whether or not to return the number of users that have been kicked.\n * @param {RoleResolvable[]} [options.roles=[]] Array of roles to bypass the \"...and no roles\" constraint when pruning\n * @param {string} [options.reason] Reason for this prune\n * @returns {Promise<number|null>} The number of members that were/will be kicked\n * @example\n * // See how many members will be pruned\n * guild.members.prune({ dry: true })\n * .then(pruned => console.log(`This will prune ${pruned} people!`))\n * .catch(console.error);\n * @example\n * // Actually prune the members\n * guild.members.prune({ days: 1, reason: 'too many people!' })\n * .then(pruned => console.log(`I just pruned ${pruned} people!`))\n * .catch(console.error);\n * @example\n * // Include members with a specified role\n * guild.members.prune({ days: 7, roles: ['657259391652855808'] })\n * .then(pruned => console.log(`I just pruned ${pruned} people!`))\n * .catch(console.error);\n */\n prune({ days = 7, dry = false, count = true, roles = [], reason } = {}) {\n if (typeof days !== 'number') throw new TypeError('PRUNE_DAYS_TYPE');\n\n const query = new URLSearchParams();\n query.set('days', days);\n query.set('compute_prune_count', count);\n\n for (const role of roles) {\n const resolvedRole = this.guild.roles.resolveID(role);\n if (!resolvedRole) {\n return Promise.reject(new TypeError('INVALID_TYPE', 'roles', 'Array of Roles or Snowflakes', true));\n }\n query.append('include_roles', role);\n }\n\n const endpoint = this.client.api.guilds(this.guild.id).prune;\n\n if (dry) {\n return endpoint.get({ query, reason }).then(data => data.pruned);\n }\n\n const body = [...query.entries()].reduce((acc, [k, v]) => {\n if (k === 'include_roles') v = (acc[k] || []).concat(v);\n acc[k] = v;\n return acc;\n }, {});\n\n return endpoint.post({ data: body, reason }).then(data => data.pruned);\n }\n\n /**\n * Bans a user from the guild.\n * @param {UserResolvable} user The user to ban\n * @param {Object} [options] Options for the ban\n * @param {number} [options.days=0] Number of days of messages to delete, must be between 0 and 7\n * @param {string} [options.reason] Reason for banning\n * @returns {Promise<GuildMember|User|Snowflake>} Result object will be resolved as specifically as possible.\n * If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot\n * be resolved, the user ID will be the result.\n * @example\n * // Ban a user by ID (or with a user/guild member object)\n * guild.members.ban('84484653687267328')\n * .then(user => console.log(`Banned ${user.username || user.id || user} from ${guild.name}`))\n * .catch(console.error);\n */\n ban(user, options = { days: 0 }) {\n if (options.days) options.delete_message_days = options.days;\n const id = this.client.users.resolveID(user);\n if (!id) return Promise.reject(new Error('BAN_RESOLVE_ID', true));\n return this.client.api\n .guilds(this.guild.id)\n .bans[id].put({ data: options })\n .then(() => {\n if (user instanceof GuildMember) return user;\n const _user = this.client.users.resolve(id);\n if (_user) {\n const member = this.resolve(_user);\n return member || _user;\n }\n return id;\n });\n }\n\n /**\n * Unbans a user from the guild.\n * @param {UserResolvable} user The user to unban\n * @param {string} [reason] Reason for unbanning user\n * @returns {Promise<User>}\n * @example\n * // Unban a user by ID (or with a user/guild member object)\n * guild.members.unban('84484653687267328')\n * .then(user => console.log(`Unbanned ${user.username} from ${guild.name}`))\n * .catch(console.error);\n */\n unban(user, reason) {\n const id = this.client.users.resolveID(user);\n if (!id) return Promise.reject(new Error('BAN_RESOLVE_ID'));\n return this.client.api\n .guilds(this.guild.id)\n .bans[id].delete({ reason })\n .then(() => this.client.users.resolve(user));\n }\n\n _fetchSingle({ user, cache, force = false }) {\n if (!force) {\n const existing = this.cache.get(user);\n if (existing && !existing.partial) return Promise.resolve(existing);\n }\n\n return this.client.api\n .guilds(this.guild.id)\n .members(user)\n .get()\n .then(data => this.add(data, cache));\n }\n\n _fetchMany({\n limit = 0,\n withPresences: presences = false,\n user: user_ids,\n query,\n time = 120e3,\n nonce = Date.now().toString(16),\n force = false,\n } = {}) {\n return new Promise((resolve, reject) => {\n if (this.guild.memberCount === this.cache.size && !query && !limit && !presences && !user_ids && !force) {\n resolve(this.cache);\n return;\n }\n if (!query && !user_ids) query = '';\n if (nonce.length > 32) throw new RangeError('MEMBER_FETCH_NONCE_LENGTH');\n this.guild.shard.send({\n op: OPCodes.REQUEST_GUILD_MEMBERS,\n d: {\n guild_id: this.guild.id,\n presences,\n user_ids,\n query,\n nonce,\n limit,\n },\n });\n const fetchedMembers = new Collection();\n const option = query || limit || presences || user_ids;\n let i = 0;\n const handler = (members, _, chunk) => {\n timeout.refresh();\n if (chunk.nonce !== nonce) return;\n i++;\n for (const member of members.values()) {\n if (option) fetchedMembers.set(member.id, member);\n }\n if (\n this.guild.memberCount <= this.cache.size ||\n (option && members.size < 1000) ||\n (limit && fetchedMembers.size >= limit) ||\n i === chunk.count\n ) {\n this.client.clearTimeout(timeout);\n this.client.removeListener(Events.GUILD_MEMBERS_CHUNK, handler);\n this.client.decrementMaxListeners();\n let fetched = option ? fetchedMembers : this.cache;\n if (user_ids && !Array.isArray(user_ids) && fetched.size) fetched = fetched.first();\n resolve(fetched);\n }\n };\n const timeout = this.client.setTimeout(() => {\n this.client.removeListener(Events.GUILD_MEMBERS_CHUNK, handler);\n this.client.decrementMaxListeners();\n reject(new Error('GUILD_MEMBERS_TIMEOUT'));\n }, time);\n this.client.incrementMaxListeners();\n this.client.on(Events.GUILD_MEMBERS_CHUNK, handler);\n });\n }\n}\n\nmodule.exports = GuildMemberManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/GuildMemberManager.js?")},"./src/managers/GuildMemberRoleManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst { TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\n\n/**\n * Manages API methods for roles of a GuildMember and stores their cache.\n */\nclass GuildMemberRoleManager {\n constructor(member) {\n /**\n * The GuildMember this manager belongs to\n * @type {GuildMember}\n */\n this.member = member;\n /**\n * The Guild this manager belongs to\n * @type {Guild}\n */\n this.guild = member.guild;\n Object.defineProperty(this, 'client', { value: member.client });\n }\n\n /**\n * The filtered collection of roles of the member\n * @type {Collection<Snowflake, Role>}\n * @private\n * @readonly\n */\n get _roles() {\n const everyone = this.guild.roles.everyone;\n return this.guild.roles.cache.filter(role => this.member._roles.includes(role.id)).set(everyone.id, everyone);\n }\n\n /**\n * The roles of this member\n * @type {Collection<Snowflake, Role>}\n * @readonly\n */\n get cache() {\n return this._roles;\n }\n\n /**\n * The role of the member used to hoist them in a separate category in the users list\n * @type {?Role}\n * @readonly\n */\n get hoist() {\n const hoistedRoles = this._roles.filter(role => role.hoist);\n if (!hoistedRoles.size) return null;\n return hoistedRoles.reduce((prev, role) => (!prev || role.comparePositionTo(prev) > 0 ? role : prev));\n }\n\n /**\n * The role of the member used to set their color\n * @type {?Role}\n * @readonly\n */\n get color() {\n const coloredRoles = this._roles.filter(role => role.color);\n if (!coloredRoles.size) return null;\n return coloredRoles.reduce((prev, role) => (!prev || role.comparePositionTo(prev) > 0 ? role : prev));\n }\n\n /**\n * The role of the member with the highest position\n * @type {Role}\n * @readonly\n */\n get highest() {\n return this._roles.reduce((prev, role) => (role.comparePositionTo(prev) > 0 ? role : prev), this._roles.first());\n }\n\n /**\n * Adds a role (or multiple roles) to the member.\n * @param {RoleResolvable|RoleResolvable[]|Collection<Snowflake, Role>} roleOrRoles The role or roles to add\n * @param {string} [reason] Reason for adding the role(s)\n * @returns {Promise<GuildMember>}\n */\n async add(roleOrRoles, reason) {\n if (roleOrRoles instanceof Collection || Array.isArray(roleOrRoles)) {\n roleOrRoles = roleOrRoles.map(r => this.guild.roles.resolve(r));\n if (roleOrRoles.includes(null)) {\n throw new TypeError('INVALID_TYPE', 'roles', 'Array or Collection of Roles or Snowflakes', true);\n }\n\n const newRoles = [...new Set(roleOrRoles.concat(...this._roles.values()))];\n return this.set(newRoles, reason);\n } else {\n roleOrRoles = this.guild.roles.resolve(roleOrRoles);\n if (roleOrRoles === null) {\n throw new TypeError('INVALID_TYPE', 'roles', 'Role, Snowflake or Array or Collection of Roles or Snowflakes');\n }\n\n await this.client.api.guilds[this.guild.id].members[this.member.id].roles[roleOrRoles.id].put({ reason });\n\n const clone = this.member._clone();\n clone._roles = [...this._roles.keys(), roleOrRoles.id];\n return clone;\n }\n }\n\n /**\n * Removes a role (or multiple roles) from the member.\n * @param {RoleResolvable|RoleResolvable[]|Collection<Snowflake, Role>} roleOrRoles The role or roles to remove\n * @param {string} [reason] Reason for removing the role(s)\n * @returns {Promise<GuildMember>}\n */\n async remove(roleOrRoles, reason) {\n if (roleOrRoles instanceof Collection || Array.isArray(roleOrRoles)) {\n roleOrRoles = roleOrRoles.map(r => this.guild.roles.resolve(r));\n if (roleOrRoles.includes(null)) {\n throw new TypeError('INVALID_TYPE', 'roles', 'Array or Collection of Roles or Snowflakes', true);\n }\n\n const newRoles = this._roles.filter(role => !roleOrRoles.includes(role));\n return this.set(newRoles, reason);\n } else {\n roleOrRoles = this.guild.roles.resolve(roleOrRoles);\n if (roleOrRoles === null) {\n throw new TypeError('INVALID_TYPE', 'roles', 'Array or Collection of Roles or Snowflakes', true);\n }\n\n await this.client.api.guilds[this.guild.id].members[this.member.id].roles[roleOrRoles.id].delete({ reason });\n\n const clone = this.member._clone();\n const newRoles = this._roles.filter(role => role.id !== roleOrRoles.id);\n clone._roles = [...newRoles.keys()];\n return clone;\n }\n }\n\n /**\n * Sets the roles applied to the member.\n * @param {Collection<Snowflake, Role>|RoleResolvable[]} roles The roles or role IDs to apply\n * @param {string} [reason] Reason for applying the roles\n * @returns {Promise<GuildMember>}\n * @example\n * // Set the member's roles to a single role\n * guildMember.roles.set(['391156570408615936'])\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Remove all the roles from a member\n * guildMember.roles.set([])\n * .then(member => console.log(`Member roles is now of ${member.roles.cache.size} size`))\n * .catch(console.error);\n */\n set(roles, reason) {\n return this.member.edit({ roles }, reason);\n }\n\n clone() {\n const clone = new this.constructor(this.member);\n clone.member._roles = [...this._roles.keyArray()];\n return clone;\n }\n}\n\nmodule.exports = GuildMemberRoleManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/GuildMemberRoleManager.js?")},"./src/managers/MessageManager.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ "./src/managers/BaseManager.js");\nconst Message = __webpack_require__(/*! ../structures/Message */ "./src/structures/Message.js");\nconst Collection = __webpack_require__(/*! ../util/Collection */ "./src/util/Collection.js");\nconst LimitedCollection = __webpack_require__(/*! ../util/LimitedCollection */ "./src/util/LimitedCollection.js");\n\n/**\n * Manages API methods for Messages and holds their cache.\n * @extends {BaseManager}\n */\nclass MessageManager extends BaseManager {\n constructor(channel, iterable) {\n super(channel.client, iterable, Message, LimitedCollection, channel.client.options.messageCacheMaxSize);\n /**\n * The channel that the messages belong to\n * @type {TextBasedChannel}\n */\n this.channel = channel;\n }\n\n /**\n * The cache of Messages\n * @type {Collection<Snowflake, Message>}\n * @name MessageManager#cache\n */\n\n add(data, cache) {\n return super.add(data, cache, { extras: [this.channel] });\n }\n\n /**\n * The parameters to pass in when requesting previous messages from a channel. `around`, `before` and\n * `after` are mutually exclusive. All the parameters are optional.\n * @typedef {Object} ChannelLogsQueryOptions\n * @property {number} [limit=50] Number of messages to acquire\n * @property {Snowflake} [before] ID of a message to get the messages that were posted before it\n * @property {Snowflake} [after] ID of a message to get the messages that were posted after it\n * @property {Snowflake} [around] ID of a message to get the messages that were posted around it\n */\n\n /**\n * Gets a message, or messages, from this channel.\n * <info>The returned Collection does not contain reaction users of the messages if they were not cached.\n * Those need to be fetched separately in such a case.</info>\n * @param {Snowflake|ChannelLogsQueryOptions} [message] The ID of the message to fetch, or query parameters.\n * @param {boolean} [cache=true] Whether to cache the message(s)\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<Message>|Promise<Collection<Snowflake, Message>>}\n * @example\n * // Get message\n * channel.messages.fetch(\'99539446449315840\')\n * .then(message => console.log(message.content))\n * .catch(console.error);\n * @example\n * // Get messages\n * channel.messages.fetch({ limit: 10 })\n * .then(messages => console.log(`Received ${messages.size} messages`))\n * .catch(console.error);\n * @example\n * // Get messages and filter by user ID\n * channel.messages.fetch()\n * .then(messages => console.log(`${messages.filter(m => m.author.id === \'84484653687267328\').size} messages`))\n * .catch(console.error);\n */\n fetch(message, cache = true, force = false) {\n return typeof message === \'string\' ? this._fetchId(message, cache, force) : this._fetchMany(message, cache);\n }\n\n /**\n * Fetches the pinned messages of this channel and returns a collection of them.\n * <info>The returned Collection does not contain any reaction data of the messages.\n * Those need to be fetched separately.</info>\n * @param {boolean} [cache=true] Whether to cache the message(s)\n * @returns {Promise<Collection<Snowflake, Message>>}\n * @example\n * // Get pinned messages\n * channel.fetchPinned()\n * .then(messages => console.log(`Received ${messages.size} messages`))\n * .catch(console.error);\n */\n fetchPinned(cache = true) {\n return this.client.api.channels[this.channel.id].pins.get().then(data => {\n const messages = new Collection();\n for (const message of data) messages.set(message.id, this.add(message, cache));\n return messages;\n });\n }\n\n /**\n * Data that can be resolved to a Message object. This can be:\n * * A Message\n * * A Snowflake\n * @typedef {Message|Snowflake} MessageResolvable\n */\n\n /**\n * Resolves a MessageResolvable to a Message object.\n * @method resolve\n * @memberof MessageManager\n * @instance\n * @param {MessageResolvable} message The message resolvable to resolve\n * @returns {?Message}\n */\n\n /**\n * Resolves a MessageResolvable to a Message ID string.\n * @method resolveID\n * @memberof MessageManager\n * @instance\n * @param {MessageResolvable} message The message resolvable to resolve\n * @returns {?Snowflake}\n */\n\n /**\n * Deletes a message, even if it\'s not cached.\n * @param {MessageResolvable} message The message to delete\n * @param {string} [reason] Reason for deleting this message, if it does not belong to the client user\n * @returns {Promise<void>}\n */\n async delete(message, reason) {\n message = this.resolveID(message);\n if (message) {\n await this.client.api.channels(this.channel.id).messages(message).delete({ reason });\n }\n }\n\n async _fetchId(messageID, cache, force) {\n if (!force) {\n const existing = this.cache.get(messageID);\n if (existing && !existing.partial) return existing;\n }\n\n const data = await this.client.api.channels[this.channel.id].messages[messageID].get();\n return this.add(data, cache);\n }\n\n async _fetchMany(options = {}, cache) {\n const data = await this.client.api.channels[this.channel.id].messages.get({ query: options });\n const messages = new Collection();\n for (const message of data) messages.set(message.id, this.add(message, cache));\n return messages;\n }\n}\n\nmodule.exports = MessageManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/MessageManager.js?')},"./src/managers/PresenceManager.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ "./src/managers/BaseManager.js");\nconst { Presence } = __webpack_require__(/*! ../structures/Presence */ "./src/structures/Presence.js");\n\n/**\n * Manages API methods for Presences and holds their cache.\n * @extends {BaseManager}\n */\nclass PresenceManager extends BaseManager {\n constructor(client, iterable) {\n super(client, iterable, Presence);\n }\n\n /**\n * The cache of Presences\n * @type {Collection<Snowflake, Presence>}\n * @name PresenceManager#cache\n */\n\n add(data, cache) {\n const existing = this.cache.get(data.user.id);\n return existing ? existing.patch(data) : super.add(data, cache, { id: data.user.id });\n }\n\n /**\n * Data that can be resolved to a Presence object. This can be:\n * * A Presence\n * * A UserResolvable\n * * A Snowflake\n * @typedef {Presence|UserResolvable|Snowflake} PresenceResolvable\n */\n\n /**\n * Resolves a PresenceResolvable to a Presence object.\n * @param {PresenceResolvable} presence The presence resolvable to resolve\n * @returns {?Presence}\n */\n resolve(presence) {\n const presenceResolvable = super.resolve(presence);\n if (presenceResolvable) return presenceResolvable;\n const UserResolvable = this.client.users.resolveID(presence);\n return super.resolve(UserResolvable) || null;\n }\n\n /**\n * Resolves a PresenceResolvable to a Presence ID string.\n * @param {PresenceResolvable} presence The presence resolvable to resolve\n * @returns {?Snowflake}\n */\n resolveID(presence) {\n const presenceResolvable = super.resolveID(presence);\n if (presenceResolvable) return presenceResolvable;\n const userResolvable = this.client.users.resolveID(presence);\n return this.cache.has(userResolvable) ? userResolvable : null;\n }\n}\n\nmodule.exports = PresenceManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/PresenceManager.js?')},"./src/managers/ReactionManager.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ "./src/managers/BaseManager.js");\nconst MessageReaction = __webpack_require__(/*! ../structures/MessageReaction */ "./src/structures/MessageReaction.js");\n\n/**\n * Manages API methods for reactions and holds their cache.\n * @extends {BaseManager}\n */\nclass ReactionManager extends BaseManager {\n constructor(message, iterable) {\n super(message.client, iterable, MessageReaction);\n\n /**\n * The message that this manager belongs to\n * @type {Message}\n */\n this.message = message;\n }\n\n add(data, cache) {\n return super.add(data, cache, { id: data.emoji.id || data.emoji.name, extras: [this.message] });\n }\n\n /**\n * The reaction cache of this manager\n * @type {Collection<string|Snowflake, MessageReaction>}\n * @name ReactionManager#cache\n */\n\n /**\n * Data that can be resolved to a MessageReaction object. This can be:\n * * A MessageReaction\n * * A Snowflake\n * @typedef {MessageReaction|Snowflake} MessageReactionResolvable\n */\n\n /**\n * Resolves a MessageReactionResolvable to a MessageReaction object.\n * @method resolve\n * @memberof ReactionManager\n * @instance\n * @param {MessageReactionResolvable} reaction The MessageReaction to resolve\n * @returns {?MessageReaction}\n */\n\n /**\n * Resolves a MessageReactionResolvable to a MessageReaction ID string.\n * @method resolveID\n * @memberof ReactionManager\n * @instance\n * @param {MessageReactionResolvable} reaction The MessageReaction to resolve\n * @returns {?Snowflake}\n */\n\n /**\n * Removes all reactions from a message.\n * @returns {Promise<Message>}\n */\n removeAll() {\n return this.client.api\n .channels(this.message.channel.id)\n .messages(this.message.id)\n .reactions.delete()\n .then(() => this.message);\n }\n}\n\nmodule.exports = ReactionManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/ReactionManager.js?')},"./src/managers/ReactionUserManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ \"./src/managers/BaseManager.js\");\nconst { Error } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\n\n/**\n * Manages API methods for users who reacted to a reaction and stores their cache.\n * @extends {BaseManager}\n */\nclass ReactionUserManager extends BaseManager {\n constructor(client, iterable, reaction) {\n super(client, iterable, { name: 'User' });\n /**\n * The reaction that this manager belongs to\n * @type {MessageReaction}\n */\n this.reaction = reaction;\n }\n\n /**\n * The cache of this manager\n * @type {Collection<Snowflake, User>}\n * @name ReactionUserManager#cache\n */\n\n /**\n * Fetches all the users that gave this reaction. Resolves with a collection of users, mapped by their IDs.\n * @param {Object} [options] Options for fetching the users\n * @param {number} [options.limit=100] The maximum amount of users to fetch, defaults to 100\n * @param {Snowflake} [options.before] Limit fetching users to those with an id lower than the supplied id\n * @param {Snowflake} [options.after] Limit fetching users to those with an id greater than the supplied id\n * @returns {Promise<Collection<Snowflake, User>>}\n */\n async fetch({ limit = 100, after, before } = {}) {\n const message = this.reaction.message;\n const data = await this.client.api.channels[message.channel.id].messages[message.id].reactions[\n this.reaction.emoji.identifier\n ].get({ query: { limit, before, after } });\n const users = new Collection();\n for (const rawUser of data) {\n const user = this.client.users.add(rawUser);\n this.cache.set(user.id, user);\n users.set(user.id, user);\n }\n return users;\n }\n\n /**\n * Removes a user from this reaction.\n * @param {UserResolvable} [user=this.reaction.message.client.user] The user to remove the reaction of\n * @returns {Promise<MessageReaction>}\n */\n remove(user = this.reaction.message.client.user) {\n const message = this.reaction.message;\n const userID = message.client.users.resolveID(user);\n if (!userID) return Promise.reject(new Error('REACTION_RESOLVE_USER'));\n return message.client.api.channels[message.channel.id].messages[message.id].reactions[\n this.reaction.emoji.identifier\n ][userID === message.client.user.id ? '@me' : userID]\n .delete()\n .then(() => this.reaction);\n }\n}\n\nmodule.exports = ReactionUserManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/ReactionUserManager.js?")},"./src/managers/RoleManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ \"./src/managers/BaseManager.js\");\nconst Role = __webpack_require__(/*! ../structures/Role */ \"./src/structures/Role.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\nconst { resolveColor } = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Manages API methods for roles and stores their cache.\n * @extends {BaseManager}\n */\nclass RoleManager extends BaseManager {\n constructor(guild, iterable) {\n super(guild.client, iterable, Role);\n /**\n * The guild belonging to this manager\n * @type {Guild}\n */\n this.guild = guild;\n }\n\n /**\n * The role cache of this manager\n * @type {Collection<Snowflake, Role>}\n * @name RoleManager#cache\n */\n\n add(data, cache) {\n return super.add(data, cache, { extras: [this.guild] });\n }\n\n /**\n * Obtains one or more roles from Discord, or the role cache if they're already available.\n * @param {Snowflake} [id] ID or IDs of the role(s)\n * @param {boolean} [cache=true] Whether to cache the new roles objects if it weren't already\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<Role|RoleManager>}\n * @example\n * // Fetch all roles from the guild\n * message.guild.roles.fetch()\n * .then(roles => console.log(`There are ${roles.cache.size} roles.`))\n * .catch(console.error);\n * @example\n * // Fetch a single role\n * message.guild.roles.fetch('222078108977594368')\n * .then(role => console.log(`The role color is: ${role.color}`))\n * .catch(console.error);\n */\n async fetch(id, cache = true, force = false) {\n if (id && !force) {\n const existing = this.cache.get(id);\n if (existing) return existing;\n }\n\n // We cannot fetch a single role, as of this commit's date, Discord API throws with 405\n const roles = await this.client.api.guilds(this.guild.id).roles.get();\n for (const role of roles) this.add(role, cache);\n return id ? this.cache.get(id) || null : this;\n }\n\n /**\n * Data that can be resolved to a Role object. This can be:\n * * A Role\n * * A Snowflake\n * @typedef {Role|Snowflake} RoleResolvable\n */\n\n /**\n * Resolves a RoleResolvable to a Role object.\n * @method resolve\n * @memberof RoleManager\n * @instance\n * @param {RoleResolvable} role The role resolvable to resolve\n * @returns {?Role}\n */\n\n /**\n * Resolves a RoleResolvable to a role ID string.\n * @method resolveID\n * @memberof RoleManager\n * @instance\n * @param {RoleResolvable} role The role resolvable to resolve\n * @returns {?Snowflake}\n */\n\n /**\n * Creates a new role in the guild with given information.\n * <warn>The position will silently reset to 1 if an invalid one is provided, or none.</warn>\n * @param {Object} [options] Options\n * @param {RoleData} [options.data] The data to create the role with\n * @param {string} [options.reason] Reason for creating this role\n * @returns {Promise<Role>}\n * @example\n * // Create a new role\n * guild.roles.create()\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Create a new role with data and a reason\n * guild.roles.create({\n * data: {\n * name: 'Super Cool People',\n * color: 'BLUE',\n * },\n * reason: 'we needed a role for Super Cool People',\n * })\n * .then(console.log)\n * .catch(console.error);\n */\n create({ data = {}, reason } = {}) {\n if (data.color) data.color = resolveColor(data.color);\n if (data.permissions) data.permissions = Permissions.resolve(data.permissions);\n\n return this.guild.client.api\n .guilds(this.guild.id)\n .roles.post({ data, reason })\n .then(r => {\n const { role } = this.client.actions.GuildRoleCreate.handle({\n guild_id: this.guild.id,\n role: r,\n });\n if (data.position) return role.setPosition(data.position, reason);\n return role;\n });\n }\n\n /**\n * The `@everyone` role of the guild\n * @type {Role}\n * @readonly\n */\n get everyone() {\n return this.cache.get(this.guild.id);\n }\n\n /**\n * The role with the highest position in the cache\n * @type {Role}\n * @readonly\n */\n get highest() {\n return this.cache.reduce((prev, role) => (role.comparePositionTo(prev) > 0 ? role : prev), this.cache.first());\n }\n}\n\nmodule.exports = RoleManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/RoleManager.js?")},"./src/managers/UserManager.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ "./src/managers/BaseManager.js");\nconst GuildMember = __webpack_require__(/*! ../structures/GuildMember */ "./src/structures/GuildMember.js");\nconst Message = __webpack_require__(/*! ../structures/Message */ "./src/structures/Message.js");\nconst User = __webpack_require__(/*! ../structures/User */ "./src/structures/User.js");\n\n/**\n * Manages API methods for users and stores their cache.\n * @extends {BaseManager}\n */\nclass UserManager extends BaseManager {\n constructor(client, iterable) {\n super(client, iterable, User);\n }\n\n /**\n * The cache of this manager\n * @type {Collection<Snowflake, User>}\n * @name UserManager#cache\n */\n\n /**\n * Data that resolves to give a User object. This can be:\n * * A User object\n * * A Snowflake\n * * A Message object (resolves to the message author)\n * * A GuildMember object\n * @typedef {User|Snowflake|Message|GuildMember} UserResolvable\n */\n\n /**\n * Resolves a UserResolvable to a User object.\n * @param {UserResolvable} user The UserResolvable to identify\n * @returns {?User}\n */\n resolve(user) {\n if (user instanceof GuildMember) return user.user;\n if (user instanceof Message) return user.author;\n return super.resolve(user);\n }\n\n /**\n * Resolves a UserResolvable to a user ID string.\n * @param {UserResolvable} user The UserResolvable to identify\n * @returns {?Snowflake}\n */\n resolveID(user) {\n if (user instanceof GuildMember) return user.user.id;\n if (user instanceof Message) return user.author.id;\n return super.resolveID(user);\n }\n\n /**\n * Obtains a user from Discord, or the user cache if it\'s already available.\n * @param {Snowflake} id ID of the user\n * @param {boolean} [cache=true] Whether to cache the new user object if it isn\'t already\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<User>}\n */\n async fetch(id, cache = true, force = false) {\n if (!force) {\n const existing = this.cache.get(id);\n if (existing && !existing.partial) return existing;\n }\n\n const data = await this.client.api.users(id).get();\n return this.add(data, cache);\n }\n}\n\nmodule.exports = UserManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/UserManager.js?')},"./src/managers/VoiceStateManager.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst BaseManager = __webpack_require__(/*! ./BaseManager */ \"./src/managers/BaseManager.js\");\n\n/**\n * Manages API methods for VoiceStates and stores their cache.\n * @extends {BaseManager}\n */\nclass VoiceStateManager extends BaseManager {\n constructor(guild, iterable) {\n super(guild.client, iterable, { name: 'VoiceState' });\n /**\n * The guild this manager belongs to\n * @type {Guild}\n */\n this.guild = guild;\n }\n\n /**\n * The cache of this manager\n * @type {Collection<Snowflake, VoiceState>}\n * @name VoiceStateManager#cache\n */\n\n add(data, cache = true) {\n const existing = this.cache.get(data.user_id);\n if (existing) return existing._patch(data);\n\n const entry = new this.holds(this.guild, data);\n if (cache) this.cache.set(data.user_id, entry);\n return entry;\n }\n}\n\nmodule.exports = VoiceStateManager;\n\n\n//# sourceURL=webpack://Discord/./src/managers/VoiceStateManager.js?")},"./src/rest/APIRequest.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst https = __webpack_require__(/*! https */ 0);\nconst FormData = __webpack_require__(/*! @discordjs/form-data */ \"./node_modules/@discordjs/form-data/lib/browser.js\");\nconst AbortController = __webpack_require__(/*! abort-controller */ \"./node_modules/abort-controller/browser.js\");\nconst fetch = __webpack_require__(/*! node-fetch */ \"./node_modules/node-fetch/browser.js\");\nconst { browser, UserAgent } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\n\nif (https.Agent) var agent = new https.Agent({ keepAlive: true });\n\nclass APIRequest {\n constructor(rest, method, path, options) {\n this.rest = rest;\n this.client = rest.client;\n this.method = method;\n this.route = options.route;\n this.options = options;\n\n let queryString = '';\n if (options.query) {\n const query = Object.entries(options.query)\n .filter(([, value]) => ![null, 'null', 'undefined'].includes(value) && typeof value !== 'undefined')\n .flatMap(([key, value]) => (Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]));\n queryString = new URLSearchParams(query).toString();\n }\n this.path = `${path}${queryString && `?${queryString}`}`;\n }\n\n make() {\n const API =\n this.options.versioned === false\n ? this.client.options.http.api\n : `${this.client.options.http.api}/v${this.client.options.http.version}`;\n const url = API + this.path;\n let headers = {};\n\n if (this.options.auth !== false) headers.Authorization = this.rest.getAuth();\n if (this.options.reason) headers['X-Audit-Log-Reason'] = encodeURIComponent(this.options.reason);\n if (!browser) headers['User-Agent'] = UserAgent;\n if (this.options.headers) headers = Object.assign(headers, this.options.headers);\n\n let body;\n if (this.options.files && this.options.files.length) {\n body = new FormData();\n for (const file of this.options.files) if (file && file.file) body.append(file.name, file.file, file.name);\n if (typeof this.options.data !== 'undefined') body.append('payload_json', JSON.stringify(this.options.data));\n if (!browser) headers = Object.assign(headers, body.getHeaders());\n // eslint-disable-next-line eqeqeq\n } else if (this.options.data != null) {\n body = JSON.stringify(this.options.data);\n headers['Content-Type'] = 'application/json';\n }\n\n const controller = new AbortController();\n const timeout = this.client.setTimeout(() => controller.abort(), this.client.options.restRequestTimeout);\n return fetch(url, {\n method: this.method,\n headers,\n agent,\n body,\n signal: controller.signal,\n }).finally(() => this.client.clearTimeout(timeout));\n }\n}\n\nmodule.exports = APIRequest;\n\n\n//# sourceURL=webpack://Discord/./src/rest/APIRequest.js?")},"./src/rest/APIRouter.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst noop = () => {}; // eslint-disable-line no-empty-function\nconst methods = ['get', 'post', 'delete', 'patch', 'put'];\nconst reflectors = [\n 'toString',\n 'valueOf',\n 'inspect',\n 'constructor',\n Symbol.toPrimitive,\n Symbol.for('nodejs.util.inspect.custom'),\n];\n\nfunction buildRoute(manager) {\n const route = [''];\n const handler = {\n get(target, name) {\n if (reflectors.includes(name)) return () => route.join('/');\n if (methods.includes(name)) {\n const routeBucket = [];\n for (let i = 0; i < route.length; i++) {\n // Reactions routes and sub-routes all share the same bucket\n if (route[i - 1] === 'reactions') break;\n // Literal IDs should only be taken account if they are the Major ID (the Channel/Guild ID)\n if (/\\d{16,19}/g.test(route[i]) && !/channels|guilds/.test(route[i - 1])) routeBucket.push(':id');\n // All other parts of the route should be considered as part of the bucket identifier\n else routeBucket.push(route[i]);\n }\n return options =>\n manager.request(\n name,\n route.join('/'),\n Object.assign(\n {\n versioned: manager.versioned,\n route: routeBucket.join('/'),\n },\n options,\n ),\n );\n }\n route.push(name);\n return new Proxy(noop, handler);\n },\n apply(target, _, args) {\n route.push(...args.filter(x => x != null)); // eslint-disable-line eqeqeq\n return new Proxy(noop, handler);\n },\n };\n return new Proxy(noop, handler);\n}\n\nmodule.exports = buildRoute;\n\n\n//# sourceURL=webpack://Discord/./src/rest/APIRouter.js?")},"./src/rest/DiscordAPIError.js":function(module,exports,__webpack_require__){"use strict";eval("\n\n/**\n * Represents an error from the Discord API.\n * @extends Error\n */\nclass DiscordAPIError extends Error {\n constructor(path, error, method, status) {\n super();\n const flattened = this.constructor.flattenErrors(error.errors || error).join('\\n');\n this.name = 'DiscordAPIError';\n this.message = error.message && flattened ? `${error.message}\\n${flattened}` : error.message || flattened;\n\n /**\n * The HTTP method used for the request\n * @type {string}\n */\n this.method = method;\n\n /**\n * The path of the request relative to the HTTP endpoint\n * @type {string}\n */\n this.path = path;\n\n /**\n * HTTP error code returned by Discord\n * @type {number}\n */\n this.code = error.code;\n\n /**\n * The HTTP status code\n * @type {number}\n */\n this.httpStatus = status;\n }\n\n /**\n * Flattens an errors object returned from the API into an array.\n * @param {Object} obj Discord errors object\n * @param {string} [key] Used internally to determine key names of nested fields\n * @returns {string[]}\n * @private\n */\n static flattenErrors(obj, key = '') {\n let messages = [];\n\n for (const [k, v] of Object.entries(obj)) {\n if (k === 'message') continue;\n const newKey = key ? (isNaN(k) ? `${key}.${k}` : `${key}[${k}]`) : k;\n\n if (v._errors) {\n messages.push(`${newKey}: ${v._errors.map(e => e.message).join(' ')}`);\n } else if (v.code || v.message) {\n messages.push(`${v.code ? `${v.code}: ` : ''}${v.message}`.trim());\n } else if (typeof v === 'string') {\n messages.push(v);\n } else {\n messages = messages.concat(this.flattenErrors(v, newKey));\n }\n }\n\n return messages;\n }\n}\n\nmodule.exports = DiscordAPIError;\n\n\n//# sourceURL=webpack://Discord/./src/rest/DiscordAPIError.js?")},"./src/rest/HTTPError.js":function(module,exports,__webpack_require__){"use strict";eval("\n\n/**\n * Represents a HTTP error from a request.\n * @extends Error\n */\nclass HTTPError extends Error {\n constructor(message, name, code, method, path) {\n super(message);\n\n /**\n * The name of the error\n * @type {string}\n */\n this.name = name;\n\n /**\n * HTTP error code returned from the request\n * @type {number}\n */\n this.code = code || 500;\n\n /**\n * The HTTP method used for the request\n * @type {string}\n */\n this.method = method;\n\n /**\n * The path of the request relative to the HTTP endpoint\n * @type {string}\n */\n this.path = path;\n }\n}\n\nmodule.exports = HTTPError;\n\n\n//# sourceURL=webpack://Discord/./src/rest/HTTPError.js?")},"./src/rest/RESTManager.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst APIRequest = __webpack_require__(/*! ./APIRequest */ "./src/rest/APIRequest.js");\nconst routeBuilder = __webpack_require__(/*! ./APIRouter */ "./src/rest/APIRouter.js");\nconst RequestHandler = __webpack_require__(/*! ./RequestHandler */ "./src/rest/RequestHandler.js");\nconst { Error } = __webpack_require__(/*! ../errors */ "./src/errors/index.js");\nconst Collection = __webpack_require__(/*! ../util/Collection */ "./src/util/Collection.js");\nconst { Endpoints } = __webpack_require__(/*! ../util/Constants */ "./src/util/Constants.js");\n\nclass RESTManager {\n constructor(client, tokenPrefix = \'Bot\') {\n this.client = client;\n this.handlers = new Collection();\n this.tokenPrefix = tokenPrefix;\n this.versioned = true;\n this.globalTimeout = null;\n if (client.options.restSweepInterval > 0) {\n client.setInterval(() => {\n this.handlers.sweep(handler => handler._inactive);\n }, client.options.restSweepInterval * 1000);\n }\n }\n\n get api() {\n return routeBuilder(this);\n }\n\n getAuth() {\n const token = this.client.token || this.client.accessToken;\n if (token) return `${this.tokenPrefix} ${token}`;\n throw new Error(\'TOKEN_MISSING\');\n }\n\n get cdn() {\n return Endpoints.CDN(this.client.options.http.cdn);\n }\n\n push(handler, apiRequest) {\n return new Promise((resolve, reject) => {\n handler\n .push({\n request: apiRequest,\n resolve,\n reject,\n retries: 0,\n })\n .catch(reject);\n });\n }\n\n request(method, url, options = {}) {\n const apiRequest = new APIRequest(this, method, url, options);\n let handler = this.handlers.get(apiRequest.route);\n\n if (!handler) {\n handler = new RequestHandler(this);\n this.handlers.set(apiRequest.route, handler);\n }\n\n return this.push(handler, apiRequest);\n }\n\n set endpoint(endpoint) {\n this.client.options.http.api = endpoint;\n }\n}\n\nmodule.exports = RESTManager;\n\n\n//# sourceURL=webpack://Discord/./src/rest/RESTManager.js?')},"./src/rest/RequestHandler.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst DiscordAPIError = __webpack_require__(/*! ./DiscordAPIError */ \"./src/rest/DiscordAPIError.js\");\nconst HTTPError = __webpack_require__(/*! ./HTTPError */ \"./src/rest/HTTPError.js\");\nconst {\n Events: { RATE_LIMIT },\n browser,\n} = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\nfunction parseResponse(res) {\n if (res.headers.get('content-type').startsWith('application/json')) return res.json();\n if (browser) return res.blob();\n return res.buffer();\n}\n\nfunction getAPIOffset(serverDate) {\n return new Date(serverDate).getTime() - Date.now();\n}\n\nfunction calculateReset(reset, serverDate) {\n return new Date(Number(reset) * 1000).getTime() - getAPIOffset(serverDate);\n}\n\nclass RequestHandler {\n constructor(manager) {\n this.manager = manager;\n this.busy = false;\n this.queue = [];\n this.reset = -1;\n this.remaining = -1;\n this.limit = -1;\n this.retryAfter = -1;\n }\n\n push(request) {\n if (this.busy) {\n this.queue.push(request);\n return this.run();\n } else {\n return this.execute(request);\n }\n }\n\n run() {\n if (this.queue.length === 0) return Promise.resolve();\n return this.execute(this.queue.shift());\n }\n\n get limited() {\n return Boolean(this.manager.globalTimeout) || (this.remaining <= 0 && Date.now() < this.reset);\n }\n\n get _inactive() {\n return this.queue.length === 0 && !this.limited && this.busy !== true;\n }\n\n async execute(item) {\n // Insert item back to the beginning if currently busy\n if (this.busy) {\n this.queue.unshift(item);\n return null;\n }\n\n this.busy = true;\n const { reject, request, resolve } = item;\n\n // After calculations and requests have been done, pre-emptively stop further requests\n if (this.limited) {\n const timeout = this.reset + this.manager.client.options.restTimeOffset - Date.now();\n\n if (this.manager.client.listenerCount(RATE_LIMIT)) {\n /**\n * Emitted when the client hits a rate limit while making a request\n * @event Client#rateLimit\n * @param {Object} rateLimitInfo Object containing the rate limit info\n * @param {number} rateLimitInfo.timeout Timeout in ms\n * @param {number} rateLimitInfo.limit Number of requests that can be made to this endpoint\n * @param {string} rateLimitInfo.method HTTP method used for request that triggered this event\n * @param {string} rateLimitInfo.path Path used for request that triggered this event\n * @param {string} rateLimitInfo.route Route used for request that triggered this event\n */\n this.manager.client.emit(RATE_LIMIT, {\n timeout,\n limit: this.limit,\n method: request.method,\n path: request.path,\n route: request.route,\n });\n }\n\n if (this.manager.globalTimeout) {\n await this.manager.globalTimeout;\n } else {\n // Wait for the timeout to expire in order to avoid an actual 429\n await Util.delayFor(timeout);\n }\n }\n\n // Perform the request\n let res;\n try {\n res = await request.make();\n } catch (error) {\n // NodeFetch error expected for all \"operational\" errors, such as 500 status code\n this.busy = false;\n return reject(new HTTPError(error.message, error.constructor.name, error.status, request.method, request.path));\n }\n\n if (res && res.headers) {\n const serverDate = res.headers.get('date');\n const limit = res.headers.get('x-ratelimit-limit');\n const remaining = res.headers.get('x-ratelimit-remaining');\n const reset = res.headers.get('x-ratelimit-reset');\n const retryAfter = res.headers.get('retry-after');\n\n this.limit = limit ? Number(limit) : Infinity;\n this.remaining = remaining ? Number(remaining) : 1;\n this.reset = reset ? calculateReset(reset, serverDate) : Date.now();\n this.retryAfter = retryAfter ? Number(retryAfter) : -1;\n\n // https://github.com/discordapp/discord-api-docs/issues/182\n if (item.request.route.includes('reactions')) {\n this.reset = new Date(serverDate).getTime() - getAPIOffset(serverDate) + 250;\n }\n\n // Handle global ratelimit\n if (res.headers.get('x-ratelimit-global')) {\n // Set the manager's global timeout as the promise for other requests to \"wait\"\n this.manager.globalTimeout = Util.delayFor(this.retryAfter);\n\n // Wait for the global timeout to resolve before continuing\n await this.manager.globalTimeout;\n\n // Clean up global timeout\n this.manager.globalTimeout = null;\n }\n }\n\n // Finished handling headers, safe to unlock manager\n this.busy = false;\n\n if (res.ok) {\n const success = await parseResponse(res);\n // Nothing wrong with the request, proceed with the next one\n resolve(success);\n return this.run();\n } else if (res.status === 429) {\n // A ratelimit was hit - this should never happen\n this.queue.unshift(item);\n this.manager.client.emit('debug', `429 hit on route ${item.request.route}`);\n await Util.delayFor(this.retryAfter);\n return this.run();\n } else if (res.status >= 500 && res.status < 600) {\n // Retry the specified number of times for possible serverside issues\n if (item.retries === this.manager.client.options.retryLimit) {\n return reject(\n new HTTPError(res.statusText, res.constructor.name, res.status, item.request.method, request.path),\n );\n } else {\n item.retries++;\n this.queue.unshift(item);\n return this.run();\n }\n } else {\n // Handle possible malformed requests\n try {\n const data = await parseResponse(res);\n if (res.status >= 400 && res.status < 500) {\n return reject(new DiscordAPIError(request.path, data, request.method, res.status));\n }\n return null;\n } catch (err) {\n return reject(new HTTPError(err.message, err.constructor.name, err.status, request.method, request.path));\n }\n }\n }\n}\n\nmodule.exports = RequestHandler;\n\n\n//# sourceURL=webpack://Discord/./src/rest/RequestHandler.js?")},"./src/structures/APIMessage.js":function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst MessageAttachment = __webpack_require__(/*! ./MessageAttachment */ \"./src/structures/MessageAttachment.js\");\nconst MessageEmbed = __webpack_require__(/*! ./MessageEmbed */ \"./src/structures/MessageEmbed.js\");\nconst { RangeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst { browser } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst DataResolver = __webpack_require__(/*! ../util/DataResolver */ \"./src/util/DataResolver.js\");\nconst MessageFlags = __webpack_require__(/*! ../util/MessageFlags */ \"./src/util/MessageFlags.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Represents a message to be sent to the API.\n */\nclass APIMessage {\n /**\n * @param {MessageTarget} target - The target for this message to be sent to\n * @param {MessageOptions|WebhookMessageOptions} options - Options passed in from send\n */\n constructor(target, options) {\n /**\n * The target for this message to be sent to\n * @type {MessageTarget}\n */\n this.target = target;\n\n /**\n * Options passed in from send\n * @type {MessageOptions|WebhookMessageOptions}\n */\n this.options = options;\n\n /**\n * Data sendable to the API\n * @type {?Object}\n */\n this.data = null;\n\n /**\n * Files sendable to the API\n * @type {?Object[]}\n */\n this.files = null;\n }\n\n /**\n * Whether or not the target is a webhook\n * @type {boolean}\n * @readonly\n */\n get isWebhook() {\n const Webhook = __webpack_require__(/*! ./Webhook */ \"./src/structures/Webhook.js\");\n const WebhookClient = __webpack_require__(/*! ../client/WebhookClient */ \"./src/client/WebhookClient.js\");\n return this.target instanceof Webhook || this.target instanceof WebhookClient;\n }\n\n /**\n * Whether or not the target is a user\n * @type {boolean}\n * @readonly\n */\n get isUser() {\n const User = __webpack_require__(/*! ./User */ \"./src/structures/User.js\");\n const GuildMember = __webpack_require__(/*! ./GuildMember */ \"./src/structures/GuildMember.js\");\n return this.target instanceof User || this.target instanceof GuildMember;\n }\n\n /**\n * Whether or not the target is a message\n * @type {boolean}\n * @readonly\n */\n get isMessage() {\n const Message = __webpack_require__(/*! ./Message */ \"./src/structures/Message.js\");\n return this.target instanceof Message;\n }\n\n /**\n * Makes the content of this message.\n * @returns {?(string|string[])}\n */\n makeContent() {\n const GuildMember = __webpack_require__(/*! ./GuildMember */ \"./src/structures/GuildMember.js\");\n\n let content;\n if (this.options.content === null) {\n content = '';\n } else if (typeof this.options.content !== 'undefined') {\n content = Util.resolveString(this.options.content);\n }\n\n if (typeof content !== 'string') return content;\n\n const disableMentions =\n typeof this.options.disableMentions === 'undefined'\n ? this.target.client.options.disableMentions\n : this.options.disableMentions;\n if (disableMentions === 'all') {\n content = Util.removeMentions(content);\n } else if (disableMentions === 'everyone') {\n content = content.replace(/@([^<>@ ]*)/gmsu, (match, target) => {\n if (target.match(/^[&!]?\\d+$/)) {\n return `@${target}`;\n } else {\n return `@\\u200b${target}`;\n }\n });\n }\n\n const isSplit = typeof this.options.split !== 'undefined' && this.options.split !== false;\n const isCode = typeof this.options.code !== 'undefined' && this.options.code !== false;\n const splitOptions = isSplit ? { ...this.options.split } : undefined;\n\n let mentionPart = '';\n if (this.options.reply && !this.isUser && this.target.type !== 'dm') {\n const id = this.target.client.users.resolveID(this.options.reply);\n mentionPart = `<@${this.options.reply instanceof GuildMember && this.options.reply.nickname ? '!' : ''}${id}>, `;\n if (isSplit) {\n splitOptions.prepend = `${mentionPart}${splitOptions.prepend || ''}`;\n }\n }\n\n if (content || mentionPart) {\n if (isCode) {\n const codeName = typeof this.options.code === 'string' ? this.options.code : '';\n content = `${mentionPart}\\`\\`\\`${codeName}\\n${Util.cleanCodeBlockContent(content)}\\n\\`\\`\\``;\n if (isSplit) {\n splitOptions.prepend = `${splitOptions.prepend || ''}\\`\\`\\`${codeName}\\n`;\n splitOptions.append = `\\n\\`\\`\\`${splitOptions.append || ''}`;\n }\n } else if (mentionPart) {\n content = `${mentionPart}${content}`;\n }\n\n if (isSplit) {\n content = Util.splitMessage(content, splitOptions);\n }\n }\n\n return content;\n }\n\n /**\n * Resolves data.\n * @returns {APIMessage}\n */\n resolveData() {\n if (this.data) return this;\n\n const content = this.makeContent();\n const tts = Boolean(this.options.tts);\n\n let nonce;\n if (typeof this.options.nonce !== 'undefined') {\n nonce = parseInt(this.options.nonce);\n if (isNaN(nonce) || nonce < 0) throw new RangeError('MESSAGE_NONCE_TYPE');\n }\n\n const embedLikes = [];\n if (this.isWebhook) {\n if (this.options.embeds) {\n embedLikes.push(...this.options.embeds);\n }\n } else if (this.options.embed) {\n embedLikes.push(this.options.embed);\n }\n const embeds = embedLikes.map(e => new MessageEmbed(e).toJSON());\n\n let username;\n let avatarURL;\n if (this.isWebhook) {\n username = this.options.username || this.target.name;\n if (this.options.avatarURL) avatarURL = this.options.avatarURL;\n }\n\n let flags;\n if (this.isMessage) {\n // eslint-disable-next-line eqeqeq\n flags = this.options.flags != null ? new MessageFlags(this.options.flags).bitfield : this.target.flags.bitfield;\n }\n\n let allowedMentions =\n typeof this.options.allowedMentions === 'undefined'\n ? this.target.client.options.allowedMentions\n : this.options.allowedMentions;\n if (this.options.reply) {\n const id = this.target.client.users.resolveID(this.options.reply);\n if (allowedMentions) {\n // Clone the object as to alter the ClientOptions object\n allowedMentions = Util.cloneObject(allowedMentions);\n const parsed = allowedMentions.parse && allowedMentions.parse.includes('users');\n // Check if the mention won't be parsed, and isn't supplied in `users`\n if (!parsed && !(allowedMentions.users && allowedMentions.users.includes(id))) {\n if (!allowedMentions.users) allowedMentions.users = [];\n allowedMentions.users.push(id);\n }\n } else {\n allowedMentions = { users: [id] };\n }\n }\n\n this.data = {\n content,\n tts,\n nonce,\n embed: this.options.embed === null ? null : embeds[0],\n embeds,\n username,\n avatar_url: avatarURL,\n allowed_mentions: typeof content === 'undefined' ? undefined : allowedMentions,\n flags,\n };\n return this;\n }\n\n /**\n * Resolves files.\n * @returns {Promise<APIMessage>}\n */\n async resolveFiles() {\n if (this.files) return this;\n\n const embedLikes = [];\n if (this.isWebhook) {\n if (this.options.embeds) {\n embedLikes.push(...this.options.embeds);\n }\n } else if (this.options.embed) {\n embedLikes.push(this.options.embed);\n }\n\n const fileLikes = [];\n if (this.options.files) {\n fileLikes.push(...this.options.files);\n }\n for (const embed of embedLikes) {\n if (embed.files) {\n fileLikes.push(...embed.files);\n }\n }\n\n this.files = await Promise.all(fileLikes.map(f => this.constructor.resolveFile(f)));\n return this;\n }\n\n /**\n * Converts this APIMessage into an array of APIMessages for each split content\n * @returns {APIMessage[]}\n */\n split() {\n if (!this.data) this.resolveData();\n\n if (!Array.isArray(this.data.content)) return [this];\n\n const apiMessages = [];\n\n for (let i = 0; i < this.data.content.length; i++) {\n let data;\n let opt;\n\n if (i === this.data.content.length - 1) {\n data = { ...this.data, content: this.data.content[i] };\n opt = { ...this.options, content: this.data.content[i] };\n } else {\n data = { content: this.data.content[i], tts: this.data.tts, allowed_mentions: this.options.allowedMentions };\n opt = { content: this.data.content[i], tts: this.data.tts, allowedMentions: this.options.allowedMentions };\n }\n\n const apiMessage = new APIMessage(this.target, opt);\n apiMessage.data = data;\n apiMessages.push(apiMessage);\n }\n\n return apiMessages;\n }\n\n /**\n * Resolves a single file into an object sendable to the API.\n * @param {BufferResolvable|Stream|FileOptions|MessageAttachment} fileLike Something that could be resolved to a file\n * @returns {Object}\n */\n static async resolveFile(fileLike) {\n let attachment;\n let name;\n\n const findName = thing => {\n if (typeof thing === 'string') {\n return Util.basename(thing);\n }\n\n if (thing.path) {\n return Util.basename(thing.path);\n }\n\n return 'file.jpg';\n };\n\n const ownAttachment =\n typeof fileLike === 'string' ||\n fileLike instanceof (browser ? ArrayBuffer : Buffer) ||\n typeof fileLike.pipe === 'function';\n if (ownAttachment) {\n attachment = fileLike;\n name = findName(attachment);\n } else {\n attachment = fileLike.attachment;\n name = fileLike.name || findName(attachment);\n }\n\n const resource = await DataResolver.resolveFile(attachment);\n return { attachment, name, file: resource };\n }\n\n /**\n * Partitions embeds and attachments.\n * @param {Array<MessageEmbed|MessageAttachment>} items Items to partition\n * @returns {Array<MessageEmbed[], MessageAttachment[]>}\n */\n static partitionMessageAdditions(items) {\n const embeds = [];\n const files = [];\n for (const item of items) {\n if (item instanceof MessageEmbed) {\n embeds.push(item);\n } else if (item instanceof MessageAttachment) {\n files.push(item);\n }\n }\n\n return [embeds, files];\n }\n\n /**\n * Transforms the user-level arguments into a final options object. Passing a transformed options object alone into\n * this method will keep it the same, allowing for the reuse of the final options object.\n * @param {StringResolvable} [content] Content to send\n * @param {MessageOptions|WebhookMessageOptions|MessageAdditions} [options={}] Options to use\n * @param {MessageOptions|WebhookMessageOptions} [extra={}] Extra options to add onto transformed options\n * @param {boolean} [isWebhook=false] Whether or not to use WebhookMessageOptions as the result\n * @returns {MessageOptions|WebhookMessageOptions}\n */\n static transformOptions(content, options, extra = {}, isWebhook = false) {\n if (!options && typeof content === 'object' && !Array.isArray(content)) {\n options = content;\n content = undefined;\n }\n\n if (!options) {\n options = {};\n } else if (options instanceof MessageEmbed) {\n return isWebhook ? { content, embeds: [options], ...extra } : { content, embed: options, ...extra };\n } else if (options instanceof MessageAttachment) {\n return { content, files: [options], ...extra };\n }\n\n if (Array.isArray(options)) {\n const [embeds, files] = this.partitionMessageAdditions(options);\n return isWebhook ? { content, embeds, files, ...extra } : { content, embed: embeds[0], files, ...extra };\n } else if (Array.isArray(content)) {\n const [embeds, files] = this.partitionMessageAdditions(content);\n if (embeds.length || files.length) {\n return isWebhook ? { embeds, files, ...extra } : { embed: embeds[0], files, ...extra };\n }\n }\n\n return { content, ...options, ...extra };\n }\n\n /**\n * Creates an `APIMessage` from user-level arguments.\n * @param {MessageTarget} target Target to send to\n * @param {StringResolvable} [content] Content to send\n * @param {MessageOptions|WebhookMessageOptions|MessageAdditions} [options={}] Options to use\n * @param {MessageOptions|WebhookMessageOptions} [extra={}] - Extra options to add onto transformed options\n * @returns {MessageOptions|WebhookMessageOptions}\n */\n static create(target, content, options, extra = {}) {\n const Webhook = __webpack_require__(/*! ./Webhook */ \"./src/structures/Webhook.js\");\n const WebhookClient = __webpack_require__(/*! ../client/WebhookClient */ \"./src/client/WebhookClient.js\");\n\n const isWebhook = target instanceof Webhook || target instanceof WebhookClient;\n const transformed = this.transformOptions(content, options, extra, isWebhook);\n return new this(target, transformed);\n }\n}\n\nmodule.exports = APIMessage;\n\n/**\n * A target for a message.\n * @typedef {TextChannel|DMChannel|User|GuildMember|Webhook|WebhookClient} MessageTarget\n */\n\n/**\n * Additional items that can be sent with a message.\n * @typedef {MessageEmbed|MessageAttachment|Array<MessageEmbed|MessageAttachment>} MessageAdditions\n */\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/buffer/index.js */ \"./node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://Discord/./src/structures/APIMessage.js?")},"./src/structures/Base.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Represents a data model that is identifiable by a Snowflake (i.e. Discord API data models).\n */\nclass Base {\n constructor(client) {\n /**\n * The client that instantiated this\n * @name Base#client\n * @type {Client}\n * @readonly\n */\n Object.defineProperty(this, 'client', { value: client });\n }\n\n _clone() {\n return Object.assign(Object.create(this), this);\n }\n\n _patch(data) {\n return data;\n }\n\n _update(data) {\n const clone = this._clone();\n this._patch(data);\n return clone;\n }\n\n toJSON(...props) {\n return Util.flatten(this, ...props);\n }\n\n valueOf() {\n return this.id;\n }\n}\n\nmodule.exports = Base;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Base.js?")},"./src/structures/BaseGuildEmoji.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Emoji = __webpack_require__(/*! ./Emoji */ \"./src/structures/Emoji.js\");\n\n/**\n * Parent class for {@link GuildEmoji} and {@link GuildPreviewEmoji}.\n * @extends {Emoji}\n */\nclass BaseGuildEmoji extends Emoji {\n constructor(client, data, guild) {\n super(client, data);\n\n /**\n * The guild this emoji is a part of\n * @type {Guild|GuildPreview}\n */\n this.guild = guild;\n\n /**\n * Array of role ids this emoji is active for\n * @name BaseGuildEmoji#_roles\n * @type {Snowflake[]}\n * @private\n */\n Object.defineProperty(this, '_roles', { value: [], writable: true });\n\n this._patch(data);\n }\n\n _patch(data) {\n if (data.name) this.name = data.name;\n\n /**\n * Whether or not this emoji requires colons surrounding it\n * @type {boolean}\n * @name GuildEmoji#requiresColons\n */\n if (typeof data.require_colons !== 'undefined') this.requiresColons = data.require_colons;\n\n /**\n * Whether this emoji is managed by an external service\n * @type {boolean}\n * @name GuildEmoji#managed\n */\n if (typeof data.managed !== 'undefined') this.managed = data.managed;\n\n /**\n * Whether this emoji is available\n * @type {boolean}\n * @name GuildEmoji#available\n */\n if (typeof data.available !== 'undefined') this.available = data.available;\n\n if (data.roles) this._roles = data.roles;\n }\n}\n\nmodule.exports = BaseGuildEmoji;\n\n\n//# sourceURL=webpack://Discord/./src/structures/BaseGuildEmoji.js?")},"./src/structures/CategoryChannel.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst GuildChannel = __webpack_require__(/*! ./GuildChannel */ "./src/structures/GuildChannel.js");\n\n/**\n * Represents a guild category channel on Discord.\n * @extends {GuildChannel}\n */\nclass CategoryChannel extends GuildChannel {\n /**\n * Channels that are a part of this category\n * @type {Collection<Snowflake, GuildChannel>}\n * @readonly\n */\n get children() {\n return this.guild.channels.cache.filter(c => c.parentID === this.id);\n }\n\n /**\n * Sets the category parent of this channel.\n * <warn>It is not currently possible to set the parent of a CategoryChannel.</warn>\n * @method setParent\n * @memberof CategoryChannel\n * @instance\n * @param {?GuildChannel|Snowflake} channel Parent channel\n * @param {Object} [options={}] Options to pass\n * @param {boolean} [options.lockPermissions=true] Lock the permissions to what the parent\'s permissions are\n * @param {string} [options.reason] Reason for modifying the parent of this channel\n * @returns {Promise<GuildChannel>}\n */\n}\n\nmodule.exports = CategoryChannel;\n\n\n//# sourceURL=webpack://Discord/./src/structures/CategoryChannel.js?')},"./src/structures/Channel.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst { ChannelTypes } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Snowflake = __webpack_require__(/*! ../util/Snowflake */ \"./src/util/Snowflake.js\");\n\n/**\n * Represents any channel on Discord.\n * @extends {Base}\n */\nclass Channel extends Base {\n constructor(client, data) {\n super(client);\n\n const type = Object.keys(ChannelTypes)[data.type];\n /**\n * The type of the channel, either:\n * * `dm` - a DM channel\n * * `text` - a guild text channel\n * * `voice` - a guild voice channel\n * * `category` - a guild category channel\n * * `news` - a guild news channel\n * * `store` - a guild store channel\n * * `unknown` - a generic channel of unknown type, could be Channel or GuildChannel\n * @type {string}\n */\n this.type = type ? type.toLowerCase() : 'unknown';\n\n /**\n * Whether the channel has been deleted\n * @type {boolean}\n */\n this.deleted = false;\n\n if (data) this._patch(data);\n }\n\n _patch(data) {\n /**\n * The unique ID of the channel\n * @type {Snowflake}\n */\n this.id = data.id;\n }\n\n /**\n * The timestamp the channel was created at\n * @type {number}\n * @readonly\n */\n get createdTimestamp() {\n return Snowflake.deconstruct(this.id).timestamp;\n }\n\n /**\n * The time the channel was created at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n /**\n * When concatenated with a string, this automatically returns the channel's mention instead of the Channel object.\n * @returns {string}\n * @example\n * // Logs: Hello from <#123456789012345678>!\n * console.log(`Hello from ${channel}!`);\n */\n toString() {\n return `<#${this.id}>`;\n }\n\n /**\n * Deletes this channel.\n * @returns {Promise<Channel>}\n * @example\n * // Delete the channel\n * channel.delete()\n * .then(console.log)\n * .catch(console.error);\n */\n delete() {\n return this.client.api\n .channels(this.id)\n .delete()\n .then(() => this);\n }\n\n /**\n * Fetches this channel.\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<Channel>}\n */\n fetch(force = false) {\n return this.client.channels.fetch(this.id, true, force);\n }\n\n static create(client, data, guild) {\n const Structures = __webpack_require__(/*! ../util/Structures */ \"./src/util/Structures.js\");\n let channel;\n if (!data.guild_id && !guild) {\n if ((data.recipients && data.type !== ChannelTypes.GROUP) || data.type === ChannelTypes.DM) {\n const DMChannel = Structures.get('DMChannel');\n channel = new DMChannel(client, data);\n } else if (data.type === ChannelTypes.GROUP) {\n const PartialGroupDMChannel = __webpack_require__(/*! ./PartialGroupDMChannel */ \"./src/structures/PartialGroupDMChannel.js\");\n channel = new PartialGroupDMChannel(client, data);\n }\n } else {\n guild = guild || client.guilds.cache.get(data.guild_id);\n if (guild) {\n switch (data.type) {\n case ChannelTypes.TEXT: {\n const TextChannel = Structures.get('TextChannel');\n channel = new TextChannel(guild, data);\n break;\n }\n case ChannelTypes.VOICE: {\n const VoiceChannel = Structures.get('VoiceChannel');\n channel = new VoiceChannel(guild, data);\n break;\n }\n case ChannelTypes.CATEGORY: {\n const CategoryChannel = Structures.get('CategoryChannel');\n channel = new CategoryChannel(guild, data);\n break;\n }\n case ChannelTypes.NEWS: {\n const NewsChannel = Structures.get('NewsChannel');\n channel = new NewsChannel(guild, data);\n break;\n }\n case ChannelTypes.STORE: {\n const StoreChannel = Structures.get('StoreChannel');\n channel = new StoreChannel(guild, data);\n break;\n }\n }\n if (channel) guild.channels.cache.set(channel.id, channel);\n }\n }\n return channel;\n }\n\n toJSON(...props) {\n return super.toJSON({ createdTimestamp: true }, ...props);\n }\n}\n\nmodule.exports = Channel;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Channel.js?")},"./src/structures/ClientApplication.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst Team = __webpack_require__(/*! ./Team */ \"./src/structures/Team.js\");\nconst { ClientApplicationAssetTypes, Endpoints } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Snowflake = __webpack_require__(/*! ../util/Snowflake */ \"./src/util/Snowflake.js\");\n\nconst AssetTypes = Object.keys(ClientApplicationAssetTypes);\n\n/**\n * Represents a Client OAuth2 Application.\n * @extends {Base}\n */\nclass ClientApplication extends Base {\n constructor(client, data) {\n super(client);\n this._patch(data);\n }\n\n _patch(data) {\n /**\n * The ID of the app\n * @type {Snowflake}\n */\n this.id = data.id;\n\n /**\n * The name of the app\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The app's description\n * @type {string}\n */\n this.description = data.description;\n\n /**\n * The app's icon hash\n * @type {string}\n */\n this.icon = data.icon;\n\n /**\n * The app's cover image\n * @type {?string}\n */\n this.cover = data.cover_image || null;\n\n /**\n * The app's RPC origins, if enabled\n * @type {string[]}\n */\n this.rpcOrigins = data.rpc_origins || [];\n\n /**\n * If this app's bot requires a code grant when using the OAuth2 flow\n * @type {?boolean}\n */\n this.botRequireCodeGrant = typeof data.bot_require_code_grant !== 'undefined' ? data.bot_require_code_grant : null;\n\n /**\n * If this app's bot is public\n * @type {?boolean}\n */\n this.botPublic = typeof data.bot_public !== 'undefined' ? data.bot_public : null;\n\n /**\n * The owner of this OAuth application\n * @type {?User|Team}\n */\n this.owner = data.team ? new Team(this.client, data.team) : data.owner ? this.client.users.add(data.owner) : null;\n }\n\n /**\n * The timestamp the app was created at\n * @type {number}\n * @readonly\n */\n get createdTimestamp() {\n return Snowflake.deconstruct(this.id).timestamp;\n }\n\n /**\n * The time the app was created at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n /**\n * A link to the application's icon.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string} URL to the icon\n */\n iconURL({ format, size } = {}) {\n if (!this.icon) return null;\n return this.client.rest.cdn.AppIcon(this.id, this.icon, { format, size });\n }\n\n /**\n * A link to this application's cover image.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string} URL to the cover image\n */\n coverImage({ format, size } = {}) {\n if (!this.cover) return null;\n return Endpoints.CDN(this.client.options.http.cdn).AppIcon(this.id, this.cover, { format, size });\n }\n\n /**\n * Asset data.\n * @typedef {Object} ClientAsset\n * @property {Snowflake} id The asset ID\n * @property {string} name The asset name\n * @property {string} type The asset type\n */\n\n /**\n * Gets the clients rich presence assets.\n * @returns {Promise<Array<ClientAsset>>}\n */\n fetchAssets() {\n return this.client.api.oauth2\n .applications(this.id)\n .assets.get()\n .then(assets =>\n assets.map(a => ({\n id: a.id,\n name: a.name,\n type: AssetTypes[a.type - 1],\n })),\n );\n }\n\n /**\n * When concatenated with a string, this automatically returns the application's name instead of the\n * ClientApplication object.\n * @returns {string}\n * @example\n * // Logs: Application name: My App\n * console.log(`Application name: ${application}`);\n */\n toString() {\n return this.name;\n }\n\n toJSON() {\n return super.toJSON({ createdTimestamp: true });\n }\n}\n\nmodule.exports = ClientApplication;\n\n\n//# sourceURL=webpack://Discord/./src/structures/ClientApplication.js?")},"./src/structures/ClientPresence.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst { Presence } = __webpack_require__(/*! ./Presence */ \"./src/structures/Presence.js\");\nconst { TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst { ActivityTypes, OPCodes } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\n\nclass ClientPresence extends Presence {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} [data={}] The data for the client presence\n */\n constructor(client, data = {}) {\n super(client, Object.assign(data, { status: 'online', user: { id: null } }));\n }\n\n async set(presence) {\n const packet = await this._parse(presence);\n this.patch(packet);\n if (typeof presence.shardID === 'undefined') {\n this.client.ws.broadcast({ op: OPCodes.STATUS_UPDATE, d: packet });\n } else if (Array.isArray(presence.shardID)) {\n for (const shardID of presence.shardID) {\n this.client.ws.shards.get(shardID).send({ op: OPCodes.STATUS_UPDATE, d: packet });\n }\n } else {\n this.client.ws.shards.get(presence.shardID).send({ op: OPCodes.STATUS_UPDATE, d: packet });\n }\n return this;\n }\n\n async _parse({ status, since, afk, activity }) {\n const applicationID = activity && (activity.application ? activity.application.id || activity.application : null);\n let assets = new Collection();\n if (activity) {\n if (typeof activity.name !== 'string') throw new TypeError('INVALID_TYPE', 'name', 'string');\n if (!activity.type) activity.type = 0;\n if (activity.assets && applicationID) {\n try {\n const a = await this.client.api.oauth2.applications(applicationID).assets.get();\n for (const asset of a) assets.set(asset.name, asset.id);\n } catch {} // eslint-disable-line no-empty\n }\n }\n\n const packet = {\n afk: afk != null ? afk : false, // eslint-disable-line eqeqeq\n since: since != null ? since : null, // eslint-disable-line eqeqeq\n status: status || this.status,\n game: activity\n ? {\n type: activity.type,\n name: activity.name,\n url: activity.url,\n details: activity.details || undefined,\n state: activity.state || undefined,\n assets: activity.assets\n ? {\n large_text: activity.assets.largeText || undefined,\n small_text: activity.assets.smallText || undefined,\n large_image: assets.get(activity.assets.largeImage) || activity.assets.largeImage,\n small_image: assets.get(activity.assets.smallImage) || activity.assets.smallImage,\n }\n : undefined,\n timestamps: activity.timestamps || undefined,\n party: activity.party || undefined,\n application_id: applicationID || undefined,\n secrets: activity.secrets || undefined,\n instance: activity.instance || undefined,\n }\n : null,\n };\n\n if ((status || afk || since) && !activity) {\n packet.game = this.activities[0] || null;\n }\n\n if (packet.game) {\n packet.game.type =\n typeof packet.game.type === 'number' ? packet.game.type : ActivityTypes.indexOf(packet.game.type);\n }\n\n return packet;\n }\n}\n\nmodule.exports = ClientPresence;\n\n\n//# sourceURL=webpack://Discord/./src/structures/ClientPresence.js?")},"./src/structures/ClientUser.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst DataResolver = __webpack_require__(/*! ../util/DataResolver */ \"./src/util/DataResolver.js\");\nconst Structures = __webpack_require__(/*! ../util/Structures */ \"./src/util/Structures.js\");\n\n/**\n * Represents the logged in client's Discord user.\n * @extends {User}\n */\nclass ClientUser extends Structures.get('User') {\n constructor(client, data) {\n super(client, data);\n this._typing = new Map();\n }\n\n _patch(data) {\n super._patch(data);\n\n if ('verified' in data) {\n /**\n * Whether or not this account has been verified\n * @type {boolean}\n */\n this.verified = data.verified;\n }\n\n if ('mfa_enabled' in data) {\n /**\n * If the bot's {@link ClientApplication#owner Owner} has MFA enabled on their account\n * @type {?boolean}\n */\n this.mfaEnabled = typeof data.mfa_enabled === 'boolean' ? data.mfa_enabled : null;\n } else if (typeof this.mfaEnabled === 'undefined') {\n this.mfaEnabled = null;\n }\n\n if (data.token) this.client.token = data.token;\n }\n\n /**\n * ClientUser's presence\n * @type {Presence}\n * @readonly\n */\n get presence() {\n return this.client.presence;\n }\n\n edit(data) {\n return this.client.api\n .users('@me')\n .patch({ data })\n .then(newData => {\n this.client.token = newData.token;\n const { updated } = this.client.actions.UserUpdate.handle(newData);\n if (updated) return updated;\n return this;\n });\n }\n\n /**\n * Sets the username of the logged in client.\n * <info>Changing usernames in Discord is heavily rate limited, with only 2 requests\n * every hour. Use this sparingly!</info>\n * @param {string} username The new username\n * @returns {Promise<ClientUser>}\n * @example\n * // Set username\n * client.user.setUsername('discordjs')\n * .then(user => console.log(`My new username is ${user.username}`))\n * .catch(console.error);\n */\n setUsername(username) {\n return this.edit({ username });\n }\n\n /**\n * Sets the avatar of the logged in client.\n * @param {BufferResolvable|Base64Resolvable} avatar The new avatar\n * @returns {Promise<ClientUser>}\n * @example\n * // Set avatar\n * client.user.setAvatar('./avatar.png')\n * .then(user => console.log(`New avatar set!`))\n * .catch(console.error);\n */\n async setAvatar(avatar) {\n return this.edit({ avatar: await DataResolver.resolveImage(avatar) });\n }\n\n /**\n * Data resembling a raw Discord presence.\n * @typedef {Object} PresenceData\n * @property {PresenceStatusData} [status] Status of the user\n * @property {boolean} [afk] Whether the user is AFK\n * @property {Object} [activity] Activity the user is playing\n * @property {Object|string} [activity.application] An application object or application id\n * @property {string} [activity.application.id] The id of the application\n * @property {string} [activity.name] Name of the activity\n * @property {ActivityType|number} [activity.type] Type of the activity\n * @property {string} [activity.url] Stream url\n * @property {?number|number[]} [shardID] Shard Id(s) to have the activity set on\n */\n\n /**\n * Sets the full presence of the client user.\n * @param {PresenceData} data Data for the presence\n * @returns {Promise<Presence>}\n * @example\n * // Set the client user's presence\n * client.user.setPresence({ activity: { name: 'with discord.js' }, status: 'idle' })\n * .then(console.log)\n * .catch(console.error);\n */\n setPresence(data) {\n return this.client.presence.set(data);\n }\n\n /**\n * A user's status. Must be one of:\n * * `online`\n * * `idle`\n * * `invisible`\n * * `dnd` (do not disturb)\n * @typedef {string} PresenceStatusData\n */\n\n /**\n * Sets the status of the client user.\n * @param {PresenceStatusData} status Status to change to\n * @param {?number|number[]} [shardID] Shard ID(s) to have the activity set on\n * @returns {Promise<Presence>}\n * @example\n * // Set the client user's status\n * client.user.setStatus('idle')\n * .then(console.log)\n * .catch(console.error);\n */\n setStatus(status, shardID) {\n return this.setPresence({ status, shardID });\n }\n\n /**\n * Options for setting an activity\n * @typedef ActivityOptions\n * @type {Object}\n * @property {string} [url] Twitch stream URL\n * @property {ActivityType|number} [type] Type of the activity\n * @property {?number|number[]} [shardID] Shard Id(s) to have the activity set on\n */\n\n /**\n * Sets the activity the client user is playing.\n * @param {string|ActivityOptions} [name] Activity being played, or options for setting the activity\n * @param {ActivityOptions} [options] Options for setting the activity\n * @returns {Promise<Presence>}\n * @example\n * // Set the client user's activity\n * client.user.setActivity('discord.js', { type: 'WATCHING' })\n * .then(presence => console.log(`Activity set to ${presence.activities[0].name}`))\n * .catch(console.error);\n */\n setActivity(name, options = {}) {\n if (!name) return this.setPresence({ activity: null, shardID: options.shardID });\n\n const activity = Object.assign({}, options, typeof name === 'object' ? name : { name });\n return this.setPresence({ activity, shardID: activity.shardID });\n }\n\n /**\n * Sets/removes the AFK flag for the client user.\n * @param {boolean} afk Whether or not the user is AFK\n * @returns {Promise<Presence>}\n */\n setAFK(afk) {\n return this.setPresence({ afk });\n }\n}\n\nmodule.exports = ClientUser;\n\n\n//# sourceURL=webpack://Discord/./src/structures/ClientUser.js?")},"./src/structures/DMChannel.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Channel = __webpack_require__(/*! ./Channel */ \"./src/structures/Channel.js\");\nconst TextBasedChannel = __webpack_require__(/*! ./interfaces/TextBasedChannel */ \"./src/structures/interfaces/TextBasedChannel.js\");\nconst MessageManager = __webpack_require__(/*! ../managers/MessageManager */ \"./src/managers/MessageManager.js\");\n\n/**\n * Represents a direct message channel between two users.\n * @extends {Channel}\n * @implements {TextBasedChannel}\n */\nclass DMChannel extends Channel {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} data The data for the DM channel\n */\n constructor(client, data) {\n super(client, data);\n // Override the channel type so partials have a known type\n this.type = 'dm';\n /**\n * A manager of the messages belonging to this channel\n * @type {MessageManager}\n */\n this.messages = new MessageManager(this);\n this._typing = new Map();\n }\n\n _patch(data) {\n super._patch(data);\n\n if (data.recipients) {\n /**\n * The recipient on the other end of the DM\n * @type {User}\n */\n this.recipient = this.client.users.add(data.recipients[0]);\n }\n\n /**\n * The ID of the last message in the channel, if one was sent\n * @type {?Snowflake}\n */\n this.lastMessageID = data.last_message_id;\n\n /**\n * The timestamp when the last pinned message was pinned, if there was one\n * @type {?number}\n */\n this.lastPinTimestamp = data.last_pin_timestamp ? new Date(data.last_pin_timestamp).getTime() : null;\n }\n\n /**\n * Whether this DMChannel is a partial\n * @type {boolean}\n * @readonly\n */\n get partial() {\n return typeof this.lastMessageID === 'undefined';\n }\n\n /**\n * Fetch this DMChannel.\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<DMChannel>}\n */\n fetch(force = false) {\n return this.recipient.createDM(force);\n }\n\n /**\n * When concatenated with a string, this automatically returns the recipient's mention instead of the\n * DMChannel object.\n * @returns {string}\n * @example\n * // Logs: Hello from <@123456789012345678>!\n * console.log(`Hello from ${channel}!`);\n */\n toString() {\n return this.recipient.toString();\n }\n\n // These are here only for documentation purposes - they are implemented by TextBasedChannel\n /* eslint-disable no-empty-function */\n get lastMessage() {}\n get lastPinAt() {}\n send() {}\n startTyping() {}\n stopTyping() {}\n get typing() {}\n get typingCount() {}\n createMessageCollector() {}\n awaitMessages() {}\n // Doesn't work on DM channels; bulkDelete() {}\n}\n\nTextBasedChannel.applyToClass(DMChannel, true, ['bulkDelete']);\n\nmodule.exports = DMChannel;\n\n\n//# sourceURL=webpack://Discord/./src/structures/DMChannel.js?")},"./src/structures/Emoji.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst Snowflake = __webpack_require__(/*! ../util/Snowflake */ \"./src/util/Snowflake.js\");\n\n/**\n * Represents an emoji, see {@link GuildEmoji} and {@link ReactionEmoji}.\n * @extends {Base}\n */\nclass Emoji extends Base {\n constructor(client, emoji) {\n super(client);\n /**\n * Whether this emoji is animated\n * @type {boolean}\n */\n this.animated = emoji.animated;\n\n /**\n * The name of this emoji\n * @type {string}\n */\n this.name = emoji.name;\n\n /**\n * The ID of this emoji\n * @type {?Snowflake}\n */\n this.id = emoji.id;\n\n /**\n * Whether this emoji has been deleted\n * @type {boolean}\n */\n this.deleted = false;\n }\n\n /**\n * The identifier of this emoji, used for message reactions\n * @type {string}\n * @readonly\n */\n get identifier() {\n if (this.id) return `${this.animated ? 'a:' : ''}${this.name}:${this.id}`;\n return encodeURIComponent(this.name);\n }\n\n /**\n * The URL to the emoji file if its a custom emoji\n * @type {?string}\n * @readonly\n */\n get url() {\n if (!this.id) return null;\n return this.client.rest.cdn.Emoji(this.id, this.animated ? 'gif' : 'png');\n }\n\n /**\n * The timestamp the emoji was created at, or null if unicode\n * @type {?number}\n * @readonly\n */\n get createdTimestamp() {\n if (!this.id) return null;\n return Snowflake.deconstruct(this.id).timestamp;\n }\n\n /**\n * The time the emoji was created at, or null if unicode\n * @type {?Date}\n * @readonly\n */\n get createdAt() {\n if (!this.id) return null;\n return new Date(this.createdTimestamp);\n }\n\n /**\n * When concatenated with a string, this automatically returns the text required to form a graphical emoji on Discord\n * instead of the Emoji object.\n * @returns {string}\n * @example\n * // Send a custom emoji from a guild:\n * const emoji = guild.emojis.cache.first();\n * msg.reply(`Hello! ${emoji}`);\n * @example\n * // Send the emoji used in a reaction to the channel the reaction is part of\n * reaction.message.channel.send(`The emoji used was: ${reaction.emoji}`);\n */\n toString() {\n return this.id ? `<${this.animated ? 'a' : ''}:${this.name}:${this.id}>` : this.name;\n }\n\n toJSON() {\n return super.toJSON({\n guild: 'guildID',\n createdTimestamp: true,\n url: true,\n identifier: true,\n });\n }\n}\n\nmodule.exports = Emoji;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Emoji.js?")},"./src/structures/Guild.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst { deprecate } = __webpack_require__(/*! util */ \"./node_modules/util/util.js\");\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst GuildAuditLogs = __webpack_require__(/*! ./GuildAuditLogs */ \"./src/structures/GuildAuditLogs.js\");\nconst GuildPreview = __webpack_require__(/*! ./GuildPreview */ \"./src/structures/GuildPreview.js\");\nconst Integration = __webpack_require__(/*! ./Integration */ \"./src/structures/Integration.js\");\nconst Invite = __webpack_require__(/*! ./Invite */ \"./src/structures/Invite.js\");\nconst VoiceRegion = __webpack_require__(/*! ./VoiceRegion */ \"./src/structures/VoiceRegion.js\");\nconst Webhook = __webpack_require__(/*! ./Webhook */ \"./src/structures/Webhook.js\");\nconst { Error, TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst GuildChannelManager = __webpack_require__(/*! ../managers/GuildChannelManager */ \"./src/managers/GuildChannelManager.js\");\nconst GuildEmojiManager = __webpack_require__(/*! ../managers/GuildEmojiManager */ \"./src/managers/GuildEmojiManager.js\");\nconst GuildMemberManager = __webpack_require__(/*! ../managers/GuildMemberManager */ \"./src/managers/GuildMemberManager.js\");\nconst PresenceManager = __webpack_require__(/*! ../managers/PresenceManager */ \"./src/managers/PresenceManager.js\");\nconst RoleManager = __webpack_require__(/*! ../managers/RoleManager */ \"./src/managers/RoleManager.js\");\nconst VoiceStateManager = __webpack_require__(/*! ../managers/VoiceStateManager */ \"./src/managers/VoiceStateManager.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst {\n ChannelTypes,\n DefaultMessageNotifications,\n PartialTypes,\n VerificationLevels,\n ExplicitContentFilterLevels,\n} = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst DataResolver = __webpack_require__(/*! ../util/DataResolver */ \"./src/util/DataResolver.js\");\nconst Snowflake = __webpack_require__(/*! ../util/Snowflake */ \"./src/util/Snowflake.js\");\nconst SystemChannelFlags = __webpack_require__(/*! ../util/SystemChannelFlags */ \"./src/util/SystemChannelFlags.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Represents a guild (or a server) on Discord.\n * <info>It's recommended to see if a guild is available before performing operations or reading data from it. You can\n * check this with `guild.available`.</info>\n * @extends {Base}\n */\nclass Guild extends Base {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} data The data for the guild\n */\n constructor(client, data) {\n super(client);\n\n /**\n * A manager of the members belonging to this guild\n * @type {GuildMemberManager}\n */\n this.members = new GuildMemberManager(this);\n\n /**\n * A manager of the channels belonging to this guild\n * @type {GuildChannelManager}\n */\n this.channels = new GuildChannelManager(this);\n\n /**\n * A manager of the roles belonging to this guild\n * @type {RoleManager}\n */\n this.roles = new RoleManager(this);\n\n /**\n * A manager of the presences belonging to this guild\n * @type {PresenceManager}\n */\n this.presences = new PresenceManager(this.client);\n\n /**\n * A manager of the voice states of this guild\n * @type {VoiceStateManager}\n */\n this.voiceStates = new VoiceStateManager(this);\n\n /**\n * Whether the bot has been removed from the guild\n * @type {boolean}\n */\n this.deleted = false;\n\n if (!data) return;\n if (data.unavailable) {\n /**\n * Whether the guild is available to access. If it is not available, it indicates a server outage\n * @type {boolean}\n */\n this.available = false;\n\n /**\n * The Unique ID of the guild, useful for comparisons\n * @type {Snowflake}\n */\n this.id = data.id;\n } else {\n this._patch(data);\n if (!data.channels) this.available = false;\n }\n\n /**\n * The id of the shard this Guild belongs to.\n * @type {number}\n */\n this.shardID = data.shardID;\n }\n\n /**\n * The Shard this Guild belongs to.\n * @type {WebSocketShard}\n * @readonly\n */\n get shard() {\n return this.client.ws.shards.get(this.shardID);\n }\n\n /**\n * Sets up the guild.\n * @param {*} data The raw data of the guild\n * @private\n */\n _patch(data) {\n /**\n * The name of the guild\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The hash of the guild icon\n * @type {?string}\n */\n this.icon = data.icon;\n\n /**\n * The hash of the guild invite splash image\n * @type {?string}\n */\n this.splash = data.splash;\n\n /**\n * The hash of the guild discovery splash image\n * @type {?string}\n */\n this.discoverySplash = data.discovery_splash;\n\n /**\n * The region the guild is located in\n * @type {string}\n */\n this.region = data.region;\n\n /**\n * The full amount of members in this guild\n * @type {number}\n */\n this.memberCount = data.member_count || this.memberCount;\n\n /**\n * Whether the guild is \"large\" (has more than large_threshold members, 50 by default)\n * @type {boolean}\n */\n this.large = Boolean('large' in data ? data.large : this.large);\n\n /**\n * An array of enabled guild features, here are the possible values:\n * * ANIMATED_ICON\n * * BANNER\n * * COMMERCE\n * * COMMUNITY\n * * DISCOVERABLE\n * * FEATURABLE\n * * INVITE_SPLASH\n * * NEWS\n * * PARTNERED\n * * VANITY_URL\n * * VERIFIED\n * * VIP_REGIONS\n * * WELCOME_SCREEN_ENABLED\n * @typedef {string} Features\n */\n\n /**\n * An array of guild features partnered guilds have enabled\n * @type {Features[]}\n */\n this.features = data.features;\n\n /**\n * The ID of the application that created this guild (if applicable)\n * @type {?Snowflake}\n */\n this.applicationID = data.application_id;\n\n /**\n * The time in seconds before a user is counted as \"away from keyboard\"\n * @type {?number}\n */\n this.afkTimeout = data.afk_timeout;\n\n /**\n * The ID of the voice channel where AFK members are moved\n * @type {?Snowflake}\n */\n this.afkChannelID = data.afk_channel_id;\n\n /**\n * The ID of the system channel\n * @type {?Snowflake}\n */\n this.systemChannelID = data.system_channel_id;\n\n /**\n * Whether embedded images are enabled on this guild\n * @type {boolean}\n * @deprecated\n */\n this.embedEnabled = data.embed_enabled;\n\n /**\n * The type of premium tier:\n * * 0: NONE\n * * 1: TIER_1\n * * 2: TIER_2\n * * 3: TIER_3\n * @typedef {number} PremiumTier\n */\n\n /**\n * The premium tier on this guild\n * @type {PremiumTier}\n */\n this.premiumTier = data.premium_tier;\n\n /**\n * The total number of boosts for this server\n * @type {?number}\n * @name Guild#premiumSubscriptionCount\n */\n if (typeof data.premium_subscription_count !== 'undefined') {\n this.premiumSubscriptionCount = data.premium_subscription_count;\n }\n\n /**\n * Whether widget images are enabled on this guild\n * @type {?boolean}\n * @name Guild#widgetEnabled\n */\n if (typeof data.widget_enabled !== 'undefined') this.widgetEnabled = data.widget_enabled;\n\n /**\n * The widget channel ID, if enabled\n * @type {?string}\n * @name Guild#widgetChannelID\n */\n if (typeof data.widget_channel_id !== 'undefined') this.widgetChannelID = data.widget_channel_id;\n\n /**\n * The embed channel ID, if enabled\n * @type {?string}\n * @name Guild#embedChannelID\n * @deprecated\n */\n if (typeof data.embed_channel_id !== 'undefined') this.embedChannelID = data.embed_channel_id;\n\n /**\n * The verification level of the guild\n * @type {VerificationLevel}\n */\n this.verificationLevel = VerificationLevels[data.verification_level];\n\n /**\n * The explicit content filter level of the guild\n * @type {ExplicitContentFilterLevel}\n */\n this.explicitContentFilter = ExplicitContentFilterLevels[data.explicit_content_filter];\n\n /**\n * The required MFA level for the guild\n * @type {number}\n */\n this.mfaLevel = data.mfa_level;\n\n /**\n * The timestamp the client user joined the guild at\n * @type {number}\n */\n this.joinedTimestamp = data.joined_at ? new Date(data.joined_at).getTime() : this.joinedTimestamp;\n\n /**\n * The value set for the guild's default message notifications\n * @type {DefaultMessageNotifications|number}\n */\n this.defaultMessageNotifications =\n DefaultMessageNotifications[data.default_message_notifications] || data.default_message_notifications;\n\n /**\n * The value set for the guild's system channel flags\n * @type {Readonly<SystemChannelFlags>}\n */\n this.systemChannelFlags = new SystemChannelFlags(data.system_channel_flags).freeze();\n\n /**\n * The maximum amount of members the guild can have\n * <info>You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter</info>\n * @type {?number}\n * @name Guild#maximumMembers\n */\n if (typeof data.max_members !== 'undefined') this.maximumMembers = data.max_members || 250000;\n\n /**\n * The maximum amount of presences the guild can have\n * <info>You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter</info>\n * @type {?number}\n * @name Guild#maximumPresences\n */\n if (typeof data.max_presences !== 'undefined') this.maximumPresences = data.max_presences || 25000;\n\n /**\n * The approximate amount of members the guild has\n * <info>You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter</info>\n * @type {?number}\n * @name Guild#approximateMemberCount\n */\n if (typeof data.approximate_member_count !== 'undefined') {\n this.approximateMemberCount = data.approximate_member_count;\n }\n\n /**\n * The approximate amount of presences the guild has\n * <info>You will need to fetch the guild using {@link Guild#fetch} if you want to receive this parameter</info>\n * @type {?number}\n * @name Guild#approximatePresenceCount\n */\n if (typeof data.approximate_presence_count !== 'undefined') {\n this.approximatePresenceCount = data.approximate_presence_count;\n }\n\n /**\n * The vanity invite code of the guild, if any\n * @type {?string}\n */\n this.vanityURLCode = data.vanity_url_code;\n\n /* eslint-disable max-len */\n /**\n * The use count of the vanity URL code of the guild, if any\n * <info>You will need to fetch this parameter using {@link Guild#fetchVanityData} if you want to receive it</info>\n * @type {?number}\n */\n this.vanityURLUses = null;\n /* eslint-enable max-len */\n\n /**\n * The description of the guild, if any\n * @type {?string}\n */\n this.description = data.description;\n\n /**\n * The hash of the guild banner\n * @type {?string}\n */\n this.banner = data.banner;\n\n this.id = data.id;\n this.available = !data.unavailable;\n this.features = data.features || this.features || [];\n\n /**\n * The ID of the rules channel for the guild\n * @type {?Snowflake}\n */\n this.rulesChannelID = data.rules_channel_id;\n\n /**\n * The ID of the community updates channel for the guild\n * @type {?Snowflake}\n */\n this.publicUpdatesChannelID = data.public_updates_channel_id;\n\n /**\n * The preferred locale of the guild, defaults to `en-US`\n * @type {string}\n */\n this.preferredLocale = data.preferred_locale;\n\n if (data.channels) {\n this.channels.cache.clear();\n for (const rawChannel of data.channels) {\n this.client.channels.add(rawChannel, this);\n }\n }\n\n if (data.roles) {\n this.roles.cache.clear();\n for (const role of data.roles) this.roles.add(role);\n }\n\n if (data.members) {\n this.members.cache.clear();\n for (const guildUser of data.members) this.members.add(guildUser);\n }\n\n if (data.owner_id) {\n /**\n * The user ID of this guild's owner\n * @type {Snowflake}\n */\n this.ownerID = data.owner_id;\n }\n\n if (data.presences) {\n for (const presence of data.presences) {\n this.presences.add(Object.assign(presence, { guild: this }));\n }\n }\n\n if (data.voice_states) {\n this.voiceStates.cache.clear();\n for (const voiceState of data.voice_states) {\n this.voiceStates.add(voiceState);\n }\n }\n\n if (!this.emojis) {\n /**\n * A manager of the emojis belonging to this guild\n * @type {GuildEmojiManager}\n */\n this.emojis = new GuildEmojiManager(this);\n if (data.emojis) for (const emoji of data.emojis) this.emojis.add(emoji);\n } else if (data.emojis) {\n this.client.actions.GuildEmojisUpdate.handle({\n guild_id: this.id,\n emojis: data.emojis,\n });\n }\n }\n\n /**\n * The URL to this guild's banner.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n bannerURL({ format, size } = {}) {\n if (!this.banner) return null;\n return this.client.rest.cdn.Banner(this.id, this.banner, format, size);\n }\n\n /**\n * The timestamp the guild was created at\n * @type {number}\n * @readonly\n */\n get createdTimestamp() {\n return Snowflake.deconstruct(this.id).timestamp;\n }\n\n /**\n * The time the guild was created at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n /**\n * The time the client user joined the guild\n * @type {Date}\n * @readonly\n */\n get joinedAt() {\n return new Date(this.joinedTimestamp);\n }\n\n /**\n * If this guild is partnered\n * @type {boolean}\n * @readonly\n */\n get partnered() {\n return this.features.includes('PARTNERED');\n }\n\n /**\n * If this guild is verified\n * @type {boolean}\n * @readonly\n */\n get verified() {\n return this.features.includes('VERIFIED');\n }\n\n /**\n * The URL to this guild's icon.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n iconURL({ format, size, dynamic } = {}) {\n if (!this.icon) return null;\n return this.client.rest.cdn.Icon(this.id, this.icon, format, size, dynamic);\n }\n\n /**\n * The acronym that shows up in place of a guild icon.\n * @type {string}\n * @readonly\n */\n get nameAcronym() {\n return this.name\n .replace(/'s /g, ' ')\n .replace(/\\w+/g, e => e[0])\n .replace(/\\s/g, '');\n }\n\n /**\n * The URL to this guild's invite splash image.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n splashURL({ format, size } = {}) {\n if (!this.splash) return null;\n return this.client.rest.cdn.Splash(this.id, this.splash, format, size);\n }\n\n /**\n * The URL to this guild's discovery splash image.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n discoverySplashURL({ format, size } = {}) {\n if (!this.discoverySplash) return null;\n return this.client.rest.cdn.DiscoverySplash(this.id, this.discoverySplash, format, size);\n }\n\n /**\n * The owner of the guild\n * @type {?GuildMember}\n * @readonly\n */\n get owner() {\n return (\n this.members.cache.get(this.ownerID) ||\n (this.client.options.partials.includes(PartialTypes.GUILD_MEMBER)\n ? this.members.add({ user: { id: this.ownerID } }, true)\n : null)\n );\n }\n\n /**\n * AFK voice channel for this guild\n * @type {?VoiceChannel}\n * @readonly\n */\n get afkChannel() {\n return this.client.channels.cache.get(this.afkChannelID) || null;\n }\n\n /**\n * System channel for this guild\n * @type {?TextChannel}\n * @readonly\n */\n get systemChannel() {\n return this.client.channels.cache.get(this.systemChannelID) || null;\n }\n\n /**\n * Widget channel for this guild\n * @type {?TextChannel}\n * @readonly\n */\n get widgetChannel() {\n return this.client.channels.cache.get(this.widgetChannelID) || null;\n }\n\n /**\n * Embed channel for this guild\n * @type {?TextChannel}\n * @readonly\n * @deprecated\n */\n get embedChannel() {\n return this.client.channels.cache.get(this.embedChannelID) || null;\n }\n\n /**\n * Rules channel for this guild\n * @type {?TextChannel}\n * @readonly\n */\n get rulesChannel() {\n return this.client.channels.cache.get(this.rulesChannelID) || null;\n }\n\n /**\n * Public updates channel for this guild\n * @type {?TextChannel}\n * @readonly\n */\n get publicUpdatesChannel() {\n return this.client.channels.cache.get(this.publicUpdatesChannelID) || null;\n }\n\n /**\n * The client user as a GuildMember of this guild\n * @type {?GuildMember}\n * @readonly\n */\n get me() {\n return (\n this.members.cache.get(this.client.user.id) ||\n (this.client.options.partials.includes(PartialTypes.GUILD_MEMBER)\n ? this.members.add({ user: { id: this.client.user.id } }, true)\n : null)\n );\n }\n\n /**\n * The voice state for the client user of this guild, if any\n * @type {?VoiceState}\n * @readonly\n */\n get voice() {\n return this.voiceStates.cache.get(this.client.user.id);\n }\n\n /**\n * Returns the GuildMember form of a User object, if the user is present in the guild.\n * @param {UserResolvable} user The user that you want to obtain the GuildMember of\n * @returns {?GuildMember}\n * @example\n * // Get the guild member of a user\n * const member = guild.member(message.author);\n */\n member(user) {\n return this.members.resolve(user);\n }\n\n /**\n * Fetches this guild.\n * @returns {Promise<Guild>}\n */\n fetch() {\n return this.client.api\n .guilds(this.id)\n .get({ query: { with_counts: true } })\n .then(data => {\n this._patch(data);\n return this;\n });\n }\n\n /**\n * An object containing information about a guild member's ban.\n * @typedef {Object} BanInfo\n * @property {User} user User that was banned\n * @property {?string} reason Reason the user was banned\n */\n\n /**\n * Fetches information on a banned user from this guild.\n * @param {UserResolvable} user The User to fetch the ban info of\n * @returns {Promise<BanInfo>}\n */\n fetchBan(user) {\n const id = this.client.users.resolveID(user);\n if (!id) throw new Error('FETCH_BAN_RESOLVE_ID');\n return this.client.api\n .guilds(this.id)\n .bans(id)\n .get()\n .then(ban => ({\n reason: ban.reason,\n user: this.client.users.add(ban.user),\n }));\n }\n\n /**\n * Fetches a collection of banned users in this guild.\n * @returns {Promise<Collection<Snowflake, BanInfo>>}\n */\n fetchBans() {\n return this.client.api\n .guilds(this.id)\n .bans.get()\n .then(bans =>\n bans.reduce((collection, ban) => {\n collection.set(ban.user.id, {\n reason: ban.reason,\n user: this.client.users.add(ban.user),\n });\n return collection;\n }, new Collection()),\n );\n }\n\n /**\n * Fetches a collection of integrations to this guild.\n * Resolves with a collection mapping integrations by their ids.\n * @returns {Promise<Collection<string, Integration>>}\n * @example\n * // Fetch integrations\n * guild.fetchIntegrations()\n * .then(integrations => console.log(`Fetched ${integrations.size} integrations`))\n * .catch(console.error);\n */\n fetchIntegrations() {\n return this.client.api\n .guilds(this.id)\n .integrations.get()\n .then(data =>\n data.reduce(\n (collection, integration) => collection.set(integration.id, new Integration(this.client, integration, this)),\n new Collection(),\n ),\n );\n }\n\n /**\n * The data for creating an integration.\n * @typedef {Object} IntegrationData\n * @property {string} id The integration id\n * @property {string} type The integration type\n */\n\n /**\n * Creates an integration by attaching an integration object\n * @param {IntegrationData} data The data for the integration\n * @param {string} reason Reason for creating the integration\n * @returns {Promise<Guild>}\n */\n createIntegration(data, reason) {\n return this.client.api\n .guilds(this.id)\n .integrations.post({ data, reason })\n .then(() => this);\n }\n\n /**\n * Fetches a collection of invites to this guild.\n * Resolves with a collection mapping invites by their codes.\n * @returns {Promise<Collection<string, Invite>>}\n * @example\n * // Fetch invites\n * guild.fetchInvites()\n * .then(invites => console.log(`Fetched ${invites.size} invites`))\n * .catch(console.error);\n * @example\n * // Fetch invite creator by their id\n * guild.fetchInvites()\n * .then(invites => console.log(invites.find(invite => invite.inviter.id === '84484653687267328')))\n * .catch(console.error);\n */\n fetchInvites() {\n return this.client.api\n .guilds(this.id)\n .invites.get()\n .then(inviteItems => {\n const invites = new Collection();\n for (const inviteItem of inviteItems) {\n const invite = new Invite(this.client, inviteItem);\n invites.set(invite.code, invite);\n }\n return invites;\n });\n }\n\n /**\n * Obtains a guild preview for this guild from Discord.\n * @returns {Promise<GuildPreview>}\n */\n fetchPreview() {\n return this.client.api\n .guilds(this.id)\n .preview.get()\n .then(data => new GuildPreview(this.client, data));\n }\n\n /**\n * Fetches the vanity url invite code to this guild.\n * Resolves with a string matching the vanity url invite code, not the full url.\n * @returns {Promise<string>}\n * @deprecated\n * @example\n * // Fetch invites\n * guild.fetchVanityCode()\n * .then(code => {\n * console.log(`Vanity URL: https://discord.gg/${code}`);\n * })\n * .catch(console.error);\n */\n fetchVanityCode() {\n return this.fetchVanityData().then(vanity => vanity.code);\n }\n\n /**\n * An object containing information about a guild's vanity invite.\n * @typedef {Object} Vanity\n * @property {?string} code Vanity invite code\n * @property {?number} uses How many times this invite has been used\n */\n\n /**\n * Fetches the vanity url invite object to this guild.\n * Resolves with an object containing the vanity url invite code and the use count\n * @returns {Promise<Vanity>}\n * @example\n * // Fetch invite data\n * guild.fetchVanityData()\n * .then(res => {\n * console.log(`Vanity URL: https://discord.gg/${res.code} with ${res.uses} uses`);\n * })\n * .catch(console.error);\n */\n async fetchVanityData() {\n if (!this.features.includes('VANITY_URL')) {\n throw new Error('VANITY_URL');\n }\n const data = await this.client.api.guilds(this.id, 'vanity-url').get();\n this.vanityURLUses = data.uses;\n\n return data;\n }\n\n /**\n * Fetches all webhooks for the guild.\n * @returns {Promise<Collection<Snowflake, Webhook>>}\n * @example\n * // Fetch webhooks\n * guild.fetchWebhooks()\n * .then(webhooks => console.log(`Fetched ${webhooks.size} webhooks`))\n * .catch(console.error);\n */\n fetchWebhooks() {\n return this.client.api\n .guilds(this.id)\n .webhooks.get()\n .then(data => {\n const hooks = new Collection();\n for (const hook of data) hooks.set(hook.id, new Webhook(this.client, hook));\n return hooks;\n });\n }\n\n /**\n * Fetches available voice regions.\n * @returns {Promise<Collection<string, VoiceRegion>>}\n */\n fetchVoiceRegions() {\n return this.client.api\n .guilds(this.id)\n .regions.get()\n .then(res => {\n const regions = new Collection();\n for (const region of res) regions.set(region.id, new VoiceRegion(region));\n return regions;\n });\n }\n\n /**\n * Data for the Guild Widget object\n * @typedef {Object} GuildWidget\n * @property {boolean} enabled Whether the widget is enabled\n * @property {?GuildChannel} channel The widget channel\n */\n\n /**\n * The Guild Widget object\n * @typedef {Object} GuildWidgetData\n * @property {boolean} enabled Whether the widget is enabled\n * @property {?GuildChannelResolvable} channel The widget channel\n */\n\n /**\n * Fetches the guild embed.\n * @returns {Promise<GuildWidget>}\n * @deprecated\n * @example\n * // Fetches the guild embed\n * guild.fetchEmbed()\n * .then(embed => console.log(`The embed is ${embed.enabled ? 'enabled' : 'disabled'}`))\n * .catch(console.error);\n */\n fetchEmbed() {\n return this.client.api\n .guilds(this.id)\n .embed.get()\n .then(data => ({\n enabled: data.enabled,\n channel: data.channel_id ? this.channels.cache.get(data.channel_id) : null,\n }));\n }\n\n /**\n * Fetches the guild widget.\n * @returns {Promise<GuildWidget>}\n * @example\n * // Fetches the guild widget\n * guild.fetchWidget()\n * .then(widget => console.log(`The widget is ${widget.enabled ? 'enabled' : 'disabled'}`))\n * .catch(console.error);\n */\n fetchWidget() {\n return this.client.api\n .guilds(this.id)\n .widget.get()\n .then(data => ({\n enabled: data.enabled,\n channel: data.channel_id ? this.channels.cache.get(data.channel_id) : null,\n }));\n }\n\n /**\n * Fetches audit logs for this guild.\n * @param {Object} [options={}] Options for fetching audit logs\n * @param {Snowflake|GuildAuditLogsEntry} [options.before] Limit to entries from before specified entry\n * @param {number} [options.limit] Limit number of entries\n * @param {UserResolvable} [options.user] Only show entries involving this user\n * @param {AuditLogAction|number} [options.type] Only show entries involving this action type\n * @returns {Promise<GuildAuditLogs>}\n * @example\n * // Output audit log entries\n * guild.fetchAuditLogs()\n * .then(audit => console.log(audit.entries.first()))\n * .catch(console.error);\n */\n fetchAuditLogs(options = {}) {\n if (options.before && options.before instanceof GuildAuditLogs.Entry) options.before = options.before.id;\n if (typeof options.type === 'string') options.type = GuildAuditLogs.Actions[options.type];\n\n return this.client.api\n .guilds(this.id)\n ['audit-logs'].get({\n query: {\n before: options.before,\n limit: options.limit,\n user_id: this.client.users.resolveID(options.user),\n action_type: options.type,\n },\n })\n .then(data => GuildAuditLogs.build(this, data));\n }\n\n /**\n * Adds a user to the guild using OAuth2. Requires the `CREATE_INSTANT_INVITE` permission.\n * @param {UserResolvable} user User to add to the guild\n * @param {Object} options Options for the addition\n * @param {string} options.accessToken An OAuth2 access token for the user with the `guilds.join` scope granted to the\n * bot's application\n * @param {string} [options.nick] Nickname to give the member (requires `MANAGE_NICKNAMES`)\n * @param {Collection<Snowflake, Role>|RoleResolvable[]} [options.roles] Roles to add to the member\n * (requires `MANAGE_ROLES`)\n * @param {boolean} [options.mute] Whether the member should be muted (requires `MUTE_MEMBERS`)\n * @param {boolean} [options.deaf] Whether the member should be deafened (requires `DEAFEN_MEMBERS`)\n * @returns {Promise<GuildMember>}\n */\n addMember(user, options) {\n user = this.client.users.resolveID(user);\n if (!user) return Promise.reject(new TypeError('INVALID_TYPE', 'user', 'UserResolvable'));\n if (this.members.cache.has(user)) return Promise.resolve(this.members.cache.get(user));\n options.access_token = options.accessToken;\n if (options.roles) {\n const roles = [];\n for (let role of options.roles instanceof Collection ? options.roles.values() : options.roles) {\n role = this.roles.resolve(role);\n if (!role) {\n return Promise.reject(\n new TypeError('INVALID_TYPE', 'options.roles', 'Array or Collection of Roles or Snowflakes', true),\n );\n }\n roles.push(role.id);\n }\n options.roles = roles;\n }\n return this.client.api\n .guilds(this.id)\n .members(user)\n .put({ data: options })\n .then(data => this.members.add(data));\n }\n\n /**\n * The data for editing a guild.\n * @typedef {Object} GuildEditData\n * @property {string} [name] The name of the guild\n * @property {string} [region] The region of the guild\n * @property {VerificationLevel|number} [verificationLevel] The verification level of the guild\n * @property {ExplicitContentFilterLevel|number} [explicitContentFilter] The level of the explicit content filter\n * @property {ChannelResolvable} [afkChannel] The AFK channel of the guild\n * @property {ChannelResolvable} [systemChannel] The system channel of the guild\n * @property {number} [afkTimeout] The AFK timeout of the guild\n * @property {Base64Resolvable} [icon] The icon of the guild\n * @property {GuildMemberResolvable} [owner] The owner of the guild\n * @property {Base64Resolvable} [splash] The invite splash image of the guild\n * @property {Base64Resolvable} [discoverySplash] The discovery splash image of the guild\n * @property {Base64Resolvable} [banner] The banner of the guild\n * @property {DefaultMessageNotifications|number} [defaultMessageNotifications] The default message notifications\n * @property {SystemChannelFlagsResolvable} [systemChannelFlags] The system channel flags of the guild\n * @property {ChannelResolvable} [rulesChannel] The rules channel of the guild\n * @property {ChannelResolvable} [publicUpdatesChannel] The community updates channel of the guild\n * @property {string} [preferredLocale] The preferred locale of the guild\n */\n\n /**\n * Updates the guild with new information - e.g. a new name.\n * @param {GuildEditData} data The data to update the guild with\n * @param {string} [reason] Reason for editing this guild\n * @returns {Promise<Guild>}\n * @example\n * // Set the guild name and region\n * guild.edit({\n * name: 'Discord Guild',\n * region: 'london',\n * })\n * .then(updated => console.log(`New guild name ${updated} in region ${updated.region}`))\n * .catch(console.error);\n */\n edit(data, reason) {\n const _data = {};\n if (data.name) _data.name = data.name;\n if (data.region) _data.region = data.region;\n if (typeof data.verificationLevel !== 'undefined') {\n _data.verification_level =\n typeof data.verificationLevel === 'number'\n ? Number(data.verificationLevel)\n : VerificationLevels.indexOf(data.verificationLevel);\n }\n if (typeof data.afkChannel !== 'undefined') {\n _data.afk_channel_id = this.client.channels.resolveID(data.afkChannel);\n }\n if (typeof data.systemChannel !== 'undefined') {\n _data.system_channel_id = this.client.channels.resolveID(data.systemChannel);\n }\n if (data.afkTimeout) _data.afk_timeout = Number(data.afkTimeout);\n if (typeof data.icon !== 'undefined') _data.icon = data.icon;\n if (data.owner) _data.owner_id = this.client.users.resolveID(data.owner);\n if (data.splash) _data.splash = data.splash;\n if (data.discoverySplash) _data.discovery_splash = data.discoverySplash;\n if (data.banner) _data.banner = data.banner;\n if (typeof data.explicitContentFilter !== 'undefined') {\n _data.explicit_content_filter =\n typeof data.explicitContentFilter === 'number'\n ? data.explicitContentFilter\n : ExplicitContentFilterLevels.indexOf(data.explicitContentFilter);\n }\n if (typeof data.defaultMessageNotifications !== 'undefined') {\n _data.default_message_notifications =\n typeof data.defaultMessageNotifications === 'string'\n ? DefaultMessageNotifications.indexOf(data.defaultMessageNotifications)\n : data.defaultMessageNotifications;\n }\n if (typeof data.systemChannelFlags !== 'undefined') {\n _data.system_channel_flags = SystemChannelFlags.resolve(data.systemChannelFlags);\n }\n if (typeof data.rulesChannel !== 'undefined') {\n _data.rules_channel_id = this.client.channels.resolveID(data.rulesChannel);\n }\n if (typeof data.publicUpdatesChannel !== 'undefined') {\n _data.public_updates_channel_id = this.client.channels.resolveID(data.publicUpdatesChannel);\n }\n if (data.preferredLocale) _data.preferred_locale = data.preferredLocale;\n return this.client.api\n .guilds(this.id)\n .patch({ data: _data, reason })\n .then(newData => this.client.actions.GuildUpdate.handle(newData).updated);\n }\n\n /**\n * Edits the level of the explicit content filter.\n * @param {ExplicitContentFilterLevel|number} explicitContentFilter The new level of the explicit content filter\n * @param {string} [reason] Reason for changing the level of the guild's explicit content filter\n * @returns {Promise<Guild>}\n */\n setExplicitContentFilter(explicitContentFilter, reason) {\n return this.edit({ explicitContentFilter }, reason);\n }\n\n /* eslint-disable max-len */\n /**\n * Edits the setting of the default message notifications of the guild.\n * @param {DefaultMessageNotifications|number} defaultMessageNotifications The new setting for the default message notifications\n * @param {string} [reason] Reason for changing the setting of the default message notifications\n * @returns {Promise<Guild>}\n */\n setDefaultMessageNotifications(defaultMessageNotifications, reason) {\n return this.edit({ defaultMessageNotifications }, reason);\n }\n /* eslint-enable max-len */\n\n /**\n * Edits the flags of the default message notifications of the guild.\n * @param {SystemChannelFlagsResolvable} systemChannelFlags The new flags for the default message notifications\n * @param {string} [reason] Reason for changing the flags of the default message notifications\n * @returns {Promise<Guild>}\n */\n setSystemChannelFlags(systemChannelFlags, reason) {\n return this.edit({ systemChannelFlags }, reason);\n }\n\n /**\n * Edits the name of the guild.\n * @param {string} name The new name of the guild\n * @param {string} [reason] Reason for changing the guild's name\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild name\n * guild.setName('Discord Guild')\n * .then(updated => console.log(`Updated guild name to ${guild}`))\n * .catch(console.error);\n */\n setName(name, reason) {\n return this.edit({ name }, reason);\n }\n\n /**\n * Edits the region of the guild.\n * @param {string} region The new region of the guild\n * @param {string} [reason] Reason for changing the guild's region\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild region\n * guild.setRegion('london')\n * .then(updated => console.log(`Updated guild region to ${updated.region}`))\n * .catch(console.error);\n */\n setRegion(region, reason) {\n return this.edit({ region }, reason);\n }\n\n /**\n * Edits the verification level of the guild.\n * @param {VerificationLevel|number} verificationLevel The new verification level of the guild\n * @param {string} [reason] Reason for changing the guild's verification level\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild verification level\n * guild.setVerificationLevel(1)\n * .then(updated => console.log(`Updated guild verification level to ${guild.verificationLevel}`))\n * .catch(console.error);\n */\n setVerificationLevel(verificationLevel, reason) {\n return this.edit({ verificationLevel }, reason);\n }\n\n /**\n * Edits the AFK channel of the guild.\n * @param {ChannelResolvable} afkChannel The new AFK channel\n * @param {string} [reason] Reason for changing the guild's AFK channel\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild AFK channel\n * guild.setAFKChannel(channel)\n * .then(updated => console.log(`Updated guild AFK channel to ${guild.afkChannel.name}`))\n * .catch(console.error);\n */\n setAFKChannel(afkChannel, reason) {\n return this.edit({ afkChannel }, reason);\n }\n\n /**\n * Edits the system channel of the guild.\n * @param {ChannelResolvable} systemChannel The new system channel\n * @param {string} [reason] Reason for changing the guild's system channel\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild system channel\n * guild.setSystemChannel(channel)\n * .then(updated => console.log(`Updated guild system channel to ${guild.systemChannel.name}`))\n * .catch(console.error);\n */\n setSystemChannel(systemChannel, reason) {\n return this.edit({ systemChannel }, reason);\n }\n\n /**\n * Edits the AFK timeout of the guild.\n * @param {number} afkTimeout The time in seconds that a user must be idle to be considered AFK\n * @param {string} [reason] Reason for changing the guild's AFK timeout\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild AFK channel\n * guild.setAFKTimeout(60)\n * .then(updated => console.log(`Updated guild AFK timeout to ${guild.afkTimeout}`))\n * .catch(console.error);\n */\n setAFKTimeout(afkTimeout, reason) {\n return this.edit({ afkTimeout }, reason);\n }\n\n /**\n * Sets a new guild icon.\n * @param {Base64Resolvable|BufferResolvable} icon The new icon of the guild\n * @param {string} [reason] Reason for changing the guild's icon\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild icon\n * guild.setIcon('./icon.png')\n * .then(updated => console.log('Updated the guild icon'))\n * .catch(console.error);\n */\n async setIcon(icon, reason) {\n return this.edit({ icon: await DataResolver.resolveImage(icon), reason });\n }\n\n /**\n * Sets a new owner of the guild.\n * @param {GuildMemberResolvable} owner The new owner of the guild\n * @param {string} [reason] Reason for setting the new owner\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild owner\n * guild.setOwner(guild.members.cache.first())\n * .then(updated => console.log(`Updated the guild owner to ${updated.owner.displayName}`))\n * .catch(console.error);\n */\n setOwner(owner, reason) {\n return this.edit({ owner }, reason);\n }\n\n /**\n * Sets a new guild invite splash image.\n * @param {Base64Resolvable|BufferResolvable} splash The new invite splash image of the guild\n * @param {string} [reason] Reason for changing the guild's invite splash image\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild splash\n * guild.setSplash('./splash.png')\n * .then(updated => console.log('Updated the guild splash'))\n * .catch(console.error);\n */\n async setSplash(splash, reason) {\n return this.edit({ splash: await DataResolver.resolveImage(splash), reason });\n }\n\n /**\n * Sets a new guild discovery splash image.\n * @param {Base64Resolvable|BufferResolvable} discoverySplash The new discovery splash image of the guild\n * @param {string} [reason] Reason for changing the guild's discovery splash image\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild discovery splash\n * guild.setDiscoverySplash('./discoverysplash.png')\n * .then(updated => console.log('Updated the guild discovery splash'))\n * .catch(console.error);\n */\n async setDiscoverySplash(discoverySplash, reason) {\n return this.edit({ discoverySplash: await DataResolver.resolveImage(discoverySplash), reason });\n }\n\n /**\n * Sets a new guild banner.\n * @param {Base64Resolvable|BufferResolvable} banner The new banner of the guild\n * @param {string} [reason] Reason for changing the guild's banner\n * @returns {Promise<Guild>}\n * @example\n * guild.setBanner('./banner.png')\n * .then(updated => console.log('Updated the guild banner'))\n * .catch(console.error);\n */\n async setBanner(banner, reason) {\n return this.edit({ banner: await DataResolver.resolveImage(banner), reason });\n }\n\n /**\n * Edits the rules channel of the guild.\n * @param {ChannelResolvable} rulesChannel The new rules channel\n * @param {string} [reason] Reason for changing the guild's rules channel\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild rules channel\n * guild.setRulesChannel(channel)\n * .then(updated => console.log(`Updated guild rules channel to ${guild.rulesChannel.name}`))\n * .catch(console.error);\n */\n setRulesChannel(rulesChannel, reason) {\n return this.edit({ rulesChannel }, reason);\n }\n\n /**\n * Edits the community updates channel of the guild.\n * @param {ChannelResolvable} publicUpdatesChannel The new community updates channel\n * @param {string} [reason] Reason for changing the guild's community updates channel\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild community updates channel\n * guild.setPublicUpdatesChannel(channel)\n * .then(updated => console.log(`Updated guild community updates channel to ${guild.publicUpdatesChannel.name}`))\n * .catch(console.error);\n */\n setPublicUpdatesChannel(publicUpdatesChannel, reason) {\n return this.edit({ publicUpdatesChannel }, reason);\n }\n\n /**\n * Edits the preferred locale of the guild.\n * @param {string} preferredLocale The new preferred locale of the guild\n * @param {string} [reason] Reason for changing the guild's preferred locale\n * @returns {Promise<Guild>}\n * @example\n * // Edit the guild preferred locale\n * guild.setPreferredLocale('en-US')\n * .then(updated => console.log(`Updated guild preferred locale to ${guild.preferredLocale}`))\n * .catch(console.error);\n */\n setPreferredLocale(preferredLocale, reason) {\n return this.edit({ preferredLocale }, reason);\n }\n\n /**\n * The data needed for updating a channel's position.\n * @typedef {Object} ChannelPosition\n * @property {ChannelResolvable} channel Channel to update\n * @property {number} position New position for the channel\n */\n\n /**\n * Batch-updates the guild's channels' positions.\n * @param {ChannelPosition[]} channelPositions Channel positions to update\n * @returns {Promise<Guild>}\n * @example\n * guild.setChannelPositions([{ channel: channelID, position: newChannelIndex }])\n * .then(guild => console.log(`Updated channel positions for ${guild}`))\n * .catch(console.error);\n */\n setChannelPositions(channelPositions) {\n const updatedChannels = channelPositions.map(r => ({\n id: this.client.channels.resolveID(r.channel),\n position: r.position,\n }));\n\n return this.client.api\n .guilds(this.id)\n .channels.patch({ data: updatedChannels })\n .then(\n () =>\n this.client.actions.GuildChannelsPositionUpdate.handle({\n guild_id: this.id,\n channels: updatedChannels,\n }).guild,\n );\n }\n\n /**\n * The data needed for updating a guild role's position\n * @typedef {Object} GuildRolePosition\n * @property {RoleResolveable} role The ID of the role\n * @property {number} position The position to update\n */\n\n /**\n * Batch-updates the guild's role positions\n * @param {GuildRolePosition[]} rolePositions Role positions to update\n * @returns {Promise<Guild>}\n * @example\n * guild.setRolePositions([{ role: roleID, position: updatedRoleIndex }])\n * .then(guild => console.log(`Role permissions updated for ${guild}`))\n * .catch(console.error);\n */\n setRolePositions(rolePositions) {\n // Make sure rolePositions are prepared for API\n rolePositions = rolePositions.map(o => ({\n id: this.roles.resolveID(o.role),\n position: o.position,\n }));\n\n // Call the API to update role positions\n return this.client.api\n .guilds(this.id)\n .roles.patch({\n data: rolePositions,\n })\n .then(\n () =>\n this.client.actions.GuildRolesPositionUpdate.handle({\n guild_id: this.id,\n roles: rolePositions,\n }).guild,\n );\n }\n\n /**\n * Edits the guild's embed.\n * @param {GuildWidgetData} embed The embed for the guild\n * @param {string} [reason] Reason for changing the guild's embed\n * @returns {Promise<Guild>}\n * @deprecated\n */\n setEmbed(embed, reason) {\n return this.client.api\n .guilds(this.id)\n .embed.patch({\n data: {\n enabled: embed.enabled,\n channel_id: this.channels.resolveID(embed.channel),\n },\n reason,\n })\n .then(() => this);\n }\n\n /**\n * Edits the guild's widget.\n * @param {GuildWidgetData} widget The widget for the guild\n * @param {string} [reason] Reason for changing the guild's widget\n * @returns {Promise<Guild>}\n */\n setWidget(widget, reason) {\n return this.client.api\n .guilds(this.id)\n .widget.patch({\n data: {\n enabled: widget.enabled,\n channel_id: this.channels.resolveID(widget.channel),\n },\n reason,\n })\n .then(() => this);\n }\n\n /**\n * Leaves the guild.\n * @returns {Promise<Guild>}\n * @example\n * // Leave a guild\n * guild.leave()\n * .then(g => console.log(`Left the guild ${g}`))\n * .catch(console.error);\n */\n leave() {\n if (this.ownerID === this.client.user.id) return Promise.reject(new Error('GUILD_OWNED'));\n return this.client.api\n .users('@me')\n .guilds(this.id)\n .delete()\n .then(() => this.client.actions.GuildDelete.handle({ id: this.id }).guild);\n }\n\n /**\n * Deletes the guild.\n * @returns {Promise<Guild>}\n * @example\n * // Delete a guild\n * guild.delete()\n * .then(g => console.log(`Deleted the guild ${g}`))\n * .catch(console.error);\n */\n delete() {\n return this.client.api\n .guilds(this.id)\n .delete()\n .then(() => this.client.actions.GuildDelete.handle({ id: this.id }).guild);\n }\n\n /**\n * Whether this guild equals another guild. It compares all properties, so for most operations\n * it is advisable to just compare `guild.id === guild2.id` as it is much faster and is often\n * what most users need.\n * @param {Guild} guild The guild to compare with\n * @returns {boolean}\n */\n equals(guild) {\n let equal =\n guild &&\n guild instanceof this.constructor &&\n this.id === guild.id &&\n this.available === guild.available &&\n this.splash === guild.splash &&\n this.discoverySplash === guild.discoverySplash &&\n this.region === guild.region &&\n this.name === guild.name &&\n this.memberCount === guild.memberCount &&\n this.large === guild.large &&\n this.icon === guild.icon &&\n this.ownerID === guild.ownerID &&\n this.verificationLevel === guild.verificationLevel &&\n this.embedEnabled === guild.embedEnabled &&\n (this.features === guild.features ||\n (this.features.length === guild.features.length &&\n this.features.every((feat, i) => feat === guild.features[i])));\n\n if (equal) {\n if (this.embedChannel) {\n if (!guild.embedChannel || this.embedChannel.id !== guild.embedChannel.id) equal = false;\n } else if (guild.embedChannel) {\n equal = false;\n }\n }\n\n return equal;\n }\n\n /**\n * When concatenated with a string, this automatically returns the guild's name instead of the Guild object.\n * @returns {string}\n * @example\n * // Logs: Hello from My Guild!\n * console.log(`Hello from ${guild}!`);\n */\n toString() {\n return this.name;\n }\n\n toJSON() {\n const json = super.toJSON({\n available: false,\n createdTimestamp: true,\n nameAcronym: true,\n presences: false,\n voiceStates: false,\n });\n json.iconURL = this.iconURL();\n json.splashURL = this.splashURL();\n json.discoverySplashURL = this.discoverySplashURL();\n json.bannerURL = this.bannerURL();\n return json;\n }\n\n /**\n * Creates a collection of this guild's roles, sorted by their position and IDs.\n * @returns {Collection<Role>}\n * @private\n */\n _sortedRoles() {\n return Util.discordSort(this.roles.cache);\n }\n\n /**\n * Creates a collection of this guild's or a specific category's channels, sorted by their position and IDs.\n * @param {GuildChannel} [channel] Category to get the channels of\n * @returns {Collection<GuildChannel>}\n * @private\n */\n _sortedChannels(channel) {\n const category = channel.type === ChannelTypes.CATEGORY;\n return Util.discordSort(\n this.channels.cache.filter(\n c =>\n (['text', 'news', 'store'].includes(channel.type)\n ? ['text', 'news', 'store'].includes(c.type)\n : c.type === channel.type) &&\n (category || c.parent === channel.parent),\n ),\n );\n }\n}\n\nGuild.prototype.setEmbed = deprecate(Guild.prototype.setEmbed, 'Guild#setEmbed: Use setWidget instead');\n\nGuild.prototype.fetchEmbed = deprecate(Guild.prototype.fetchEmbed, 'Guild#fetchEmbed: Use fetchWidget instead');\n\nGuild.prototype.fetchVanityCode = deprecate(\n Guild.prototype.fetchVanityCode,\n 'Guild#fetchVanityCode: Use fetchVanityData() instead',\n);\n\nmodule.exports = Guild;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Guild.js?")},"./src/structures/GuildAuditLogs.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Integration = __webpack_require__(/*! ./Integration */ \"./src/structures/Integration.js\");\nconst Webhook = __webpack_require__(/*! ./Webhook */ \"./src/structures/Webhook.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst { PartialTypes } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Snowflake = __webpack_require__(/*! ../util/Snowflake */ \"./src/util/Snowflake.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * The target type of an entry, e.g. `GUILD`. Here are the available types:\n * * GUILD\n * * CHANNEL\n * * USER\n * * ROLE\n * * INVITE\n * * WEBHOOK\n * * EMOJI\n * * MESSAGE\n * * INTEGRATION\n * @typedef {string} AuditLogTargetType\n */\n\n/**\n * Key mirror of all available audit log targets.\n * @name GuildAuditLogs.Targets\n * @type {AuditLogTargetType}\n */\nconst Targets = {\n ALL: 'ALL',\n GUILD: 'GUILD',\n CHANNEL: 'CHANNEL',\n USER: 'USER',\n ROLE: 'ROLE',\n INVITE: 'INVITE',\n WEBHOOK: 'WEBHOOK',\n EMOJI: 'EMOJI',\n MESSAGE: 'MESSAGE',\n INTEGRATION: 'INTEGRATION',\n UNKNOWN: 'UNKNOWN',\n};\n\n/**\n * The action of an entry. Here are the available actions:\n * * ALL: null\n * * GUILD_UPDATE: 1\n * * CHANNEL_CREATE: 10\n * * CHANNEL_UPDATE: 11\n * * CHANNEL_DELETE: 12\n * * CHANNEL_OVERWRITE_CREATE: 13\n * * CHANNEL_OVERWRITE_UPDATE: 14\n * * CHANNEL_OVERWRITE_DELETE: 15\n * * MEMBER_KICK: 20\n * * MEMBER_PRUNE: 21\n * * MEMBER_BAN_ADD: 22\n * * MEMBER_BAN_REMOVE: 23\n * * MEMBER_UPDATE: 24\n * * MEMBER_ROLE_UPDATE: 25\n * * MEMBER_MOVE: 26\n * * MEMBER_DISCONNECT: 27\n * * BOT_ADD: 28,\n * * ROLE_CREATE: 30\n * * ROLE_UPDATE: 31\n * * ROLE_DELETE: 32\n * * INVITE_CREATE: 40\n * * INVITE_UPDATE: 41\n * * INVITE_DELETE: 42\n * * WEBHOOK_CREATE: 50\n * * WEBHOOK_UPDATE: 51\n * * WEBHOOK_DELETE: 52\n * * EMOJI_CREATE: 60\n * * EMOJI_UPDATE: 61\n * * EMOJI_DELETE: 62\n * * MESSAGE_DELETE: 72\n * * MESSAGE_BULK_DELETE: 73\n * * MESSAGE_PIN: 74\n * * MESSAGE_UNPIN: 75\n * * INTEGRATION_CREATE: 80\n * * INTEGRATION_UPDATE: 81\n * * INTEGRATION_DELETE: 82\n * @typedef {?number|string} AuditLogAction\n */\n\n/**\n * All available actions keyed under their names to their numeric values.\n * @name GuildAuditLogs.Actions\n * @type {AuditLogAction}\n */\nconst Actions = {\n ALL: null,\n GUILD_UPDATE: 1,\n CHANNEL_CREATE: 10,\n CHANNEL_UPDATE: 11,\n CHANNEL_DELETE: 12,\n CHANNEL_OVERWRITE_CREATE: 13,\n CHANNEL_OVERWRITE_UPDATE: 14,\n CHANNEL_OVERWRITE_DELETE: 15,\n MEMBER_KICK: 20,\n MEMBER_PRUNE: 21,\n MEMBER_BAN_ADD: 22,\n MEMBER_BAN_REMOVE: 23,\n MEMBER_UPDATE: 24,\n MEMBER_ROLE_UPDATE: 25,\n MEMBER_MOVE: 26,\n MEMBER_DISCONNECT: 27,\n BOT_ADD: 28,\n ROLE_CREATE: 30,\n ROLE_UPDATE: 31,\n ROLE_DELETE: 32,\n INVITE_CREATE: 40,\n INVITE_UPDATE: 41,\n INVITE_DELETE: 42,\n WEBHOOK_CREATE: 50,\n WEBHOOK_UPDATE: 51,\n WEBHOOK_DELETE: 52,\n EMOJI_CREATE: 60,\n EMOJI_UPDATE: 61,\n EMOJI_DELETE: 62,\n MESSAGE_DELETE: 72,\n MESSAGE_BULK_DELETE: 73,\n MESSAGE_PIN: 74,\n MESSAGE_UNPIN: 75,\n INTEGRATION_CREATE: 80,\n INTEGRATION_UPDATE: 81,\n INTEGRATION_DELETE: 82,\n};\n\n/**\n * Audit logs entries are held in this class.\n */\nclass GuildAuditLogs {\n constructor(guild, data) {\n if (data.users) for (const user of data.users) guild.client.users.add(user);\n /**\n * Cached webhooks\n * @type {Collection<Snowflake, Webhook>}\n * @private\n */\n this.webhooks = new Collection();\n if (data.webhooks) {\n for (const hook of data.webhooks) {\n this.webhooks.set(hook.id, new Webhook(guild.client, hook));\n }\n }\n\n /**\n * Cached integrations\n * @type {Collection<Snowflake, Integration>}\n * @private\n */\n this.integrations = new Collection();\n if (data.integrations) {\n for (const integration of data.integrations) {\n this.integrations.set(integration.id, new Integration(guild.client, integration, guild));\n }\n }\n\n /**\n * The entries for this guild's audit logs\n * @type {Collection<Snowflake, GuildAuditLogsEntry>}\n */\n this.entries = new Collection();\n for (const item of data.audit_log_entries) {\n const entry = new GuildAuditLogsEntry(this, guild, item);\n this.entries.set(entry.id, entry);\n }\n }\n\n /**\n * Handles possible promises for entry targets.\n * @returns {Promise<GuildAuditLogs>}\n */\n static build(...args) {\n const logs = new GuildAuditLogs(...args);\n return Promise.all(logs.entries.map(e => e.target)).then(() => logs);\n }\n\n /**\n * The target of an entry. It can be one of:\n * * A guild\n * * A user\n * * A role\n * * An emoji\n * * An invite\n * * A webhook\n * * An integration\n * * An object with an id key if target was deleted\n * * An object where the keys represent either the new value or the old value\n * @typedef {?Object|Guild|User|Role|GuildEmoji|Invite|Webhook|Integration} AuditLogEntryTarget\n */\n\n /**\n * Finds the target type from the entry action.\n * @param {AuditLogAction} target The action target\n * @returns {AuditLogTargetType}\n */\n static targetType(target) {\n if (target < 10) return Targets.GUILD;\n if (target < 20) return Targets.CHANNEL;\n if (target < 30) return Targets.USER;\n if (target < 40) return Targets.ROLE;\n if (target < 50) return Targets.INVITE;\n if (target < 60) return Targets.WEBHOOK;\n if (target < 70) return Targets.EMOJI;\n if (target < 80) return Targets.MESSAGE;\n if (target < 90) return Targets.INTEGRATION;\n return Targets.UNKNOWN;\n }\n\n /**\n * The action type of an entry, e.g. `CREATE`. Here are the available types:\n * * CREATE\n * * DELETE\n * * UPDATE\n * * ALL\n * @typedef {string} AuditLogActionType\n */\n\n /**\n * Finds the action type from the entry action.\n * @param {AuditLogAction} action The action target\n * @returns {AuditLogActionType}\n */\n static actionType(action) {\n if (\n [\n Actions.CHANNEL_CREATE,\n Actions.CHANNEL_OVERWRITE_CREATE,\n Actions.MEMBER_BAN_REMOVE,\n Actions.BOT_ADD,\n Actions.ROLE_CREATE,\n Actions.INVITE_CREATE,\n Actions.WEBHOOK_CREATE,\n Actions.EMOJI_CREATE,\n Actions.MESSAGE_PIN,\n Actions.INTEGRATION_CREATE,\n ].includes(action)\n ) {\n return 'CREATE';\n }\n\n if (\n [\n Actions.CHANNEL_DELETE,\n Actions.CHANNEL_OVERWRITE_DELETE,\n Actions.MEMBER_KICK,\n Actions.MEMBER_PRUNE,\n Actions.MEMBER_BAN_ADD,\n Actions.MEMBER_DISCONNECT,\n Actions.ROLE_DELETE,\n Actions.INVITE_DELETE,\n Actions.WEBHOOK_DELETE,\n Actions.EMOJI_DELETE,\n Actions.MESSAGE_DELETE,\n Actions.MESSAGE_BULK_DELETE,\n Actions.MESSAGE_UNPIN,\n Actions.INTEGRATION_DELETE,\n ].includes(action)\n ) {\n return 'DELETE';\n }\n\n if (\n [\n Actions.GUILD_UPDATE,\n Actions.CHANNEL_UPDATE,\n Actions.CHANNEL_OVERWRITE_UPDATE,\n Actions.MEMBER_UPDATE,\n Actions.MEMBER_ROLE_UPDATE,\n Actions.MEMBER_MOVE,\n Actions.ROLE_UPDATE,\n Actions.INVITE_UPDATE,\n Actions.WEBHOOK_UPDATE,\n Actions.EMOJI_UPDATE,\n Actions.INTEGRATION_UPDATE,\n ].includes(action)\n ) {\n return 'UPDATE';\n }\n\n return 'ALL';\n }\n\n toJSON() {\n return Util.flatten(this);\n }\n}\n\n/**\n * Audit logs entry.\n */\nclass GuildAuditLogsEntry {\n constructor(logs, guild, data) {\n const targetType = GuildAuditLogs.targetType(data.action_type);\n /**\n * The target type of this entry\n * @type {AuditLogTargetType}\n */\n this.targetType = targetType;\n\n /**\n * The action type of this entry\n * @type {AuditLogActionType}\n */\n this.actionType = GuildAuditLogs.actionType(data.action_type);\n\n /**\n * Specific action type of this entry in its string presentation\n * @type {AuditLogAction}\n */\n this.action = Object.keys(Actions).find(k => Actions[k] === data.action_type);\n\n /**\n * The reason of this entry\n * @type {?string}\n */\n this.reason = data.reason || null;\n\n /**\n * The user that executed this entry\n * @type {User}\n */\n this.executor = guild.client.options.partials.includes(PartialTypes.USER)\n ? guild.client.users.add({ id: data.user_id })\n : guild.client.users.cache.get(data.user_id);\n\n /**\n * An entry in the audit log representing a specific change.\n * @typedef {object} AuditLogChange\n * @property {string} key The property that was changed, e.g. `nick` for nickname changes\n * @property {*} [old] The old value of the change, e.g. for nicknames, the old nickname\n * @property {*} [new] The new value of the change, e.g. for nicknames, the new nickname\n */\n\n /**\n * Specific property changes\n * @type {AuditLogChange[]}\n */\n this.changes = data.changes ? data.changes.map(c => ({ key: c.key, old: c.old_value, new: c.new_value })) : null;\n\n /**\n * The ID of this entry\n * @type {Snowflake}\n */\n this.id = data.id;\n\n /**\n * Any extra data from the entry\n * @type {?Object|Role|GuildMember}\n */\n this.extra = null;\n switch (data.action_type) {\n case Actions.MEMBER_PRUNE:\n this.extra = {\n removed: Number(data.options.members_removed),\n days: Number(data.options.delete_member_days),\n };\n break;\n\n case Actions.MEMBER_MOVE:\n case Actions.MESSAGE_DELETE:\n case Actions.MESSAGE_BULK_DELETE:\n this.extra = {\n channel: guild.channels.cache.get(data.options.channel_id) || { id: data.options.channel_id },\n count: Number(data.options.count),\n };\n break;\n\n case Actions.MESSAGE_PIN:\n case Actions.MESSAGE_UNPIN:\n this.extra = {\n channel: guild.client.channels.cache.get(data.options.channel_id) || { id: data.options.channel_id },\n messageID: data.options.message_id,\n };\n break;\n\n case Actions.MEMBER_DISCONNECT:\n this.extra = {\n count: Number(data.options.count),\n };\n break;\n\n case Actions.CHANNEL_OVERWRITE_CREATE:\n case Actions.CHANNEL_OVERWRITE_UPDATE:\n case Actions.CHANNEL_OVERWRITE_DELETE:\n switch (data.options.type) {\n case 'member':\n this.extra = guild.members.cache.get(data.options.id) || { id: data.options.id, type: 'member' };\n break;\n\n case 'role':\n this.extra = guild.roles.cache.get(data.options.id) || {\n id: data.options.id,\n name: data.options.role_name,\n type: 'role',\n };\n break;\n\n default:\n break;\n }\n break;\n\n default:\n break;\n }\n\n /**\n * The target of this entry\n * @type {?AuditLogEntryTarget}\n */\n this.target = null;\n if (targetType === Targets.UNKNOWN) {\n this.target = this.changes.reduce((o, c) => {\n o[c.key] = c.new || c.old;\n return o;\n }, {});\n this.target.id = data.target_id;\n // MEMBER_DISCONNECT and similar types do not provide a target_id.\n } else if (targetType === Targets.USER && data.target_id) {\n this.target = guild.client.options.partials.includes(PartialTypes.USER)\n ? guild.client.users.add({ id: data.target_id })\n : guild.client.users.cache.get(data.target_id);\n } else if (targetType === Targets.GUILD) {\n this.target = guild.client.guilds.cache.get(data.target_id);\n } else if (targetType === Targets.WEBHOOK) {\n this.target =\n logs.webhooks.get(data.target_id) ||\n new Webhook(\n guild.client,\n this.changes.reduce(\n (o, c) => {\n o[c.key] = c.new || c.old;\n return o;\n },\n {\n id: data.target_id,\n guild_id: guild.id,\n },\n ),\n );\n } else if (targetType === Targets.INVITE) {\n this.target = guild.members.fetch(guild.client.user.id).then(me => {\n if (me.permissions.has('MANAGE_GUILD')) {\n const change = this.changes.find(c => c.key === 'code');\n return guild.fetchInvites().then(invites => {\n this.target = invites.find(i => i.code === (change.new || change.old));\n });\n } else {\n this.target = this.changes.reduce((o, c) => {\n o[c.key] = c.new || c.old;\n return o;\n }, {});\n return this.target;\n }\n });\n } else if (targetType === Targets.MESSAGE) {\n // Discord sends a channel id for the MESSAGE_BULK_DELETE action type.\n this.target =\n data.action_type === Actions.MESSAGE_BULK_DELETE\n ? guild.channels.cache.get(data.target_id) || { id: data.target_id }\n : guild.client.users.cache.get(data.target_id);\n } else if (targetType === Targets.INTEGRATION) {\n this.target =\n logs.integrations.get(data.target_id) ||\n new Integration(\n guild.client,\n this.changes.reduce(\n (o, c) => {\n o[c.key] = c.new || c.old;\n return o;\n },\n { id: data.target_id },\n ),\n guild,\n );\n } else if (data.target_id) {\n this.target = guild[`${targetType.toLowerCase()}s`].cache.get(data.target_id) || { id: data.target_id };\n }\n }\n\n /**\n * The timestamp this entry was created at\n * @type {number}\n * @readonly\n */\n get createdTimestamp() {\n return Snowflake.deconstruct(this.id).timestamp;\n }\n\n /**\n * The time this entry was created at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n toJSON() {\n return Util.flatten(this, { createdTimestamp: true });\n }\n}\n\nGuildAuditLogs.Actions = Actions;\nGuildAuditLogs.Targets = Targets;\nGuildAuditLogs.Entry = GuildAuditLogsEntry;\n\nmodule.exports = GuildAuditLogs;\n\n\n//# sourceURL=webpack://Discord/./src/structures/GuildAuditLogs.js?")},"./src/structures/GuildChannel.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Channel = __webpack_require__(/*! ./Channel */ \"./src/structures/Channel.js\");\nconst Invite = __webpack_require__(/*! ./Invite */ \"./src/structures/Invite.js\");\nconst PermissionOverwrites = __webpack_require__(/*! ./PermissionOverwrites */ \"./src/structures/PermissionOverwrites.js\");\nconst Role = __webpack_require__(/*! ./Role */ \"./src/structures/Role.js\");\nconst { Error, TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Represents a guild channel from any of the following:\n * - {@link TextChannel}\n * - {@link VoiceChannel}\n * - {@link CategoryChannel}\n * - {@link NewsChannel}\n * - {@link StoreChannel}\n * @extends {Channel}\n */\nclass GuildChannel extends Channel {\n /**\n * @param {Guild} guild The guild the guild channel is part of\n * @param {Object} data The data for the guild channel\n */\n constructor(guild, data) {\n super(guild.client, data);\n\n /**\n * The guild the channel is in\n * @type {Guild}\n */\n this.guild = guild;\n }\n\n _patch(data) {\n super._patch(data);\n\n /**\n * The name of the guild channel\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The raw position of the channel from discord\n * @type {number}\n */\n this.rawPosition = data.position;\n\n /**\n * The ID of the category parent of this channel\n * @type {?Snowflake}\n */\n this.parentID = data.parent_id;\n\n /**\n * A map of permission overwrites in this channel for roles and users\n * @type {Collection<Snowflake, PermissionOverwrites>}\n */\n this.permissionOverwrites = new Collection();\n if (data.permission_overwrites) {\n for (const overwrite of data.permission_overwrites) {\n this.permissionOverwrites.set(overwrite.id, new PermissionOverwrites(this, overwrite));\n }\n }\n }\n\n /**\n * The category parent of this channel\n * @type {?CategoryChannel}\n * @readonly\n */\n get parent() {\n return this.guild.channels.cache.get(this.parentID) || null;\n }\n\n /**\n * If the permissionOverwrites match the parent channel, null if no parent\n * @type {?boolean}\n * @readonly\n */\n get permissionsLocked() {\n if (!this.parent) return null;\n if (this.permissionOverwrites.size !== this.parent.permissionOverwrites.size) return false;\n return this.permissionOverwrites.every((value, key) => {\n const testVal = this.parent.permissionOverwrites.get(key);\n return (\n testVal !== undefined &&\n testVal.deny.bitfield === value.deny.bitfield &&\n testVal.allow.bitfield === value.allow.bitfield\n );\n });\n }\n\n /**\n * The position of the channel\n * @type {number}\n * @readonly\n */\n get position() {\n const sorted = this.guild._sortedChannels(this);\n return sorted.array().indexOf(sorted.get(this.id));\n }\n\n /**\n * Gets the overall set of permissions for a member or role in this channel, taking into account channel overwrites.\n * @param {GuildMemberResolvable|RoleResolvable} memberOrRole The member or role to obtain the overall permissions for\n * @returns {?Readonly<Permissions>}\n */\n permissionsFor(memberOrRole) {\n const member = this.guild.members.resolve(memberOrRole);\n if (member) return this.memberPermissions(member);\n const role = this.guild.roles.resolve(memberOrRole);\n if (role) return this.rolePermissions(role);\n return null;\n }\n\n overwritesFor(member, verified = false, roles = null) {\n if (!verified) member = this.guild.members.resolve(member);\n if (!member) return [];\n\n roles = roles || member.roles.cache;\n const roleOverwrites = [];\n let memberOverwrites;\n let everyoneOverwrites;\n\n for (const overwrite of this.permissionOverwrites.values()) {\n if (overwrite.id === this.guild.id) {\n everyoneOverwrites = overwrite;\n } else if (roles.has(overwrite.id)) {\n roleOverwrites.push(overwrite);\n } else if (overwrite.id === member.id) {\n memberOverwrites = overwrite;\n }\n }\n\n return {\n everyone: everyoneOverwrites,\n roles: roleOverwrites,\n member: memberOverwrites,\n };\n }\n\n /**\n * Gets the overall set of permissions for a member in this channel, taking into account channel overwrites.\n * @param {GuildMember} member The member to obtain the overall permissions for\n * @returns {Readonly<Permissions>}\n * @private\n */\n memberPermissions(member) {\n if (member.id === this.guild.ownerID) return new Permissions(Permissions.ALL).freeze();\n\n const roles = member.roles.cache;\n const permissions = new Permissions(roles.map(role => role.permissions));\n\n if (permissions.has(Permissions.FLAGS.ADMINISTRATOR)) return new Permissions(Permissions.ALL).freeze();\n\n const overwrites = this.overwritesFor(member, true, roles);\n\n return permissions\n .remove(overwrites.everyone ? overwrites.everyone.deny : 0)\n .add(overwrites.everyone ? overwrites.everyone.allow : 0)\n .remove(overwrites.roles.length > 0 ? overwrites.roles.map(role => role.deny) : 0)\n .add(overwrites.roles.length > 0 ? overwrites.roles.map(role => role.allow) : 0)\n .remove(overwrites.member ? overwrites.member.deny : 0)\n .add(overwrites.member ? overwrites.member.allow : 0)\n .freeze();\n }\n\n /**\n * Gets the overall set of permissions for a role in this channel, taking into account channel overwrites.\n * @param {Role} role The role to obtain the overall permissions for\n * @returns {Readonly<Permissions>}\n * @private\n */\n rolePermissions(role) {\n if (role.permissions.has(Permissions.FLAGS.ADMINISTRATOR)) return new Permissions(Permissions.ALL).freeze();\n\n const everyoneOverwrites = this.permissionOverwrites.get(this.guild.id);\n const roleOverwrites = this.permissionOverwrites.get(role.id);\n\n return role.permissions\n .remove(everyoneOverwrites ? everyoneOverwrites.deny : 0)\n .add(everyoneOverwrites ? everyoneOverwrites.allow : 0)\n .remove(roleOverwrites ? roleOverwrites.deny : 0)\n .add(roleOverwrites ? roleOverwrites.allow : 0)\n .freeze();\n }\n\n /**\n * Replaces the permission overwrites in this channel.\n * @param {OverwriteResolvable[]|Collection<Snowflake, OverwriteResolvable>} overwrites\n * Permission overwrites the channel gets updated with\n * @param {string} [reason] Reason for updating the channel overwrites\n * @returns {Promise<GuildChannel>}\n * @example\n * channel.overwritePermissions([\n * {\n * id: message.author.id,\n * deny: ['VIEW_CHANNEL'],\n * },\n * ], 'Needed to change permissions');\n */\n overwritePermissions(overwrites, reason) {\n if (!Array.isArray(overwrites) && !(overwrites instanceof Collection)) {\n return Promise.reject(\n new TypeError('INVALID_TYPE', 'overwrites', 'Array or Collection of Permission Overwrites', true),\n );\n }\n return this.edit({ permissionOverwrites: overwrites, reason }).then(() => this);\n }\n\n /**\n * Updates Overwrites for a user or role in this channel. (creates if non-existent)\n * @param {RoleResolvable|UserResolvable} userOrRole The user or role to update\n * @param {PermissionOverwriteOptions} options The options for the update\n * @param {string} [reason] Reason for creating/editing this overwrite\n * @returns {Promise<GuildChannel>}\n * @example\n * // Update or Create permission overwrites for a message author\n * message.channel.updateOverwrite(message.author, {\n * SEND_MESSAGES: false\n * })\n * .then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))\n * .catch(console.error);\n */\n updateOverwrite(userOrRole, options, reason) {\n userOrRole = this.guild.roles.resolve(userOrRole) || this.client.users.resolve(userOrRole);\n if (!userOrRole) return Promise.reject(new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role'));\n\n const existing = this.permissionOverwrites.get(userOrRole.id);\n if (existing) return existing.update(options, reason).then(() => this);\n return this.createOverwrite(userOrRole, options, reason);\n }\n\n /**\n * Overwrites the permissions for a user or role in this channel. (replaces if existent)\n * @param {RoleResolvable|UserResolvable} userOrRole The user or role to update\n * @param {PermissionOverwriteOptions} options The options for the update\n * @param {string} [reason] Reason for creating/editing this overwrite\n * @returns {Promise<GuildChannel>}\n * @example\n * // Create or Replace permissions overwrites for a message author\n * message.channel.createOverwrite(message.author, {\n * SEND_MESSAGES: false\n * })\n * .then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))\n * .catch(console.error);\n */\n createOverwrite(userOrRole, options, reason) {\n userOrRole = this.guild.roles.resolve(userOrRole) || this.client.users.resolve(userOrRole);\n if (!userOrRole) return Promise.reject(new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role'));\n\n const type = userOrRole instanceof Role ? 'role' : 'member';\n const { allow, deny } = PermissionOverwrites.resolveOverwriteOptions(options);\n\n return this.client.api\n .channels(this.id)\n .permissions[userOrRole.id].put({\n data: { id: userOrRole.id, type, allow: allow.bitfield, deny: deny.bitfield },\n reason,\n })\n .then(() => this);\n }\n\n /**\n * Locks in the permission overwrites from the parent channel.\n * @returns {Promise<GuildChannel>}\n */\n lockPermissions() {\n if (!this.parent) return Promise.reject(new Error('GUILD_CHANNEL_ORPHAN'));\n const permissionOverwrites = this.parent.permissionOverwrites.map(overwrite => overwrite.toJSON());\n return this.edit({ permissionOverwrites });\n }\n\n /**\n * A collection of members that can see this channel, mapped by their ID\n * @type {Collection<Snowflake, GuildMember>}\n * @readonly\n */\n get members() {\n const members = new Collection();\n for (const member of this.guild.members.cache.values()) {\n if (this.permissionsFor(member).has('VIEW_CHANNEL', false)) {\n members.set(member.id, member);\n }\n }\n return members;\n }\n\n /**\n * The data for a guild channel.\n * @typedef {Object} ChannelData\n * @property {string} [name] The name of the channel\n * @property {number} [position] The position of the channel\n * @property {string} [topic] The topic of the text channel\n * @property {boolean} [nsfw] Whether the channel is NSFW\n * @property {number} [bitrate] The bitrate of the voice channel\n * @property {number} [userLimit] The user limit of the voice channel\n * @property {Snowflake} [parentID] The parent ID of the channel\n * @property {boolean} [lockPermissions]\n * Lock the permissions of the channel to what the parent's permissions are\n * @property {OverwriteResolvable[]|Collection<Snowflake, OverwriteResolvable>} [permissionOverwrites]\n * Permission overwrites for the channel\n * @property {number} [rateLimitPerUser] The ratelimit per user for the channel in seconds\n */\n\n /**\n * Edits the channel.\n * @param {ChannelData} data The new data for the channel\n * @param {string} [reason] Reason for editing this channel\n * @returns {Promise<GuildChannel>}\n * @example\n * // Edit a channel\n * channel.edit({ name: 'new-channel' })\n * .then(console.log)\n * .catch(console.error);\n */\n async edit(data, reason) {\n if (typeof data.position !== 'undefined') {\n await Util.setPosition(\n this,\n data.position,\n false,\n this.guild._sortedChannels(this),\n this.client.api.guilds(this.guild.id).channels,\n reason,\n ).then(updatedChannels => {\n this.client.actions.GuildChannelsPositionUpdate.handle({\n guild_id: this.guild.id,\n channels: updatedChannels,\n });\n });\n }\n\n let permission_overwrites;\n\n if (data.permissionOverwrites) {\n permission_overwrites = data.permissionOverwrites.map(o => PermissionOverwrites.resolve(o, this.guild));\n }\n\n if (data.lockPermissions) {\n if (data.parentID) {\n const newParent = this.guild.channels.resolve(data.parentID);\n if (newParent && newParent.type === 'category') {\n permission_overwrites = newParent.permissionOverwrites.map(o => PermissionOverwrites.resolve(o, this.guild));\n }\n } else if (this.parent) {\n permission_overwrites = this.parent.permissionOverwrites.map(o => PermissionOverwrites.resolve(o, this.guild));\n }\n }\n\n const newData = await this.client.api.channels(this.id).patch({\n data: {\n name: (data.name || this.name).trim(),\n topic: data.topic,\n nsfw: data.nsfw,\n bitrate: data.bitrate || this.bitrate,\n user_limit: typeof data.userLimit !== 'undefined' ? data.userLimit : this.userLimit,\n parent_id: data.parentID,\n lock_permissions: data.lockPermissions,\n rate_limit_per_user: data.rateLimitPerUser,\n permission_overwrites,\n },\n reason,\n });\n\n const clone = this._clone();\n clone._patch(newData);\n return clone;\n }\n\n /**\n * Sets a new name for the guild channel.\n * @param {string} name The new name for the guild channel\n * @param {string} [reason] Reason for changing the guild channel's name\n * @returns {Promise<GuildChannel>}\n * @example\n * // Set a new channel name\n * channel.setName('not_general')\n * .then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))\n * .catch(console.error);\n */\n setName(name, reason) {\n return this.edit({ name }, reason);\n }\n\n /**\n * Sets the category parent of this channel.\n * @param {?CategoryChannel|Snowflake} channel Parent channel\n * @param {Object} [options={}] Options to pass\n * @param {boolean} [options.lockPermissions=true] Lock the permissions to what the parent's permissions are\n * @param {string} [options.reason] Reason for modifying the parent of this channel\n * @returns {Promise<GuildChannel>}\n * @example\n * // Add a parent to a channel\n * message.channel.setParent('355908108431917066', { lockPermissions: false })\n * .then(channel => console.log(`New parent of ${message.channel.name}: ${channel.name}`))\n * .catch(console.error);\n */\n setParent(channel, { lockPermissions = true, reason } = {}) {\n return this.edit(\n {\n // eslint-disable-next-line no-prototype-builtins\n parentID: channel !== null ? (channel.hasOwnProperty('id') ? channel.id : channel) : null,\n lockPermissions,\n },\n reason,\n );\n }\n\n /**\n * Sets a new topic for the guild channel.\n * @param {string} topic The new topic for the guild channel\n * @param {string} [reason] Reason for changing the guild channel's topic\n * @returns {Promise<GuildChannel>}\n * @example\n * // Set a new channel topic\n * channel.setTopic('needs more rate limiting')\n * .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))\n * .catch(console.error);\n */\n setTopic(topic, reason) {\n return this.edit({ topic }, reason);\n }\n\n /**\n * Sets a new position for the guild channel.\n * @param {number} position The new position for the guild channel\n * @param {Object} [options] Options for setting position\n * @param {boolean} [options.relative=false] Change the position relative to its current value\n * @param {string} [options.reason] Reason for changing the position\n * @returns {Promise<GuildChannel>}\n * @example\n * // Set a new channel position\n * channel.setPosition(2)\n * .then(newChannel => console.log(`Channel's new position is ${newChannel.position}`))\n * .catch(console.error);\n */\n setPosition(position, { relative, reason } = {}) {\n return Util.setPosition(\n this,\n position,\n relative,\n this.guild._sortedChannels(this),\n this.client.api.guilds(this.guild.id).channels,\n reason,\n ).then(updatedChannels => {\n this.client.actions.GuildChannelsPositionUpdate.handle({\n guild_id: this.guild.id,\n channels: updatedChannels,\n });\n return this;\n });\n }\n\n /**\n * Creates an invite to this guild channel.\n * @param {Object} [options={}] Options for the invite\n * @param {boolean} [options.temporary=false] Whether members that joined via the invite should be automatically\n * kicked after 24 hours if they have not yet received a role\n * @param {number} [options.maxAge=86400] How long the invite should last (in seconds, 0 for forever)\n * @param {number} [options.maxUses=0] Maximum number of uses\n * @param {boolean} [options.unique=false] Create a unique invite, or use an existing one with similar settings\n * @param {string} [options.reason] Reason for creating this\n * @returns {Promise<Invite>}\n * @example\n * // Create an invite to a channel\n * channel.createInvite()\n * .then(invite => console.log(`Created an invite with a code of ${invite.code}`))\n * .catch(console.error);\n */\n createInvite({ temporary = false, maxAge = 86400, maxUses = 0, unique, reason } = {}) {\n return this.client.api\n .channels(this.id)\n .invites.post({\n data: {\n temporary,\n max_age: maxAge,\n max_uses: maxUses,\n unique,\n },\n reason,\n })\n .then(invite => new Invite(this.client, invite));\n }\n\n /**\n * Fetches a collection of invites to this guild channel.\n * Resolves with a collection mapping invites by their codes.\n * @returns {Promise<Collection<string, Invite>>}\n */\n async fetchInvites() {\n const inviteItems = await this.client.api.channels(this.id).invites.get();\n const invites = new Collection();\n for (const inviteItem of inviteItems) {\n const invite = new Invite(this.client, inviteItem);\n invites.set(invite.code, invite);\n }\n return invites;\n }\n\n /* eslint-disable max-len */\n /**\n * Clones this channel.\n * @param {Object} [options] The options\n * @param {string} [options.name=this.name] Name of the new channel\n * @param {OverwriteResolvable[]|Collection<Snowflake, OverwriteResolvable>} [options.permissionOverwrites=this.permissionOverwrites]\n * Permission overwrites of the new channel\n * @param {string} [options.type=this.type] Type of the new channel\n * @param {string} [options.topic=this.topic] Topic of the new channel (only text)\n * @param {boolean} [options.nsfw=this.nsfw] Whether the new channel is nsfw (only text)\n * @param {number} [options.bitrate=this.bitrate] Bitrate of the new channel in bits (only voice)\n * @param {number} [options.userLimit=this.userLimit] Maximum amount of users allowed in the new channel (only voice)\n * @param {number} [options.rateLimitPerUser=ThisType.rateLimitPerUser] Ratelimit per user for the new channel (only text)\n * @param {ChannelResolvable} [options.parent=this.parent] Parent of the new channel\n * @param {string} [options.reason] Reason for cloning this channel\n * @returns {Promise<GuildChannel>}\n */\n clone(options = {}) {\n Util.mergeDefault(\n {\n name: this.name,\n permissionOverwrites: this.permissionOverwrites,\n topic: this.topic,\n type: this.type,\n nsfw: this.nsfw,\n parent: this.parent,\n bitrate: this.bitrate,\n userLimit: this.userLimit,\n rateLimitPerUser: this.rateLimitPerUser,\n reason: null,\n },\n options,\n );\n return this.guild.channels.create(options.name, options);\n }\n /* eslint-enable max-len */\n\n /**\n * Checks if this channel has the same type, topic, position, name, overwrites and ID as another channel.\n * In most cases, a simple `channel.id === channel2.id` will do, and is much faster too.\n * @param {GuildChannel} channel Channel to compare with\n * @returns {boolean}\n */\n equals(channel) {\n let equal =\n channel &&\n this.id === channel.id &&\n this.type === channel.type &&\n this.topic === channel.topic &&\n this.position === channel.position &&\n this.name === channel.name;\n\n if (equal) {\n if (this.permissionOverwrites && channel.permissionOverwrites) {\n equal = this.permissionOverwrites.equals(channel.permissionOverwrites);\n } else {\n equal = !this.permissionOverwrites && !channel.permissionOverwrites;\n }\n }\n\n return equal;\n }\n\n /**\n * Whether the channel is deletable by the client user\n * @type {boolean}\n * @readonly\n */\n get deletable() {\n return this.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false);\n }\n\n /**\n * Whether the channel is manageable by the client user\n * @type {boolean}\n * @readonly\n */\n get manageable() {\n if (this.client.user.id === this.guild.ownerID) return true;\n if (this.type === 'voice') {\n if (!this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false)) {\n return false;\n }\n } else if (!this.viewable) {\n return false;\n }\n return this.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false);\n }\n\n /**\n * Whether the channel is viewable by the client user\n * @type {boolean}\n * @readonly\n */\n get viewable() {\n if (this.client.user.id === this.guild.ownerID) return true;\n const permissions = this.permissionsFor(this.client.user);\n if (!permissions) return false;\n return permissions.has(Permissions.FLAGS.VIEW_CHANNEL, false);\n }\n\n /**\n * Deletes this channel.\n * @param {string} [reason] Reason for deleting this channel\n * @returns {Promise<GuildChannel>}\n * @example\n * // Delete the channel\n * channel.delete('making room for new channels')\n * .then(console.log)\n * .catch(console.error);\n */\n delete(reason) {\n return this.client.api\n .channels(this.id)\n .delete({ reason })\n .then(() => this);\n }\n}\n\nmodule.exports = GuildChannel;\n\n\n//# sourceURL=webpack://Discord/./src/structures/GuildChannel.js?")},"./src/structures/GuildEmoji.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst BaseGuildEmoji = __webpack_require__(/*! ./BaseGuildEmoji */ \"./src/structures/BaseGuildEmoji.js\");\nconst { Error } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst GuildEmojiRoleManager = __webpack_require__(/*! ../managers/GuildEmojiRoleManager */ \"./src/managers/GuildEmojiRoleManager.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\n\n/**\n * Represents a custom emoji.\n * @extends {BaseGuildEmoji}\n */\nclass GuildEmoji extends BaseGuildEmoji {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} data The data for the guild emoji\n * @param {Guild} guild The guild the guild emoji is part of\n */\n constructor(client, data, guild) {\n super(client, data, guild);\n\n /**\n * The user who created this emoji\n * @type {?User}\n */\n this.author = null;\n }\n\n /**\n * The guild this emoji is part of\n * @type {Guild}\n * @name GuildEmoji#guild\n */\n\n _clone() {\n const clone = super._clone();\n clone._roles = this._roles.slice();\n return clone;\n }\n\n _patch(data) {\n super._patch(data);\n if (typeof data.user !== 'undefined') this.author = this.client.users.add(data.user);\n }\n\n /**\n * Whether the emoji is deletable by the client user\n * @type {boolean}\n * @readonly\n */\n get deletable() {\n if (!this.guild.me) throw new Error('GUILD_UNCACHED_ME');\n return !this.managed && this.guild.me.hasPermission(Permissions.FLAGS.MANAGE_EMOJIS);\n }\n\n /**\n * A manager for roles this emoji is active for.\n * @type {GuildEmojiRoleManager}\n * @readonly\n */\n get roles() {\n return new GuildEmojiRoleManager(this);\n }\n\n /**\n * Fetches the author for this emoji\n * @returns {Promise<User>}\n */\n async fetchAuthor() {\n if (this.managed) {\n throw new Error('EMOJI_MANAGED');\n } else {\n if (!this.guild.me) throw new Error('GUILD_UNCACHED_ME');\n if (!this.guild.me.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS)) {\n throw new Error('MISSING_MANAGE_EMOJIS_PERMISSION', this.guild);\n }\n }\n const data = await this.client.api.guilds(this.guild.id).emojis(this.id).get();\n this._patch(data);\n return this.author;\n }\n\n /**\n * Data for editing an emoji.\n * @typedef {Object} GuildEmojiEditData\n * @property {string} [name] The name of the emoji\n * @property {Collection<Snowflake, Role>|RoleResolvable[]} [roles] Roles to restrict emoji to\n */\n\n /**\n * Edits the emoji.\n * @param {GuildEmojiEditData} data The new data for the emoji\n * @param {string} [reason] Reason for editing this emoji\n * @returns {Promise<GuildEmoji>}\n * @example\n * // Edit an emoji\n * emoji.edit({ name: 'newemoji' })\n * .then(e => console.log(`Edited emoji ${e}`))\n * .catch(console.error);\n */\n edit(data, reason) {\n const roles = data.roles ? data.roles.map(r => r.id || r) : undefined;\n return this.client.api\n .guilds(this.guild.id)\n .emojis(this.id)\n .patch({\n data: {\n name: data.name,\n roles,\n },\n reason,\n })\n .then(newData => {\n const clone = this._clone();\n clone._patch(newData);\n return clone;\n });\n }\n\n /**\n * Sets the name of the emoji.\n * @param {string} name The new name for the emoji\n * @param {string} [reason] Reason for changing the emoji's name\n * @returns {Promise<GuildEmoji>}\n */\n setName(name, reason) {\n return this.edit({ name }, reason);\n }\n\n /**\n * Deletes the emoji.\n * @param {string} [reason] Reason for deleting the emoji\n * @returns {Promise<GuildEmoji>}\n */\n delete(reason) {\n return this.client.api\n .guilds(this.guild.id)\n .emojis(this.id)\n .delete({ reason })\n .then(() => this);\n }\n\n /**\n * Whether this emoji is the same as another one.\n * @param {GuildEmoji|Object} other The emoji to compare it to\n * @returns {boolean} Whether the emoji is equal to the given emoji or not\n */\n equals(other) {\n if (other instanceof GuildEmoji) {\n return (\n other.id === this.id &&\n other.name === this.name &&\n other.managed === this.managed &&\n other.requiresColons === this.requiresColons &&\n other.roles.cache.size === this.roles.cache.size &&\n other.roles.cache.every(role => this.roles.cache.has(role.id))\n );\n } else {\n return (\n other.id === this.id &&\n other.name === this.name &&\n other.roles.length === this.roles.cache.size &&\n other.roles.every(role => this.roles.cache.has(role))\n );\n }\n }\n}\n\nmodule.exports = GuildEmoji;\n\n\n//# sourceURL=webpack://Discord/./src/structures/GuildEmoji.js?")},"./src/structures/GuildMember.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst { Presence } = __webpack_require__(/*! ./Presence */ \"./src/structures/Presence.js\");\nconst Role = __webpack_require__(/*! ./Role */ \"./src/structures/Role.js\");\nconst VoiceState = __webpack_require__(/*! ./VoiceState */ \"./src/structures/VoiceState.js\");\nconst TextBasedChannel = __webpack_require__(/*! ./interfaces/TextBasedChannel */ \"./src/structures/interfaces/TextBasedChannel.js\");\nconst { Error } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst GuildMemberRoleManager = __webpack_require__(/*! ../managers/GuildMemberRoleManager */ \"./src/managers/GuildMemberRoleManager.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\n\n/**\n * Represents a member of a guild on Discord.\n * @implements {TextBasedChannel}\n * @extends {Base}\n */\nclass GuildMember extends Base {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} data The data for the guild member\n * @param {Guild} guild The guild the member is part of\n */\n constructor(client, data, guild) {\n super(client);\n\n /**\n * The guild that this member is part of\n * @type {Guild}\n */\n this.guild = guild;\n\n /**\n * The timestamp the member joined the guild at\n * @type {?number}\n */\n this.joinedTimestamp = null;\n\n /**\n * The ID of the last message sent by the member in their guild, if one was sent\n * @type {?Snowflake}\n */\n this.lastMessageID = null;\n\n /**\n * The ID of the channel for the last message sent by the member in their guild, if one was sent\n * @type {?Snowflake}\n */\n this.lastMessageChannelID = null;\n\n /**\n * The timestamp of when the member used their Nitro boost on the guild, if it was used\n * @type {?number}\n */\n this.premiumSinceTimestamp = null;\n\n /**\n * Whether the member has been removed from the guild\n * @type {boolean}\n */\n this.deleted = false;\n\n /**\n * The nickname of this member, if they have one\n * @type {?string}\n * @name GuildMember#nickname\n */\n this.nickname = null;\n\n this._roles = [];\n if (data) this._patch(data);\n }\n\n _patch(data) {\n if ('user' in data) {\n /**\n * The user that this guild member instance represents\n * @type {User}\n * @name GuildMember#user\n */\n this.user = this.client.users.add(data.user, true);\n }\n\n if ('nick' in data) this.nickname = data.nick;\n if ('joined_at' in data) this.joinedTimestamp = new Date(data.joined_at).getTime();\n if ('premium_since' in data) this.premiumSinceTimestamp = new Date(data.premium_since).getTime();\n if ('roles' in data) this._roles = data.roles;\n }\n\n _clone() {\n const clone = super._clone();\n clone._roles = this._roles.slice();\n return clone;\n }\n\n /**\n * Whether this GuildMember is a partial\n * @type {boolean}\n * @readonly\n */\n get partial() {\n return !this.joinedTimestamp;\n }\n\n /**\n * A manager for the roles belonging to this member\n * @type {GuildMemberRoleManager}\n * @readonly\n */\n get roles() {\n return new GuildMemberRoleManager(this);\n }\n\n /**\n * The Message object of the last message sent by the member in their guild, if one was sent\n * @type {?Message}\n * @readonly\n */\n get lastMessage() {\n const channel = this.guild.channels.cache.get(this.lastMessageChannelID);\n return (channel && channel.messages.cache.get(this.lastMessageID)) || null;\n }\n\n /**\n * The voice state of this member\n * @type {VoiceState}\n * @readonly\n */\n get voice() {\n return this.guild.voiceStates.cache.get(this.id) || new VoiceState(this.guild, { user_id: this.id });\n }\n\n /**\n * The time this member joined the guild\n * @type {?Date}\n * @readonly\n */\n get joinedAt() {\n return this.joinedTimestamp ? new Date(this.joinedTimestamp) : null;\n }\n\n /**\n * The time of when the member used their Nitro boost on the guild, if it was used\n * @type {?Date}\n * @readonly\n */\n get premiumSince() {\n return this.premiumSinceTimestamp ? new Date(this.premiumSinceTimestamp) : null;\n }\n\n /**\n * The presence of this guild member\n * @type {Presence}\n * @readonly\n */\n get presence() {\n return (\n this.guild.presences.cache.get(this.id) ||\n new Presence(this.client, {\n user: {\n id: this.id,\n },\n guild: this.guild,\n })\n );\n }\n\n /**\n * The displayed color of this member in base 10\n * @type {number}\n * @readonly\n */\n get displayColor() {\n const role = this.roles.color;\n return (role && role.color) || 0;\n }\n\n /**\n * The displayed color of this member in hexadecimal\n * @type {string}\n * @readonly\n */\n get displayHexColor() {\n const role = this.roles.color;\n return (role && role.hexColor) || '#000000';\n }\n\n /**\n * The ID of this member\n * @type {Snowflake}\n * @readonly\n */\n get id() {\n return this.user.id;\n }\n\n /**\n * The nickname of this member, or their username if they don't have one\n * @type {?string}\n * @readonly\n */\n get displayName() {\n return this.nickname || this.user.username;\n }\n\n /**\n * The overall set of permissions for this member, taking only roles into account\n * @type {Readonly<Permissions>}\n * @readonly\n */\n get permissions() {\n if (this.user.id === this.guild.ownerID) return new Permissions(Permissions.ALL).freeze();\n return new Permissions(this.roles.cache.map(role => role.permissions)).freeze();\n }\n\n /**\n * Whether the client user is above this user in the hierarchy, according to role position and guild ownership.\n * This is a prerequisite for many moderative actions.\n * @type {boolean}\n * @readonly\n */\n get manageable() {\n if (this.user.id === this.guild.ownerID) return false;\n if (this.user.id === this.client.user.id) return false;\n if (this.client.user.id === this.guild.ownerID) return true;\n if (!this.guild.me) throw new Error('GUILD_UNCACHED_ME');\n return this.guild.me.roles.highest.comparePositionTo(this.roles.highest) > 0;\n }\n\n /**\n * Whether this member is kickable by the client user\n * @type {boolean}\n * @readonly\n */\n get kickable() {\n return this.manageable && this.guild.me.permissions.has(Permissions.FLAGS.KICK_MEMBERS);\n }\n\n /**\n * Whether this member is bannable by the client user\n * @type {boolean}\n * @readonly\n */\n get bannable() {\n return this.manageable && this.guild.me.permissions.has(Permissions.FLAGS.BAN_MEMBERS);\n }\n\n /**\n * Returns `channel.permissionsFor(guildMember)`. Returns permissions for a member in a guild channel,\n * taking into account roles and permission overwrites.\n * @param {ChannelResolvable} channel The guild channel to use as context\n * @returns {Readonly<Permissions>}\n */\n permissionsIn(channel) {\n channel = this.guild.channels.resolve(channel);\n if (!channel) throw new Error('GUILD_CHANNEL_RESOLVE');\n return channel.memberPermissions(this);\n }\n\n /**\n * Checks if any of this member's roles have a permission.\n * @param {PermissionResolvable} permission Permission(s) to check for\n * @param {Object} [options] Options\n * @param {boolean} [options.checkAdmin=true] Whether to allow the administrator permission to override\n * @param {boolean} [options.checkOwner=true] Whether to allow being the guild's owner to override\n * @returns {boolean}\n */\n hasPermission(permission, { checkAdmin = true, checkOwner = true } = {}) {\n if (checkOwner && this.user.id === this.guild.ownerID) return true;\n return this.roles.cache.some(r => r.permissions.has(permission, checkAdmin));\n }\n\n /**\n * The data for editing a guild member.\n * @typedef {Object} GuildMemberEditData\n * @property {string} [nick] The nickname to set for the member\n * @property {Collection<Snowflake, Role>|RoleResolvable[]} [roles] The roles or role IDs to apply\n * @property {boolean} [mute] Whether or not the member should be muted\n * @property {boolean} [deaf] Whether or not the member should be deafened\n * @property {ChannelResolvable|null} [channel] Channel to move member to (if they are connected to voice), or `null`\n * if you want to kick them from voice\n */\n\n /**\n * Edits this member.\n * @param {GuildMemberEditData} data The data to edit the member with\n * @param {string} [reason] Reason for editing this user\n * @returns {Promise<GuildMember>}\n */\n async edit(data, reason) {\n if (data.channel) {\n data.channel = this.guild.channels.resolve(data.channel);\n if (!data.channel || data.channel.type !== 'voice') {\n throw new Error('GUILD_VOICE_CHANNEL_RESOLVE');\n }\n data.channel_id = data.channel.id;\n data.channel = undefined;\n } else if (data.channel === null) {\n data.channel_id = null;\n data.channel = undefined;\n }\n if (data.roles) data.roles = data.roles.map(role => (role instanceof Role ? role.id : role));\n let endpoint = this.client.api.guilds(this.guild.id);\n if (this.user.id === this.client.user.id) {\n const keys = Object.keys(data);\n if (keys.length === 1 && keys[0] === 'nick') endpoint = endpoint.members('@me').nick;\n else endpoint = endpoint.members(this.id);\n } else {\n endpoint = endpoint.members(this.id);\n }\n await endpoint.patch({ data, reason });\n\n const clone = this._clone();\n data.user = this.user;\n clone._patch(data);\n return clone;\n }\n\n /**\n * Sets the nickname for this member.\n * @param {string} nick The nickname for the guild member\n * @param {string} [reason] Reason for setting the nickname\n * @returns {Promise<GuildMember>}\n */\n setNickname(nick, reason) {\n return this.edit({ nick }, reason);\n }\n\n /**\n * Creates a DM channel between the client and this member.\n * @returns {Promise<DMChannel>}\n */\n createDM() {\n return this.user.createDM();\n }\n\n /**\n * Deletes any DMs with this member.\n * @returns {Promise<DMChannel>}\n */\n deleteDM() {\n return this.user.deleteDM();\n }\n\n /**\n * Kicks this member from the guild.\n * @param {string} [reason] Reason for kicking user\n * @returns {Promise<GuildMember>}\n */\n kick(reason) {\n return this.client.api\n .guilds(this.guild.id)\n .members(this.user.id)\n .delete({ reason })\n .then(() => this);\n }\n\n /**\n * Bans this guild member.\n * @param {Object} [options] Options for the ban\n * @param {number} [options.days=0] Number of days of messages to delete, must be between 0 and 7\n * @param {string} [options.reason] Reason for banning\n * @returns {Promise<GuildMember>}\n * @example\n * // ban a guild member\n * guildMember.ban({ days: 7, reason: 'They deserved it' })\n * .then(console.log)\n * .catch(console.error);\n */\n ban(options) {\n return this.guild.members.ban(this, options);\n }\n\n /**\n * Fetches this GuildMember.\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<GuildMember>}\n */\n fetch(force = false) {\n return this.guild.members.fetch({ user: this.id, cache: true, force });\n }\n\n /**\n * When concatenated with a string, this automatically returns the user's mention instead of the GuildMember object.\n * @returns {string}\n * @example\n * // Logs: Hello from <@123456789012345678>!\n * console.log(`Hello from ${member}!`);\n */\n toString() {\n return `<@${this.nickname ? '!' : ''}${this.user.id}>`;\n }\n\n toJSON() {\n return super.toJSON({\n guild: 'guildID',\n user: 'userID',\n displayName: true,\n speaking: false,\n lastMessage: false,\n lastMessageID: false,\n roles: true,\n });\n }\n\n // These are here only for documentation purposes - they are implemented by TextBasedChannel\n /* eslint-disable no-empty-function */\n send() {}\n}\n\nTextBasedChannel.applyToClass(GuildMember);\n\nmodule.exports = GuildMember;\n\n\n//# sourceURL=webpack://Discord/./src/structures/GuildMember.js?")},"./src/structures/GuildPreview.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Base = __webpack_require__(/*! ./Base */ "./src/structures/Base.js");\nconst GuildPreviewEmoji = __webpack_require__(/*! ./GuildPreviewEmoji */ "./src/structures/GuildPreviewEmoji.js");\nconst Collection = __webpack_require__(/*! ../util/Collection */ "./src/util/Collection.js");\n\n/**\n * Represents the data about the guild any bot can preview, connected to the specified guild.\n * @extends {Base}\n */\nclass GuildPreview extends Base {\n constructor(client, data) {\n super(client);\n\n if (!data) return;\n\n this._patch(data);\n }\n\n /**\n * Builds the guild with the provided data.\n * @param {*} data The raw data of the guild\n * @private\n */\n _patch(data) {\n /**\n * The id of this guild\n * @type {string}\n */\n this.id = data.id;\n\n /**\n * The name of this guild\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The icon of this guild\n * @type {?string}\n */\n this.icon = data.icon;\n\n /**\n * The splash icon of this guild\n * @type {?string}\n */\n this.splash = data.splash;\n\n /**\n * The discovery splash icon of this guild\n * @type {?string}\n */\n this.discoverySplash = data.discovery_splash;\n\n /**\n * An array of enabled guild features\n * @type {Features[]}\n */\n this.features = data.features;\n\n /**\n * The approximate count of members in this guild\n * @type {number}\n */\n this.approximateMemberCount = data.approximate_member_count;\n\n /**\n * The approximate count of online members in this guild\n * @type {number}\n */\n this.approximatePresenceCount = data.approximate_presence_count;\n\n /**\n * The description for this guild\n * @type {?string}\n */\n this.description = data.description;\n\n if (!this.emojis) {\n /**\n * Collection of emojis belonging to this guild\n * @type {Collection<Snowflake, GuildPreviewEmoji>}\n */\n this.emojis = new Collection();\n } else {\n this.emojis.clear();\n }\n for (const emoji of data.emojis) {\n this.emojis.set(emoji.id, new GuildPreviewEmoji(this.client, emoji, this));\n }\n }\n\n /**\n * The URL to this guild\'s splash.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n splashURL({ format, size } = {}) {\n if (!this.splash) return null;\n return this.client.rest.cdn.Splash(this.id, this.splash, format, size);\n }\n\n /**\n * The URL to this guild\'s discovery splash.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n discoverySplashURL({ format, size } = {}) {\n if (!this.discoverySplash) return null;\n return this.client.rest.cdn.DiscoverySplash(this.id, this.discoverySplash, format, size);\n }\n\n /**\n * The URL to this guild\'s icon.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n iconURL({ format, size, dynamic } = {}) {\n if (!this.icon) return null;\n return this.client.rest.cdn.Icon(this.id, this.icon, format, size, dynamic);\n }\n\n /**\n * Fetches this guild.\n * @returns {Promise<GuildPreview>}\n */\n fetch() {\n return this.client.api\n .guilds(this.id)\n .preview.get()\n .then(data => {\n this._patch(data);\n return this;\n });\n }\n\n /**\n * When concatenated with a string, this automatically returns the guild\'s name instead of the Guild object.\n * @returns {string}\n * @example\n * // Logs: Hello from My Guild!\n * console.log(`Hello from ${previewGuild}!`);\n */\n toString() {\n return this.name;\n }\n\n toJSON() {\n const json = super.toJSON();\n json.iconURL = this.iconURL();\n json.splashURL = this.splashURL();\n return json;\n }\n}\n\nmodule.exports = GuildPreview;\n\n\n//# sourceURL=webpack://Discord/./src/structures/GuildPreview.js?')},"./src/structures/GuildPreviewEmoji.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BaseGuildEmoji = __webpack_require__(/*! ./BaseGuildEmoji */ "./src/structures/BaseGuildEmoji.js");\n\n/**\n * Represents an instance of an emoji belonging to a public guild obtained through Discord\'s preview endpoint.\n * @extends {BaseGuildEmoji}\n */\nclass GuildPreviewEmoji extends BaseGuildEmoji {\n /**\n * The public guild this emoji is part of\n * @type {GuildPreview}\n * @name GuildPreviewEmoji#guild\n */\n\n /**\n * Set of roles this emoji is active for\n * @type {Set<Snowflake>}\n * @readonly\n */\n get roles() {\n return new Set(this._roles);\n }\n}\n\nmodule.exports = GuildPreviewEmoji;\n\n\n//# sourceURL=webpack://Discord/./src/structures/GuildPreviewEmoji.js?')},"./src/structures/Integration.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\n\n/**\n * The information account for an integration\n * @typedef {Object} IntegrationAccount\n * @property {string} id The id of the account\n * @property {string} name The name of the account\n */\n\n/**\n * Represents a guild integration.\n */\nclass Integration extends Base {\n constructor(client, data, guild) {\n super(client);\n\n /**\n * The guild this integration belongs to\n * @type {Guild}\n */\n this.guild = guild;\n\n /**\n * The integration id\n * @type {Snowflake}\n */\n this.id = data.id;\n\n /**\n * The integration name\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The integration type (twitch, youtube, etc)\n * @type {string}\n */\n this.type = data.type;\n\n /**\n * Whether this integration is enabled\n * @type {boolean}\n */\n this.enabled = data.enabled;\n\n /**\n * Whether this integration is syncing\n * @type {boolean}\n */\n this.syncing = data.syncing;\n\n /**\n * The role that this integration uses for subscribers\n * @type {Role}\n */\n this.role = this.guild.roles.cache.get(data.role_id);\n\n if (data.user) {\n /**\n * The user for this integration\n * @type {?User}\n */\n this.user = this.client.users.add(data.user);\n }\n\n /**\n * The account integration information\n * @type {IntegrationAccount}\n */\n this.account = data.account;\n\n /**\n * The last time this integration was last synced\n * @type {number}\n */\n this.syncedAt = data.synced_at;\n this._patch(data);\n }\n\n _patch(data) {\n /**\n * The behavior of expiring subscribers\n * @type {number}\n */\n this.expireBehavior = data.expire_behavior;\n\n /**\n * The grace period before expiring subscribers\n * @type {number}\n */\n this.expireGracePeriod = data.expire_grace_period;\n }\n\n /**\n * Sync this integration\n * @returns {Promise<Integration>}\n */\n sync() {\n this.syncing = true;\n return this.client.api\n .guilds(this.guild.id)\n .integrations(this.id)\n .post()\n .then(() => {\n this.syncing = false;\n this.syncedAt = Date.now();\n return this;\n });\n }\n\n /**\n * The data for editing an integration.\n * @typedef {Object} IntegrationEditData\n * @property {number} [expireBehavior] The new behaviour of expiring subscribers\n * @property {number} [expireGracePeriod] The new grace period before expiring subscribers\n */\n\n /**\n * Edits this integration.\n * @param {IntegrationEditData} data The data to edit this integration with\n * @param {string} reason Reason for editing this integration\n * @returns {Promise<Integration>}\n */\n edit(data, reason) {\n if ('expireBehavior' in data) {\n data.expire_behavior = data.expireBehavior;\n data.expireBehavior = null;\n }\n if ('expireGracePeriod' in data) {\n data.expire_grace_period = data.expireGracePeriod;\n data.expireGracePeriod = null;\n }\n // The option enable_emoticons is only available for Twitch at this moment\n return this.client.api\n .guilds(this.guild.id)\n .integrations(this.id)\n .patch({ data, reason })\n .then(() => {\n this._patch(data);\n return this;\n });\n }\n\n /**\n * Deletes this integration.\n * @returns {Promise<Integration>}\n * @param {string} [reason] Reason for deleting this integration\n */\n delete(reason) {\n return this.client.api\n .guilds(this.guild.id)\n .integrations(this.id)\n .delete({ reason })\n .then(() => this);\n }\n\n toJSON() {\n return super.toJSON({\n role: 'roleID',\n guild: 'guildID',\n user: 'userID',\n });\n }\n}\n\nmodule.exports = Integration;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Integration.js?")},"./src/structures/Invite.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst { Endpoints } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\n\n/**\n * Represents an invitation to a guild channel.\n * <warn>The only guaranteed properties are `code`, `channel`, and `url`. Other properties can be missing.</warn>\n * @extends {Base}\n */\nclass Invite extends Base {\n constructor(client, data) {\n super(client);\n this._patch(data);\n }\n\n _patch(data) {\n /**\n * The guild the invite is for\n * @type {?Guild}\n */\n this.guild = data.guild ? this.client.guilds.add(data.guild, false) : null;\n\n /**\n * The code for this invite\n * @type {string}\n */\n this.code = data.code;\n\n /**\n * The approximate number of online members of the guild this invite is for\n * @type {?number}\n */\n this.presenceCount = 'approximate_presence_count' in data ? data.approximate_presence_count : null;\n\n /**\n * The approximate total number of members of the guild this invite is for\n * @type {?number}\n */\n this.memberCount = 'approximate_member_count' in data ? data.approximate_member_count : null;\n\n /**\n * Whether or not this invite is temporary\n * @type {?boolean}\n */\n this.temporary = 'temporary' in data ? data.temporary : null;\n\n /**\n * The maximum age of the invite, in seconds, 0 if never expires\n * @type {?number}\n */\n this.maxAge = 'max_age' in data ? data.max_age : null;\n\n /**\n * How many times this invite has been used\n * @type {?number}\n */\n this.uses = 'uses' in data ? data.uses : null;\n\n /**\n * The maximum uses of this invite\n * @type {?number}\n */\n this.maxUses = 'max_uses' in data ? data.max_uses : null;\n\n /**\n * The user who created this invite\n * @type {?User}\n */\n this.inviter = data.inviter ? this.client.users.add(data.inviter) : null;\n\n /**\n * The target user for this invite\n * @type {?User}\n */\n this.targetUser = data.target_user ? this.client.users.add(data.target_user) : null;\n\n /**\n * The type of the target user:\n * * 1: STREAM\n * @typedef {number} TargetUser\n */\n\n /**\n * The target user type\n * @type {?TargetUser}\n */\n this.targetUserType = typeof data.target_user_type === 'number' ? data.target_user_type : null;\n\n /**\n * The channel the invite is for\n * @type {Channel}\n */\n this.channel = this.client.channels.add(data.channel, this.guild, false);\n\n /**\n * The timestamp the invite was created at\n * @type {?number}\n */\n this.createdTimestamp = 'created_at' in data ? new Date(data.created_at).getTime() : null;\n }\n\n /**\n * The time the invite was created at\n * @type {?Date}\n * @readonly\n */\n get createdAt() {\n return this.createdTimestamp ? new Date(this.createdTimestamp) : null;\n }\n\n /**\n * Whether the invite is deletable by the client user\n * @type {boolean}\n * @readonly\n */\n get deletable() {\n const guild = this.guild;\n if (!guild || !this.client.guilds.cache.has(guild.id)) return false;\n if (!guild.me) throw new Error('GUILD_UNCACHED_ME');\n return (\n this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false) ||\n guild.me.permissions.has(Permissions.FLAGS.MANAGE_GUILD)\n );\n }\n\n /**\n * The timestamp the invite will expire at\n * @type {?number}\n * @readonly\n */\n get expiresTimestamp() {\n return this.createdTimestamp && this.maxAge ? this.createdTimestamp + this.maxAge * 1000 : null;\n }\n\n /**\n * The time the invite will expire at\n * @type {?Date}\n * @readonly\n */\n get expiresAt() {\n const { expiresTimestamp } = this;\n return expiresTimestamp ? new Date(expiresTimestamp) : null;\n }\n\n /**\n * The URL to the invite\n * @type {string}\n * @readonly\n */\n get url() {\n return Endpoints.invite(this.client.options.http.invite, this.code);\n }\n\n /**\n * Deletes this invite.\n * @param {string} [reason] Reason for deleting this invite\n * @returns {Promise<Invite>}\n */\n delete(reason) {\n return this.client.api.invites[this.code].delete({ reason }).then(() => this);\n }\n\n /**\n * When concatenated with a string, this automatically concatenates the invite's URL instead of the object.\n * @returns {string}\n * @example\n * // Logs: Invite: https://discord.gg/A1b2C3\n * console.log(`Invite: ${invite}`);\n */\n toString() {\n return this.url;\n }\n\n toJSON() {\n return super.toJSON({\n url: true,\n expiresTimestamp: true,\n presenceCount: false,\n memberCount: false,\n uses: false,\n channel: 'channelID',\n inviter: 'inviterID',\n guild: 'guildID',\n });\n }\n\n valueOf() {\n return this.code;\n }\n}\n\nmodule.exports = Invite;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Invite.js?")},"./src/structures/Message.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst APIMessage = __webpack_require__(/*! ./APIMessage */ \"./src/structures/APIMessage.js\");\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst ClientApplication = __webpack_require__(/*! ./ClientApplication */ \"./src/structures/ClientApplication.js\");\nconst MessageAttachment = __webpack_require__(/*! ./MessageAttachment */ \"./src/structures/MessageAttachment.js\");\nconst Embed = __webpack_require__(/*! ./MessageEmbed */ \"./src/structures/MessageEmbed.js\");\nconst Mentions = __webpack_require__(/*! ./MessageMentions */ \"./src/structures/MessageMentions.js\");\nconst ReactionCollector = __webpack_require__(/*! ./ReactionCollector */ \"./src/structures/ReactionCollector.js\");\nconst { Error, TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst ReactionManager = __webpack_require__(/*! ../managers/ReactionManager */ \"./src/managers/ReactionManager.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst { MessageTypes } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst MessageFlags = __webpack_require__(/*! ../util/MessageFlags */ \"./src/util/MessageFlags.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\nconst SnowflakeUtil = __webpack_require__(/*! ../util/Snowflake */ \"./src/util/Snowflake.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Represents a message on Discord.\n * @extends {Base}\n */\nclass Message extends Base {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} data The data for the message\n * @param {TextChannel|DMChannel|NewsChannel} channel The channel the message was sent in\n */\n constructor(client, data, channel) {\n super(client);\n\n /**\n * The channel that the message was sent in\n * @type {TextChannel|DMChannel|NewsChannel}\n */\n this.channel = channel;\n\n /**\n * Whether this message has been deleted\n * @type {boolean}\n */\n this.deleted = false;\n\n if (data) this._patch(data);\n }\n\n _patch(data) {\n /**\n * The ID of the message\n * @type {Snowflake}\n */\n this.id = data.id;\n\n if ('type' in data) {\n /**\n * The type of the message\n * @type {?MessageType}\n */\n this.type = MessageTypes[data.type];\n\n /**\n * Whether or not this message was sent by Discord, not actually a user (e.g. pin notifications)\n * @type {?boolean}\n */\n this.system = data.type !== 0;\n } else if (typeof this.type !== 'string') {\n this.system = null;\n this.type = null;\n }\n\n if ('content' in data) {\n /**\n * The content of the message\n * @type {?string}\n */\n this.content = data.content;\n } else if (typeof this.content !== 'string') {\n this.content = null;\n }\n\n if ('author' in data) {\n /**\n * The author of the message\n * @type {?User}\n */\n this.author = this.client.users.add(data.author, !data.webhook_id);\n } else if (!this.author) {\n this.author = null;\n }\n\n if ('pinned' in data) {\n /**\n * Whether or not this message is pinned\n * @type {?boolean}\n */\n this.pinned = Boolean(data.pinned);\n } else if (typeof this.pinned !== 'boolean') {\n this.pinned = null;\n }\n\n if ('tts' in data) {\n /**\n * Whether or not the message was Text-To-Speech\n * @type {?boolean}\n */\n this.tts = data.tts;\n } else if (typeof this.tts !== 'boolean') {\n this.tts = null;\n }\n\n /**\n * A random number or string used for checking message delivery\n * <warn>This is only received after the message was sent successfully, and\n * lost if re-fetched</warn>\n * @type {?string}\n */\n this.nonce = 'nonce' in data ? data.nonce : null;\n\n /**\n * A list of embeds in the message - e.g. YouTube Player\n * @type {MessageEmbed[]}\n */\n this.embeds = (data.embeds || []).map(e => new Embed(e, true));\n\n /**\n * A collection of attachments in the message - e.g. Pictures - mapped by their ID\n * @type {Collection<Snowflake, MessageAttachment>}\n */\n this.attachments = new Collection();\n if (data.attachments) {\n for (const attachment of data.attachments) {\n this.attachments.set(attachment.id, new MessageAttachment(attachment.url, attachment.filename, attachment));\n }\n }\n\n /**\n * The timestamp the message was sent at\n * @type {number}\n */\n this.createdTimestamp = SnowflakeUtil.deconstruct(this.id).timestamp;\n\n /**\n * The timestamp the message was last edited at (if applicable)\n * @type {?number}\n */\n this.editedTimestamp = 'edited_timestamp' in data ? new Date(data.edited_timestamp).getTime() : null;\n\n /**\n * A manager of the reactions belonging to this message\n * @type {ReactionManager}\n */\n this.reactions = new ReactionManager(this);\n if (data.reactions && data.reactions.length > 0) {\n for (const reaction of data.reactions) {\n this.reactions.add(reaction);\n }\n }\n\n /**\n * All valid mentions that the message contains\n * @type {MessageMentions}\n */\n this.mentions = new Mentions(this, data.mentions, data.mention_roles, data.mention_everyone, data.mention_channels);\n\n /**\n * ID of the webhook that sent the message, if applicable\n * @type {?Snowflake}\n */\n this.webhookID = data.webhook_id || null;\n\n /**\n * Supplemental application information for group activities\n * @type {?ClientApplication}\n */\n this.application = data.application ? new ClientApplication(this.client, data.application) : null;\n\n /**\n * Group activity\n * @type {?MessageActivity}\n */\n this.activity = data.activity\n ? {\n partyID: data.activity.party_id,\n type: data.activity.type,\n }\n : null;\n\n /**\n * The previous versions of the message, sorted with the most recent first\n * @type {Message[]}\n * @private\n */\n this._edits = [];\n\n if (this.member && data.member) {\n this.member._patch(data.member);\n } else if (data.member && this.guild && this.author) {\n this.guild.members.add(Object.assign(data.member, { user: this.author }));\n }\n\n /**\n * Flags that are applied to the message\n * @type {Readonly<MessageFlags>}\n */\n this.flags = new MessageFlags(data.flags).freeze();\n\n /**\n * Reference data sent in a crossposted message.\n * @typedef {Object} MessageReference\n * @property {string} channelID ID of the channel the message was crossposted from\n * @property {?string} guildID ID of the guild the message was crossposted from\n * @property {?string} messageID ID of the message that was crossposted\n */\n\n /**\n * Message reference data\n * @type {?MessageReference}\n */\n this.reference = data.message_reference\n ? {\n channelID: data.message_reference.channel_id,\n guildID: data.message_reference.guild_id,\n messageID: data.message_reference.message_id,\n }\n : null;\n }\n\n /**\n * Whether or not this message is a partial\n * @type {boolean}\n * @readonly\n */\n get partial() {\n return typeof this.content !== 'string' || !this.author;\n }\n\n /**\n * Updates the message.\n * @param {Object} data Raw Discord message update data\n * @private\n */\n patch(data) {\n const clone = this._clone();\n this._edits.unshift(clone);\n\n if ('edited_timestamp' in data) this.editedTimestamp = new Date(data.edited_timestamp).getTime();\n if ('content' in data) this.content = data.content;\n if ('pinned' in data) this.pinned = data.pinned;\n if ('tts' in data) this.tts = data.tts;\n if ('embeds' in data) this.embeds = data.embeds.map(e => new Embed(e, true));\n else this.embeds = this.embeds.slice();\n\n if ('attachments' in data) {\n this.attachments = new Collection();\n for (const attachment of data.attachments) {\n this.attachments.set(attachment.id, new MessageAttachment(attachment.url, attachment.filename, attachment));\n }\n } else {\n this.attachments = new Collection(this.attachments);\n }\n\n this.mentions = new Mentions(\n this,\n 'mentions' in data ? data.mentions : this.mentions.users,\n 'mention_roles' in data ? data.mention_roles : this.mentions.roles,\n 'mention_everyone' in data ? data.mention_everyone : this.mentions.everyone,\n 'mention_channels' in data ? data.mention_channels : this.mentions.crosspostedChannels,\n );\n\n this.flags = new MessageFlags('flags' in data ? data.flags : 0).freeze();\n }\n\n /**\n * Represents the author of the message as a guild member.\n * Only available if the message comes from a guild where the author is still a member\n * @type {?GuildMember}\n * @readonly\n */\n get member() {\n return this.guild ? this.guild.member(this.author) || null : null;\n }\n\n /**\n * The time the message was sent at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n /**\n * The time the message was last edited at (if applicable)\n * @type {?Date}\n * @readonly\n */\n get editedAt() {\n return this.editedTimestamp ? new Date(this.editedTimestamp) : null;\n }\n\n /**\n * The guild the message was sent in (if in a guild channel)\n * @type {?Guild}\n * @readonly\n */\n get guild() {\n return this.channel.guild || null;\n }\n\n /**\n * The url to jump to this message\n * @type {string}\n * @readonly\n */\n get url() {\n return `https://discord.com/channels/${this.guild ? this.guild.id : '@me'}/${this.channel.id}/${this.id}`;\n }\n\n /**\n * The message contents with all mentions replaced by the equivalent text.\n * If mentions cannot be resolved to a name, the relevant mention in the message content will not be converted.\n * @type {string}\n * @readonly\n */\n get cleanContent() {\n // eslint-disable-next-line eqeqeq\n return this.content != null ? Util.cleanContent(this.content, this) : null;\n }\n\n /**\n * Creates a reaction collector.\n * @param {CollectorFilter} filter The filter to apply\n * @param {ReactionCollectorOptions} [options={}] Options to send to the collector\n * @returns {ReactionCollector}\n * @example\n * // Create a reaction collector\n * const filter = (reaction, user) => reaction.emoji.name === '👌' && user.id === 'someID';\n * const collector = message.createReactionCollector(filter, { time: 15000 });\n * collector.on('collect', r => console.log(`Collected ${r.emoji.name}`));\n * collector.on('end', collected => console.log(`Collected ${collected.size} items`));\n */\n createReactionCollector(filter, options = {}) {\n return new ReactionCollector(this, filter, options);\n }\n\n /**\n * An object containing the same properties as CollectorOptions, but a few more:\n * @typedef {ReactionCollectorOptions} AwaitReactionsOptions\n * @property {string[]} [errors] Stop/end reasons that cause the promise to reject\n */\n\n /**\n * Similar to createReactionCollector but in promise form.\n * Resolves with a collection of reactions that pass the specified filter.\n * @param {CollectorFilter} filter The filter function to use\n * @param {AwaitReactionsOptions} [options={}] Optional options to pass to the internal collector\n * @returns {Promise<Collection<string, MessageReaction>>}\n * @example\n * // Create a reaction collector\n * const filter = (reaction, user) => reaction.emoji.name === '👌' && user.id === 'someID'\n * message.awaitReactions(filter, { time: 15000 })\n * .then(collected => console.log(`Collected ${collected.size} reactions`))\n * .catch(console.error);\n */\n awaitReactions(filter, options = {}) {\n return new Promise((resolve, reject) => {\n const collector = this.createReactionCollector(filter, options);\n collector.once('end', (reactions, reason) => {\n if (options.errors && options.errors.includes(reason)) reject(reactions);\n else resolve(reactions);\n });\n });\n }\n\n /**\n * An array of cached versions of the message, including the current version\n * Sorted from latest (first) to oldest (last)\n * @type {Message[]}\n * @readonly\n */\n get edits() {\n const copy = this._edits.slice();\n copy.unshift(this);\n return copy;\n }\n\n /**\n * Whether the message is editable by the client user\n * @type {boolean}\n * @readonly\n */\n get editable() {\n return this.author.id === this.client.user.id;\n }\n\n /**\n * Whether the message is deletable by the client user\n * @type {boolean}\n * @readonly\n */\n get deletable() {\n return (\n !this.deleted &&\n (this.author.id === this.client.user.id ||\n (this.guild && this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_MESSAGES, false)))\n );\n }\n\n /**\n * Whether the message is pinnable by the client user\n * @type {boolean}\n * @readonly\n */\n get pinnable() {\n return (\n this.type === 'DEFAULT' &&\n (!this.guild || this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_MESSAGES, false))\n );\n }\n\n /**\n * Options that can be passed into editMessage.\n * @typedef {Object} MessageEditOptions\n * @property {string} [content] Content to be edited\n * @property {MessageEmbed|Object} [embed] An embed to be added/edited\n * @property {string|boolean} [code] Language for optional codeblock formatting to apply\n * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content\n */\n\n /**\n * Edits the content of the message.\n * @param {StringResolvable|APIMessage} [content] The new content for the message\n * @param {MessageEditOptions|MessageEmbed} [options] The options to provide\n * @returns {Promise<Message>}\n * @example\n * // Update the content of a message\n * message.edit('This is my new content!')\n * .then(msg => console.log(`Updated the content of a message to ${msg.content}`))\n * .catch(console.error);\n */\n edit(content, options) {\n const { data } =\n content instanceof APIMessage ? content.resolveData() : APIMessage.create(this, content, options).resolveData();\n return this.client.api.channels[this.channel.id].messages[this.id].patch({ data }).then(d => {\n const clone = this._clone();\n clone._patch(d);\n return clone;\n });\n }\n\n /**\n * Pins this message to the channel's pinned messages.\n * @param {Object} [options] Options for pinning\n * @param {string} [options.reason] Reason for pinning\n * @returns {Promise<Message>}\n * @example\n * // Pin a message with a reason\n * message.pin({ reason: 'important' })\n * .then(console.log)\n * .catch(console.error)\n */\n pin(options) {\n return this.client.api\n .channels(this.channel.id)\n .pins(this.id)\n .put(options)\n .then(() => this);\n }\n\n /**\n * Unpins this message from the channel's pinned messages.\n * @param {Object} [options] Options for unpinning\n * @param {string} [options.reason] Reason for unpinning\n * @returns {Promise<Message>}\n * @example\n * // Unpin a message with a reason\n * message.unpin({ reason: 'no longer relevant' })\n * .then(console.log)\n * .catch(console.error)\n */\n unpin(options) {\n return this.client.api\n .channels(this.channel.id)\n .pins(this.id)\n .delete(options)\n .then(() => this);\n }\n\n /**\n * Adds a reaction to the message.\n * @param {EmojiIdentifierResolvable} emoji The emoji to react with\n * @returns {Promise<MessageReaction>}\n * @example\n * // React to a message with a unicode emoji\n * message.react('🤔')\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // React to a message with a custom emoji\n * message.react(message.guild.emojis.cache.get('123456789012345678'))\n * .then(console.log)\n * .catch(console.error);\n */\n react(emoji) {\n emoji = this.client.emojis.resolveIdentifier(emoji);\n if (!emoji) throw new TypeError('EMOJI_TYPE');\n\n return this.client.api\n .channels(this.channel.id)\n .messages(this.id)\n .reactions(emoji, '@me')\n .put()\n .then(\n () =>\n this.client.actions.MessageReactionAdd.handle({\n user: this.client.user,\n channel: this.channel,\n message: this,\n emoji: Util.parseEmoji(emoji),\n }).reaction,\n );\n }\n\n /**\n * Deletes the message.\n * @param {Object} [options] Options\n * @param {number} [options.timeout=0] How long to wait to delete the message in milliseconds\n * @param {string} [options.reason] Reason for deleting this message, if it does not belong to the client user\n * @returns {Promise<Message>}\n * @example\n * // Delete a message\n * message.delete({ timeout: 5000 })\n * .then(msg => console.log(`Deleted message from ${msg.author.username} after 5 seconds`))\n * .catch(console.error);\n */\n delete(options = {}) {\n if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);\n const { timeout = 0, reason } = options;\n if (timeout <= 0) {\n return this.channel.messages.delete(this.id, reason).then(() => this);\n } else {\n return new Promise(resolve => {\n this.client.setTimeout(() => {\n resolve(this.delete({ reason }));\n }, timeout);\n });\n }\n }\n\n /**\n * Replies to the message.\n * @param {StringResolvable|APIMessage} [content=''] The content for the message\n * @param {MessageOptions|MessageAdditions} [options={}] The options to provide\n * @returns {Promise<Message|Message[]>}\n * @example\n * // Reply to a message\n * message.reply('Hey, I\\'m a reply!')\n * .then(() => console.log(`Sent a reply to ${message.author.username}`))\n * .catch(console.error);\n */\n reply(content, options) {\n return this.channel.send(\n content instanceof APIMessage\n ? content\n : APIMessage.transformOptions(content, options, { reply: this.member || this.author }),\n );\n }\n\n /**\n * Fetch this message.\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<Message>}\n */\n fetch(force = false) {\n return this.channel.messages.fetch(this.id, true, force);\n }\n\n /**\n * Fetches the webhook used to create this message.\n * @returns {Promise<?Webhook>}\n */\n fetchWebhook() {\n if (!this.webhookID) return Promise.reject(new Error('WEBHOOK_MESSAGE'));\n return this.client.fetchWebhook(this.webhookID);\n }\n\n /**\n * Suppresses or unsuppresses embeds on a message\n * @param {boolean} [suppress=true] If the embeds should be suppressed or not\n * @returns {Promise<Message>}\n */\n suppressEmbeds(suppress = true) {\n const flags = new MessageFlags(this.flags.bitfield);\n\n if (suppress) {\n flags.add(MessageFlags.FLAGS.SUPPRESS_EMBEDS);\n } else {\n flags.remove(MessageFlags.FLAGS.SUPPRESS_EMBEDS);\n }\n\n return this.edit({ flags });\n }\n\n /**\n * Used mainly internally. Whether two messages are identical in properties. If you want to compare messages\n * without checking all the properties, use `message.id === message2.id`, which is much more efficient. This\n * method allows you to see if there are differences in content, embeds, attachments, nonce and tts properties.\n * @param {Message} message The message to compare it to\n * @param {Object} rawData Raw data passed through the WebSocket about this message\n * @returns {boolean}\n */\n equals(message, rawData) {\n if (!message) return false;\n const embedUpdate = !message.author && !message.attachments;\n if (embedUpdate) return this.id === message.id && this.embeds.length === message.embeds.length;\n\n let equal =\n this.id === message.id &&\n this.author.id === message.author.id &&\n this.content === message.content &&\n this.tts === message.tts &&\n this.nonce === message.nonce &&\n this.embeds.length === message.embeds.length &&\n this.attachments.length === message.attachments.length;\n\n if (equal && rawData) {\n equal =\n this.mentions.everyone === message.mentions.everyone &&\n this.createdTimestamp === new Date(rawData.timestamp).getTime() &&\n this.editedTimestamp === new Date(rawData.edited_timestamp).getTime();\n }\n\n return equal;\n }\n\n /**\n * When concatenated with a string, this automatically concatenates the message's content instead of the object.\n * @returns {string}\n * @example\n * // Logs: Message: This is a message!\n * console.log(`Message: ${message}`);\n */\n toString() {\n return this.content;\n }\n\n toJSON() {\n return super.toJSON({\n channel: 'channelID',\n author: 'authorID',\n application: 'applicationID',\n guild: 'guildID',\n cleanContent: true,\n member: false,\n reactions: false,\n });\n }\n}\n\nmodule.exports = Message;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Message.js?")},"./src/structures/MessageAttachment.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Represents an attachment in a message.\n */\nclass MessageAttachment {\n /**\n * @param {BufferResolvable|Stream} attachment The file\n * @param {string} [name=null] The name of the file, if any\n * @param {Object} [data] Extra data\n */\n constructor(attachment, name = null, data) {\n this.attachment = attachment;\n /**\n * The name of this attachment\n * @type {?string}\n */\n this.name = name;\n if (data) this._patch(data);\n }\n\n /**\n * Sets the file of this attachment.\n * @param {BufferResolvable|Stream} attachment The file\n * @param {string} [name=null] The name of the file, if any\n * @returns {MessageAttachment} This attachment\n */\n setFile(attachment, name = null) {\n this.attachment = attachment;\n this.name = name;\n return this;\n }\n\n /**\n * Sets the name of this attachment.\n * @param {string} name The name of the file\n * @returns {MessageAttachment} This attachment\n */\n setName(name) {\n this.name = name;\n return this;\n }\n\n _patch(data) {\n /**\n * The ID of this attachment\n * @type {Snowflake}\n */\n this.id = data.id;\n\n /**\n * The size of this attachment in bytes\n * @type {number}\n */\n this.size = data.size;\n\n /**\n * The URL to this attachment\n * @type {string}\n */\n this.url = data.url;\n\n /**\n * The Proxy URL to this attachment\n * @type {string}\n */\n this.proxyURL = data.proxy_url;\n\n /**\n * The height of this attachment (if an image or video)\n * @type {?number}\n */\n this.height = typeof data.height !== 'undefined' ? data.height : null;\n\n /**\n * The width of this attachment (if an image or video)\n * @type {?number}\n */\n this.width = typeof data.width !== 'undefined' ? data.width : null;\n }\n\n /**\n * Whether or not this attachment has been marked as a spoiler\n * @type {boolean}\n * @readonly\n */\n get spoiler() {\n return Util.basename(this.url).startsWith('SPOILER_');\n }\n\n toJSON() {\n return Util.flatten(this);\n }\n}\n\nmodule.exports = MessageAttachment;\n\n\n//# sourceURL=webpack://Discord/./src/structures/MessageAttachment.js?")},"./src/structures/MessageCollector.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Collector = __webpack_require__(/*! ./interfaces/Collector */ \"./src/structures/interfaces/Collector.js\");\nconst { Events } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\n\n/**\n * @typedef {CollectorOptions} MessageCollectorOptions\n * @property {number} max The maximum amount of messages to collect\n * @property {number} maxProcessed The maximum amount of messages to process\n */\n\n/**\n * Collects messages on a channel.\n * Will automatically stop if the channel (`'channelDelete'`) or guild (`'guildDelete'`) are deleted.\n * @extends {Collector}\n */\nclass MessageCollector extends Collector {\n /**\n * @param {TextChannel|DMChannel} channel The channel\n * @param {CollectorFilter} filter The filter to be applied to this collector\n * @param {MessageCollectorOptions} options The options to be applied to this collector\n * @emits MessageCollector#message\n */\n constructor(channel, filter, options = {}) {\n super(channel.client, filter, options);\n\n /**\n * The channel\n * @type {TextBasedChannel}\n */\n this.channel = channel;\n\n /**\n * Total number of messages that were received in the channel during message collection\n * @type {number}\n */\n this.received = 0;\n\n const bulkDeleteListener = messages => {\n for (const message of messages.values()) this.handleDispose(message);\n };\n this._handleChannelDeletion = this._handleChannelDeletion.bind(this);\n this._handleGuildDeletion = this._handleGuildDeletion.bind(this);\n\n this.client.incrementMaxListeners();\n this.client.on(Events.MESSAGE_CREATE, this.handleCollect);\n this.client.on(Events.MESSAGE_DELETE, this.handleDispose);\n this.client.on(Events.MESSAGE_BULK_DELETE, bulkDeleteListener);\n this.client.on(Events.CHANNEL_DELETE, this._handleChannelDeletion);\n this.client.on(Events.GUILD_DELETE, this._handleGuildDeletion);\n\n this.once('end', () => {\n this.client.removeListener(Events.MESSAGE_CREATE, this.handleCollect);\n this.client.removeListener(Events.MESSAGE_DELETE, this.handleDispose);\n this.client.removeListener(Events.MESSAGE_BULK_DELETE, bulkDeleteListener);\n this.client.removeListener(Events.CHANNEL_DELETE, this._handleChannelDeletion);\n this.client.removeListener(Events.GUILD_DELETE, this._handleGuildDeletion);\n this.client.decrementMaxListeners();\n });\n }\n\n /**\n * Handles a message for possible collection.\n * @param {Message} message The message that could be collected\n * @returns {?Snowflake}\n * @private\n */\n collect(message) {\n /**\n * Emitted whenever a message is collected.\n * @event MessageCollector#collect\n * @param {Message} message The message that was collected\n */\n if (message.channel.id !== this.channel.id) return null;\n this.received++;\n return message.id;\n }\n\n /**\n * Handles a message for possible disposal.\n * @param {Message} message The message that could be disposed of\n * @returns {?Snowflake}\n */\n dispose(message) {\n /**\n * Emitted whenever a message is disposed of.\n * @event MessageCollector#dispose\n * @param {Message} message The message that was disposed of\n */\n return message.channel.id === this.channel.id ? message.id : null;\n }\n\n /**\n * Checks after un/collection to see if the collector is done.\n * @returns {?string}\n * @private\n */\n endReason() {\n if (this.options.max && this.collected.size >= this.options.max) return 'limit';\n if (this.options.maxProcessed && this.received === this.options.maxProcessed) return 'processedLimit';\n return null;\n }\n\n /**\n * Handles checking if the channel has been deleted, and if so, stops the collector with the reason 'channelDelete'.\n * @private\n * @param {GuildChannel} channel The channel that was deleted\n * @returns {void}\n */\n _handleChannelDeletion(channel) {\n if (channel.id === this.channel.id) {\n this.stop('channelDelete');\n }\n }\n\n /**\n * Handles checking if the guild has been deleted, and if so, stops the collector with the reason 'guildDelete'.\n * @private\n * @param {Guild} guild The guild that was deleted\n * @returns {void}\n */\n _handleGuildDeletion(guild) {\n if (this.channel.guild && guild.id === this.channel.guild.id) {\n this.stop('guildDelete');\n }\n }\n}\n\nmodule.exports = MessageCollector;\n\n\n//# sourceURL=webpack://Discord/./src/structures/MessageCollector.js?")},"./src/structures/MessageEmbed.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst { RangeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Represents an embed in a message (image/video preview, rich embed, etc.)\n */\nclass MessageEmbed {\n /**\n * @name MessageEmbed\n * @kind constructor\n * @memberof MessageEmbed\n * @param {MessageEmbed|Object} [data={}] MessageEmbed to clone or raw embed data\n */\n\n constructor(data = {}, skipValidation = false) {\n this.setup(data, skipValidation);\n }\n\n setup(data, skipValidation) {\n /**\n * The type of this embed, either:\n * * `rich` - a rich embed\n * * `image` - an image embed\n * * `video` - a video embed\n * * `gifv` - a gifv embed\n * * `article` - an article embed\n * * `link` - a link embed\n * @type {string}\n */\n this.type = data.type;\n\n /**\n * The title of this embed\n * @type {?string}\n */\n this.title = data.title;\n\n /**\n * The description of this embed\n * @type {?string}\n */\n this.description = data.description;\n\n /**\n * The URL of this embed\n * @type {?string}\n */\n this.url = data.url;\n\n /**\n * The color of this embed\n * @type {?number}\n */\n this.color = Util.resolveColor(data.color);\n\n /**\n * The timestamp of this embed\n * @type {?number}\n */\n this.timestamp = data.timestamp ? new Date(data.timestamp).getTime() : null;\n\n /**\n * Represents a field of a MessageEmbed\n * @typedef {Object} EmbedField\n * @property {string} name The name of this field\n * @property {string} value The value of this field\n * @property {boolean} inline If this field will be displayed inline\n */\n\n /**\n * The fields of this embed\n * @type {EmbedField[]}\n */\n this.fields = [];\n if (data.fields) {\n this.fields = skipValidation ? data.fields.map(Util.cloneObject) : this.constructor.normalizeFields(data.fields);\n }\n\n /**\n * Represents the thumbnail of a MessageEmbed\n * @typedef {Object} MessageEmbedThumbnail\n * @property {string} url URL for this thumbnail\n * @property {string} proxyURL ProxyURL for this thumbnail\n * @property {number} height Height of this thumbnail\n * @property {number} width Width of this thumbnail\n */\n\n /**\n * The thumbnail of this embed (if there is one)\n * @type {?MessageEmbedThumbnail}\n */\n this.thumbnail = data.thumbnail\n ? {\n url: data.thumbnail.url,\n proxyURL: data.thumbnail.proxyURL || data.thumbnail.proxy_url,\n height: data.thumbnail.height,\n width: data.thumbnail.width,\n }\n : null;\n\n /**\n * Represents the image of a MessageEmbed\n * @typedef {Object} MessageEmbedImage\n * @property {string} url URL for this image\n * @property {string} proxyURL ProxyURL for this image\n * @property {number} height Height of this image\n * @property {number} width Width of this image\n */\n\n /**\n * The image of this embed, if there is one\n * @type {?MessageEmbedImage}\n */\n this.image = data.image\n ? {\n url: data.image.url,\n proxyURL: data.image.proxyURL || data.image.proxy_url,\n height: data.image.height,\n width: data.image.width,\n }\n : null;\n\n /**\n * Represents the video of a MessageEmbed\n * @typedef {Object} MessageEmbedVideo\n * @property {string} url URL of this video\n * @property {string} proxyURL ProxyURL for this video\n * @property {number} height Height of this video\n * @property {number} width Width of this video\n */\n\n /**\n * The video of this embed (if there is one)\n * @type {?MessageEmbedVideo}\n * @readonly\n */\n this.video = data.video\n ? {\n url: data.video.url,\n proxyURL: data.video.proxyURL || data.video.proxy_url,\n height: data.video.height,\n width: data.video.width,\n }\n : null;\n\n /**\n * Represents the author field of a MessageEmbed\n * @typedef {Object} MessageEmbedAuthor\n * @property {string} name The name of this author\n * @property {string} url URL of this author\n * @property {string} iconURL URL of the icon for this author\n * @property {string} proxyIconURL Proxied URL of the icon for this author\n */\n\n /**\n * The author of this embed (if there is one)\n * @type {?MessageEmbedAuthor}\n */\n this.author = data.author\n ? {\n name: data.author.name,\n url: data.author.url,\n iconURL: data.author.iconURL || data.author.icon_url,\n proxyIconURL: data.author.proxyIconURL || data.author.proxy_icon_url,\n }\n : null;\n\n /**\n * Represents the provider of a MessageEmbed\n * @typedef {Object} MessageEmbedProvider\n * @property {string} name The name of this provider\n * @property {string} url URL of this provider\n */\n\n /**\n * The provider of this embed (if there is one)\n * @type {?MessageEmbedProvider}\n */\n this.provider = data.provider\n ? {\n name: data.provider.name,\n url: data.provider.name,\n }\n : null;\n\n /**\n * Represents the footer field of a MessageEmbed\n * @typedef {Object} MessageEmbedFooter\n * @property {string} text The text of this footer\n * @property {string} iconURL URL of the icon for this footer\n * @property {string} proxyIconURL Proxied URL of the icon for this footer\n */\n\n /**\n * The footer of this embed\n * @type {?MessageEmbedFooter}\n */\n this.footer = data.footer\n ? {\n text: data.footer.text,\n iconURL: data.footer.iconURL || data.footer.icon_url,\n proxyIconURL: data.footer.proxyIconURL || data.footer.proxy_icon_url,\n }\n : null;\n\n /**\n * The files of this embed\n * @type {Array<FileOptions|string|MessageAttachment>}\n */\n this.files = data.files || [];\n }\n\n /**\n * The date displayed on this embed\n * @type {?Date}\n * @readonly\n */\n get createdAt() {\n return this.timestamp ? new Date(this.timestamp) : null;\n }\n\n /**\n * The hexadecimal version of the embed color, with a leading hash\n * @type {?string}\n * @readonly\n */\n get hexColor() {\n return this.color ? `#${this.color.toString(16).padStart(6, '0')}` : null;\n }\n\n /**\n * The accumulated length for the embed title, description, fields and footer text\n * @type {number}\n * @readonly\n */\n get length() {\n return (\n (this.title ? this.title.length : 0) +\n (this.description ? this.description.length : 0) +\n (this.fields.length >= 1\n ? this.fields.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0)\n : 0) +\n (this.footer ? this.footer.text.length : 0)\n );\n }\n\n /**\n * Adds a field to the embed (max 25).\n * @param {StringResolvable} name The name of this field\n * @param {StringResolvable} value The value of this field\n * @param {boolean} [inline=false] If this field will be displayed inline\n * @returns {MessageEmbed}\n */\n addField(name, value, inline) {\n return this.addFields({ name, value, inline });\n }\n\n /**\n * Adds fields to the embed (max 25).\n * @param {...EmbedFieldData|EmbedFieldData[]} fields The fields to add\n * @returns {MessageEmbed}\n */\n addFields(...fields) {\n this.fields.push(...this.constructor.normalizeFields(fields));\n return this;\n }\n\n /**\n * Removes, replaces, and inserts fields in the embed (max 25).\n * @param {number} index The index to start at\n * @param {number} deleteCount The number of fields to remove\n * @param {...EmbedFieldData|EmbedFieldData[]} [fields] The replacing field objects\n * @returns {MessageEmbed}\n */\n spliceFields(index, deleteCount, ...fields) {\n this.fields.splice(index, deleteCount, ...this.constructor.normalizeFields(...fields));\n return this;\n }\n\n /**\n * Sets the file to upload alongside the embed. This file can be accessed via `attachment://fileName.extension` when\n * setting an embed image or author/footer icons. Multiple files can be attached.\n * @param {Array<FileOptions|string|MessageAttachment>} files Files to attach\n * @returns {MessageEmbed}\n */\n attachFiles(files) {\n this.files = this.files.concat(files);\n return this;\n }\n\n /**\n * Sets the author of this embed.\n * @param {StringResolvable} name The name of the author\n * @param {string} [iconURL] The icon URL of the author\n * @param {string} [url] The URL of the author\n * @returns {MessageEmbed}\n */\n setAuthor(name, iconURL, url) {\n this.author = { name: Util.resolveString(name), iconURL, url };\n return this;\n }\n\n /**\n * Sets the color of this embed.\n * @param {ColorResolvable} color The color of the embed\n * @returns {MessageEmbed}\n */\n setColor(color) {\n this.color = Util.resolveColor(color);\n return this;\n }\n\n /**\n * Sets the description of this embed.\n * @param {StringResolvable} description The description\n * @returns {MessageEmbed}\n */\n setDescription(description) {\n description = Util.resolveString(description);\n this.description = description;\n return this;\n }\n\n /**\n * Sets the footer of this embed.\n * @param {StringResolvable} text The text of the footer\n * @param {string} [iconURL] The icon URL of the footer\n * @returns {MessageEmbed}\n */\n setFooter(text, iconURL) {\n text = Util.resolveString(text);\n this.footer = { text, iconURL, proxyIconURL: undefined };\n return this;\n }\n\n /**\n * Sets the image of this embed.\n * @param {string} url The URL of the image\n * @returns {MessageEmbed}\n */\n setImage(url) {\n this.image = { url };\n return this;\n }\n\n /**\n * Sets the thumbnail of this embed.\n * @param {string} url The URL of the thumbnail\n * @returns {MessageEmbed}\n */\n setThumbnail(url) {\n this.thumbnail = { url };\n return this;\n }\n\n /**\n * Sets the timestamp of this embed.\n * @param {Date|number} [timestamp=Date.now()] The timestamp or date\n * @returns {MessageEmbed}\n */\n setTimestamp(timestamp = Date.now()) {\n if (timestamp instanceof Date) timestamp = timestamp.getTime();\n this.timestamp = timestamp;\n return this;\n }\n\n /**\n * Sets the title of this embed.\n * @param {StringResolvable} title The title\n * @returns {MessageEmbed}\n */\n setTitle(title) {\n title = Util.resolveString(title);\n this.title = title;\n return this;\n }\n\n /**\n * Sets the URL of this embed.\n * @param {string} url The URL\n * @returns {MessageEmbed}\n */\n setURL(url) {\n this.url = url;\n return this;\n }\n\n /**\n * Transforms the embed to a plain object.\n * @returns {Object} The raw data of this embed\n */\n toJSON() {\n return {\n title: this.title,\n type: 'rich',\n description: this.description,\n url: this.url,\n timestamp: this.timestamp ? new Date(this.timestamp) : null,\n color: this.color,\n fields: this.fields,\n thumbnail: this.thumbnail,\n image: this.image,\n author: this.author\n ? {\n name: this.author.name,\n url: this.author.url,\n icon_url: this.author.iconURL,\n }\n : null,\n footer: this.footer\n ? {\n text: this.footer.text,\n icon_url: this.footer.iconURL,\n }\n : null,\n };\n }\n\n /**\n * Normalizes field input and resolves strings.\n * @param {StringResolvable} name The name of the field\n * @param {StringResolvable} value The value of the field\n * @param {boolean} [inline=false] Set the field to display inline\n * @returns {EmbedField}\n */\n static normalizeField(name, value, inline = false) {\n name = Util.resolveString(name);\n if (!name) throw new RangeError('EMBED_FIELD_NAME');\n value = Util.resolveString(value);\n if (!value) throw new RangeError('EMBED_FIELD_VALUE');\n return { name, value, inline };\n }\n\n /**\n * @typedef {Object} EmbedFieldData\n * @property {StringResolvable} name The name of this field\n * @property {StringResolvable} value The value of this field\n * @property {boolean} [inline] If this field will be displayed inline\n */\n\n /**\n * Normalizes field input and resolves strings.\n * @param {...EmbedFieldData|EmbedFieldData[]} fields Fields to normalize\n * @returns {EmbedField[]}\n */\n static normalizeFields(...fields) {\n return fields\n .flat(2)\n .map(field =>\n this.normalizeField(\n field && field.name,\n field && field.value,\n field && typeof field.inline === 'boolean' ? field.inline : false,\n ),\n );\n }\n}\n\nmodule.exports = MessageEmbed;\n\n\n//# sourceURL=webpack://Discord/./src/structures/MessageEmbed.js?")},"./src/structures/MessageMentions.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst { ChannelTypes } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Keeps track of mentions in a {@link Message}.\n */\nclass MessageMentions {\n constructor(message, users, roles, everyone, crosspostedChannels) {\n /**\n * The client the message is from\n * @type {Client}\n * @readonly\n */\n Object.defineProperty(this, 'client', { value: message.client });\n\n /**\n * The guild the message is in\n * @type {?Guild}\n * @readonly\n */\n Object.defineProperty(this, 'guild', { value: message.guild });\n\n /**\n * The initial message content\n * @type {string}\n * @readonly\n * @private\n */\n Object.defineProperty(this, '_content', { value: message.content });\n\n /**\n * Whether `@everyone` or `@here` were mentioned\n * @type {boolean}\n */\n this.everyone = Boolean(everyone);\n\n if (users) {\n if (users instanceof Collection) {\n /**\n * Any users that were mentioned\n * <info>Order as received from the API, not as they appear in the message content</info>\n * @type {Collection<Snowflake, User>}\n */\n this.users = new Collection(users);\n } else {\n this.users = new Collection();\n for (const mention of users) {\n if (mention.member && message.guild) {\n message.guild.members.add(Object.assign(mention.member, { user: mention }));\n }\n const user = message.client.users.add(mention);\n this.users.set(user.id, user);\n }\n }\n } else {\n this.users = new Collection();\n }\n\n if (roles) {\n if (roles instanceof Collection) {\n /**\n * Any roles that were mentioned\n * <info>Order as received from the API, not as they appear in the message content</info>\n * @type {Collection<Snowflake, Role>}\n */\n this.roles = new Collection(roles);\n } else {\n this.roles = new Collection();\n for (const mention of roles) {\n const role = message.channel.guild.roles.cache.get(mention);\n if (role) this.roles.set(role.id, role);\n }\n }\n } else {\n this.roles = new Collection();\n }\n\n /**\n * Cached members for {@link MessageMentions#members}\n * @type {?Collection<Snowflake, GuildMember>}\n * @private\n */\n this._members = null;\n\n /**\n * Cached channels for {@link MessageMentions#channels}\n * @type {?Collection<Snowflake, GuildChannel>}\n * @private\n */\n this._channels = null;\n\n /**\n * Crossposted channel data.\n * @typedef {Object} CrosspostedChannel\n * @property {string} channelID ID of the mentioned channel\n * @property {string} guildID ID of the guild that has the channel\n * @property {string} type Type of the channel\n * @property {string} name The name of the channel\n */\n\n if (crosspostedChannels) {\n if (crosspostedChannels instanceof Collection) {\n /**\n * A collection of crossposted channels\n * <info>Order as received from the API, not as they appear in the message content</info>\n * @type {Collection<Snowflake, CrosspostedChannel>}\n */\n this.crosspostedChannels = new Collection(crosspostedChannels);\n } else {\n this.crosspostedChannels = new Collection();\n const channelTypes = Object.keys(ChannelTypes);\n for (const d of crosspostedChannels) {\n const type = channelTypes[d.type];\n this.crosspostedChannels.set(d.id, {\n channelID: d.id,\n guildID: d.guild_id,\n type: type ? type.toLowerCase() : 'unknown',\n name: d.name,\n });\n }\n }\n } else {\n this.crosspostedChannels = new Collection();\n }\n }\n\n /**\n * Any members that were mentioned (only in {@link TextChannel}s)\n * <info>Order as received from the API, not as they appear in the message content</info>\n * @type {?Collection<Snowflake, GuildMember>}\n * @readonly\n */\n get members() {\n if (this._members) return this._members;\n if (!this.guild) return null;\n this._members = new Collection();\n this.users.forEach(user => {\n const member = this.guild.member(user);\n if (member) this._members.set(member.user.id, member);\n });\n return this._members;\n }\n\n /**\n * Any channels that were mentioned\n * <info>Order as they appear first in the message content</info>\n * @type {Collection<Snowflake, GuildChannel>}\n * @readonly\n */\n get channels() {\n if (this._channels) return this._channels;\n this._channels = new Collection();\n let matches;\n while ((matches = this.constructor.CHANNELS_PATTERN.exec(this._content)) !== null) {\n const chan = this.client.channels.cache.get(matches[1]);\n if (chan) this._channels.set(chan.id, chan);\n }\n return this._channels;\n }\n\n /**\n * Checks if a user, guild member, role, or channel is mentioned.\n * Takes into account user mentions, role mentions, and @everyone/@here mentions.\n * @param {UserResolvable|RoleResolvable|GuildChannelResolvable} data User/Role/Channel to check\n * @param {Object} [options] Options\n * @param {boolean} [options.ignoreDirect=false] - Whether to ignore direct mentions to the item\n * @param {boolean} [options.ignoreRoles=false] - Whether to ignore role mentions to a guild member\n * @param {boolean} [options.ignoreEveryone=false] - Whether to ignore everyone/here mentions\n * @returns {boolean}\n */\n has(data, { ignoreDirect = false, ignoreRoles = false, ignoreEveryone = false } = {}) {\n if (!ignoreEveryone && this.everyone) return true;\n const GuildMember = __webpack_require__(/*! ./GuildMember */ \"./src/structures/GuildMember.js\");\n if (!ignoreRoles && data instanceof GuildMember) {\n for (const role of this.roles.values()) if (data.roles.cache.has(role.id)) return true;\n }\n\n if (!ignoreDirect) {\n const id =\n this.client.users.resolveID(data) ||\n (this.guild && this.guild.roles.resolveID(data)) ||\n this.client.channels.resolveID(data);\n\n return this.users.has(id) || this.channels.has(id) || this.roles.has(id);\n }\n\n return false;\n }\n\n toJSON() {\n return Util.flatten(this, {\n members: true,\n channels: true,\n });\n }\n}\n\n/**\n * Regular expression that globally matches `@everyone` and `@here`\n * @type {RegExp}\n */\nMessageMentions.EVERYONE_PATTERN = /@(everyone|here)/g;\n\n/**\n * Regular expression that globally matches user mentions like `<@81440962496172032>`\n * @type {RegExp}\n */\nMessageMentions.USERS_PATTERN = /<@!?(\\d{17,19})>/g;\n\n/**\n * Regular expression that globally matches role mentions like `<@&297577916114403338>`\n * @type {RegExp}\n */\nMessageMentions.ROLES_PATTERN = /<@&(\\d{17,19})>/g;\n\n/**\n * Regular expression that globally matches channel mentions like `<#222079895583457280>`\n * @type {RegExp}\n */\nMessageMentions.CHANNELS_PATTERN = /<#(\\d{17,19})>/g;\n\nmodule.exports = MessageMentions;\n\n\n//# sourceURL=webpack://Discord/./src/structures/MessageMentions.js?")},"./src/structures/MessageReaction.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst GuildEmoji = __webpack_require__(/*! ./GuildEmoji */ "./src/structures/GuildEmoji.js");\nconst ReactionEmoji = __webpack_require__(/*! ./ReactionEmoji */ "./src/structures/ReactionEmoji.js");\nconst ReactionUserManager = __webpack_require__(/*! ../managers/ReactionUserManager */ "./src/managers/ReactionUserManager.js");\nconst Util = __webpack_require__(/*! ../util/Util */ "./src/util/Util.js");\n\n/**\n * Represents a reaction to a message.\n */\nclass MessageReaction {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} data The data for the message reaction\n * @param {Message} message The message the reaction refers to\n */\n constructor(client, data, message) {\n /**\n * The client that instantiated this message reaction\n * @name MessageReaction#client\n * @type {Client}\n * @readonly\n */\n Object.defineProperty(this, \'client\', { value: client });\n /**\n * The message that this reaction refers to\n * @type {Message}\n */\n this.message = message;\n\n /**\n * Whether the client has given this reaction\n * @type {boolean}\n */\n this.me = data.me;\n\n /**\n * A manager of the users that have given this reaction\n * @type {ReactionUserManager}\n */\n this.users = new ReactionUserManager(client, undefined, this);\n\n this._emoji = new ReactionEmoji(this, data.emoji);\n\n this._patch(data);\n }\n\n _patch(data) {\n /**\n * The number of people that have given the same reaction\n * @type {?number}\n * @name MessageReaction#count\n */\n // eslint-disable-next-line eqeqeq\n if (this.count == undefined) this.count = data.count;\n }\n\n /**\n * Removes all users from this reaction.\n * @returns {Promise<MessageReaction>}\n */\n async remove() {\n await this.client.api\n .channels(this.message.channel.id)\n .messages(this.message.id)\n .reactions(this._emoji.identifier)\n .delete();\n return this;\n }\n\n /**\n * The emoji of this reaction, either an GuildEmoji object for known custom emojis, or a ReactionEmoji\n * object which has fewer properties. Whatever the prototype of the emoji, it will still have\n * `name`, `id`, `identifier` and `toString()`\n * @type {GuildEmoji|ReactionEmoji}\n * @readonly\n */\n get emoji() {\n if (this._emoji instanceof GuildEmoji) return this._emoji;\n // Check to see if the emoji has become known to the client\n if (this._emoji.id) {\n const emojis = this.message.client.emojis.cache;\n if (emojis.has(this._emoji.id)) {\n const emoji = emojis.get(this._emoji.id);\n this._emoji = emoji;\n return emoji;\n }\n }\n return this._emoji;\n }\n\n /**\n * Whether or not this reaction is a partial\n * @type {boolean}\n * @readonly\n */\n get partial() {\n return this.count === null;\n }\n\n /**\n * Fetch this reaction.\n * @returns {Promise<MessageReaction>}\n */\n async fetch() {\n const message = await this.message.fetch();\n const existing = message.reactions.cache.get(this.emoji.id || this.emoji.name);\n // The reaction won\'t get set when it has been completely removed\n this._patch(existing || { count: 0 });\n return this;\n }\n\n toJSON() {\n return Util.flatten(this, { emoji: \'emojiID\', message: \'messageID\' });\n }\n\n _add(user) {\n if (this.partial) return;\n this.users.cache.set(user.id, user);\n if (!this.me || user.id !== this.message.client.user.id || this.count === 0) this.count++;\n if (!this.me) this.me = user.id === this.message.client.user.id;\n }\n\n _remove(user) {\n if (this.partial) return;\n this.users.cache.delete(user.id);\n if (!this.me || user.id !== this.message.client.user.id) this.count--;\n if (user.id === this.message.client.user.id) this.me = false;\n if (this.count <= 0 && this.users.cache.size === 0) {\n this.message.reactions.cache.delete(this.emoji.id || this.emoji.name);\n }\n }\n}\n\nmodule.exports = MessageReaction;\n\n\n//# sourceURL=webpack://Discord/./src/structures/MessageReaction.js?')},"./src/structures/NewsChannel.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst TextChannel = __webpack_require__(/*! ./TextChannel */ "./src/structures/TextChannel.js");\n\n/**\n * Represents a guild news channel on Discord.\n * @extends {TextChannel}\n */\nclass NewsChannel extends TextChannel {\n _patch(data) {\n super._patch(data);\n\n // News channels don\'t have a rate limit per user, remove it\n this.rateLimitPerUser = undefined;\n }\n}\n\nmodule.exports = NewsChannel;\n\n\n//# sourceURL=webpack://Discord/./src/structures/NewsChannel.js?')},"./src/structures/PartialGroupDMChannel.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Channel = __webpack_require__(/*! ./Channel */ \"./src/structures/Channel.js\");\nconst { Error } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\n\n/**\n * Represents a Partial Group DM Channel on Discord.\n * @extends {Channel}\n */\nclass PartialGroupDMChannel extends Channel {\n constructor(client, data) {\n super(client, data);\n\n /**\n * The name of this Group DM Channel\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The hash of the channel icon\n * @type {?string}\n */\n this.icon = data.icon;\n }\n\n /**\n * The URL to this channel's icon.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n iconURL({ format, size } = {}) {\n if (!this.icon) return null;\n return this.client.rest.cdn.GDMIcon(this.id, this.icon, format, size);\n }\n\n delete() {\n return Promise.reject(new Error('DELETE_GROUP_DM_CHANNEL'));\n }\n\n fetch() {\n return Promise.reject(new Error('FETCH_GROUP_DM_CHANNEL'));\n }\n}\n\nmodule.exports = PartialGroupDMChannel;\n\n\n//# sourceURL=webpack://Discord/./src/structures/PartialGroupDMChannel.js?")},"./src/structures/PermissionOverwrites.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Role = __webpack_require__(/*! ./Role */ \"./src/structures/Role.js\");\nconst { TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Represents a permission overwrite for a role or member in a guild channel.\n */\nclass PermissionOverwrites {\n constructor(guildChannel, data) {\n /**\n * The GuildChannel this overwrite is for\n * @name PermissionOverwrites#channel\n * @type {GuildChannel}\n * @readonly\n */\n Object.defineProperty(this, 'channel', { value: guildChannel });\n\n if (data) this._patch(data);\n }\n\n _patch(data) {\n /**\n * The ID of this overwrite, either a user ID or a role ID\n * @type {Snowflake}\n */\n this.id = data.id;\n\n /**\n * The type of a permission overwrite. It can be one of:\n * * member\n * * role\n * @typedef {string} OverwriteType\n */\n\n /**\n * The type of this overwrite\n * @type {OverwriteType}\n */\n this.type = data.type;\n\n /**\n * The permissions that are denied for the user or role.\n * @type {Readonly<Permissions>}\n */\n this.deny = new Permissions(data.deny).freeze();\n\n /**\n * The permissions that are allowed for the user or role.\n * @type {Readonly<Permissions>}\n */\n this.allow = new Permissions(data.allow).freeze();\n }\n\n /**\n * Updates this permissionOverwrites.\n * @param {PermissionOverwriteOptions} options The options for the update\n * @param {string} [reason] Reason for creating/editing this overwrite\n * @returns {Promise<PermissionOverwrites>}\n * @example\n * // Update permission overwrites\n * permissionOverwrites.update({\n * SEND_MESSAGES: false\n * })\n * .then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))\n * .catch(console.error);\n */\n update(options, reason) {\n const { allow, deny } = this.constructor.resolveOverwriteOptions(options, this);\n\n return this.channel.client.api\n .channels(this.channel.id)\n .permissions[this.id].put({\n data: { id: this.id, type: this.type, allow: allow.bitfield, deny: deny.bitfield },\n reason,\n })\n .then(() => this);\n }\n\n /**\n * Deletes this Permission Overwrite.\n * @param {string} [reason] Reason for deleting this overwrite\n * @returns {Promise<PermissionOverwrites>}\n */\n delete(reason) {\n return this.channel.client.api.channels[this.channel.id].permissions[this.id].delete({ reason }).then(() => this);\n }\n\n toJSON() {\n return Util.flatten(this);\n }\n\n /**\n * An object mapping permission flags to `true` (enabled), `null` (unset) or `false` (disabled).\n * ```js\n * {\n * 'SEND_MESSAGES': true,\n * 'EMBED_LINKS': null,\n * 'ATTACH_FILES': false,\n * }\n * ```\n * @typedef {Object} PermissionOverwriteOptions\n */\n\n /**\n * @typedef {object} ResolvedOverwriteOptions\n * @property {Permissions} allow The allowed permissions\n * @property {Permissions} deny The denied permissions\n */\n\n /**\n * Resolves bitfield permissions overwrites from an object.\n * @param {PermissionOverwriteOptions} options The options for the update\n * @param {Object} initialPermissions The initial permissions\n * @param {PermissionResolvable} initialPermissions.allow Initial allowed permissions\n * @param {PermissionResolvable} initialPermissions.deny Initial denied permissions\n * @returns {ResolvedOverwriteOptions}\n */\n static resolveOverwriteOptions(options, { allow, deny } = {}) {\n allow = new Permissions(allow);\n deny = new Permissions(deny);\n\n for (const [perm, value] of Object.entries(options)) {\n if (value === true) {\n allow.add(Permissions.FLAGS[perm]);\n deny.remove(Permissions.FLAGS[perm]);\n } else if (value === false) {\n allow.remove(Permissions.FLAGS[perm]);\n deny.add(Permissions.FLAGS[perm]);\n } else if (value === null) {\n allow.remove(Permissions.FLAGS[perm]);\n deny.remove(Permissions.FLAGS[perm]);\n }\n }\n\n return { allow, deny };\n }\n\n /**\n * The raw data for a permission overwrite\n * @typedef {Object} RawOverwriteData\n * @property {Snowflake} id The id of the overwrite\n * @property {number} allow The permissions to allow\n * @property {number} deny The permissions to deny\n * @property {OverwriteType} type The type of this OverwriteData\n */\n\n /**\n * Data that can be resolved into {@link RawOverwriteData}\n * @typedef {PermissionOverwrites|OverwriteData} OverwriteResolvable\n */\n\n /**\n * Data that can be used for a permission overwrite\n * @typedef {Object} OverwriteData\n * @property {GuildMemberResolvable|RoleResolvable} id Member or role this overwrite is for\n * @property {PermissionResolvable} [allow] The permissions to allow\n * @property {PermissionResolvable} [deny] The permissions to deny\n * @property {OverwriteType} [type] The type of this OverwriteData\n */\n\n /**\n * Resolves an overwrite into {@link RawOverwriteData}.\n * @param {OverwriteResolvable} overwrite The overwrite-like data to resolve\n * @param {Guild} guild The guild to resolve from\n * @returns {RawOverwriteData}\n */\n static resolve(overwrite, guild) {\n if (overwrite instanceof this) return overwrite.toJSON();\n if (typeof overwrite.id === 'string' && ['role', 'member'].includes(overwrite.type)) {\n return { ...overwrite, allow: Permissions.resolve(overwrite.allow), deny: Permissions.resolve(overwrite.deny) };\n }\n\n const userOrRole = guild.roles.resolve(overwrite.id) || guild.client.users.resolve(overwrite.id);\n if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');\n const type = userOrRole instanceof Role ? 'role' : 'member';\n\n return {\n id: userOrRole.id,\n type,\n allow: Permissions.resolve(overwrite.allow),\n deny: Permissions.resolve(overwrite.deny),\n };\n }\n}\n\nmodule.exports = PermissionOverwrites;\n\n\n//# sourceURL=webpack://Discord/./src/structures/PermissionOverwrites.js?")},"./src/structures/Presence.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Emoji = __webpack_require__(/*! ./Emoji */ \"./src/structures/Emoji.js\");\nconst ActivityFlags = __webpack_require__(/*! ../util/ActivityFlags */ \"./src/util/ActivityFlags.js\");\nconst { ActivityTypes } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Activity sent in a message.\n * @typedef {Object} MessageActivity\n * @property {string} [partyID] Id of the party represented in activity\n * @property {number} [type] Type of activity sent\n */\n\n/**\n * The status of this presence:\n * * **`online`** - user is online\n * * **`idle`** - user is AFK\n * * **`offline`** - user is offline or invisible\n * * **`dnd`** - user is in Do Not Disturb\n * @typedef {string} PresenceStatus\n */\n\n/**\n * The status of this presence:\n * * **`online`** - user is online\n * * **`idle`** - user is AFK\n * * **`dnd`** - user is in Do Not Disturb\n * @typedef {string} ClientPresenceStatus\n */\n\n/**\n * Represents a user's presence.\n */\nclass Presence {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} [data={}] The data for the presence\n */\n constructor(client, data = {}) {\n /**\n * The client that instantiated this\n * @name Presence#client\n * @type {Client}\n * @readonly\n */\n Object.defineProperty(this, 'client', { value: client });\n /**\n * The user ID of this presence\n * @type {Snowflake}\n */\n this.userID = data.user.id;\n\n /**\n * The guild of this presence\n * @type {?Guild}\n */\n this.guild = data.guild || null;\n\n this.patch(data);\n }\n\n /**\n * The user of this presence\n * @type {?User}\n * @readonly\n */\n get user() {\n return this.client.users.cache.get(this.userID) || null;\n }\n\n /**\n * The member of this presence\n * @type {?GuildMember}\n * @readonly\n */\n get member() {\n return this.guild.members.cache.get(this.userID) || null;\n }\n\n patch(data) {\n /**\n * The status of this presence\n * @type {PresenceStatus}\n */\n this.status = data.status || this.status || 'offline';\n\n if (data.activities) {\n /**\n * The activities of this presence\n * @type {Activity[]}\n */\n this.activities = data.activities.map(activity => new Activity(this, activity));\n } else if (data.activity || data.game) {\n this.activities = [new Activity(this, data.game || data.activity)];\n } else {\n this.activities = [];\n }\n\n /**\n * The devices this presence is on\n * @type {?Object}\n * @property {?ClientPresenceStatus} web The current presence in the web application\n * @property {?ClientPresenceStatus} mobile The current presence in the mobile application\n * @property {?ClientPresenceStatus} desktop The current presence in the desktop application\n */\n this.clientStatus = data.client_status || null;\n\n return this;\n }\n\n _clone() {\n const clone = Object.assign(Object.create(this), this);\n if (this.activities) clone.activities = this.activities.map(activity => activity._clone());\n return clone;\n }\n\n /**\n * Whether this presence is equal to another.\n * @param {Presence} presence The presence to compare with\n * @returns {boolean}\n */\n equals(presence) {\n return (\n this === presence ||\n (presence &&\n this.status === presence.status &&\n this.activities.length === presence.activities.length &&\n this.activities.every((activity, index) => activity.equals(presence.activities[index])) &&\n this.clientStatus.web === presence.clientStatus.web &&\n this.clientStatus.mobile === presence.clientStatus.mobile &&\n this.clientStatus.desktop === presence.clientStatus.desktop)\n );\n }\n\n toJSON() {\n return Util.flatten(this);\n }\n}\n\n/**\n * Represents an activity that is part of a user's presence.\n */\nclass Activity {\n constructor(presence, data) {\n Object.defineProperty(this, 'presence', { value: presence });\n\n /**\n * The name of the activity being played\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The type of the activity status\n * @type {ActivityType}\n */\n this.type = ActivityTypes[data.type];\n\n /**\n * If the activity is being streamed, a link to the stream\n * @type {?string}\n */\n this.url = data.url || null;\n\n /**\n * Details about the activity\n * @type {?string}\n */\n this.details = data.details || null;\n\n /**\n * State of the activity\n * @type {?string}\n */\n this.state = data.state || null;\n\n /**\n * Application ID associated with this activity\n * @type {?Snowflake}\n */\n this.applicationID = data.application_id || null;\n\n /**\n * Timestamps for the activity\n * @type {?Object}\n * @prop {?Date} start When the activity started\n * @prop {?Date} end When the activity will end\n */\n this.timestamps = data.timestamps\n ? {\n start: data.timestamps.start ? new Date(Number(data.timestamps.start)) : null,\n end: data.timestamps.end ? new Date(Number(data.timestamps.end)) : null,\n }\n : null;\n\n /**\n * Party of the activity\n * @type {?Object}\n * @prop {?string} id ID of the party\n * @prop {number[]} size Size of the party as `[current, max]`\n */\n this.party = data.party || null;\n\n /**\n * Assets for rich presence\n * @type {?RichPresenceAssets}\n */\n this.assets = data.assets ? new RichPresenceAssets(this, data.assets) : null;\n\n this.syncID = data.sync_id;\n\n /**\n * Flags that describe the activity\n * @type {Readonly<ActivityFlags>}\n */\n this.flags = new ActivityFlags(data.flags).freeze();\n\n /**\n * Emoji for a custom activity\n * @type {?Emoji}\n */\n this.emoji = data.emoji ? new Emoji(presence.client, data.emoji) : null;\n\n /**\n * Creation date of the activity\n * @type {number}\n */\n this.createdTimestamp = new Date(data.created_at).getTime();\n }\n\n /**\n * Whether this activity is equal to another activity.\n * @param {Activity} activity The activity to compare with\n * @returns {boolean}\n */\n equals(activity) {\n return (\n this === activity ||\n (activity && this.name === activity.name && this.type === activity.type && this.url === activity.url)\n );\n }\n\n /**\n * The time the activity was created at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n /**\n * When concatenated with a string, this automatically returns the activities' name instead of the Activity object.\n * @returns {string}\n */\n toString() {\n return this.name;\n }\n\n _clone() {\n return Object.assign(Object.create(this), this);\n }\n}\n\n/**\n * Assets for a rich presence\n */\nclass RichPresenceAssets {\n constructor(activity, assets) {\n Object.defineProperty(this, 'activity', { value: activity });\n\n /**\n * Hover text for the large image\n * @type {?string}\n */\n this.largeText = assets.large_text || null;\n\n /**\n * Hover text for the small image\n * @type {?string}\n */\n this.smallText = assets.small_text || null;\n\n /**\n * ID of the large image asset\n * @type {?Snowflake}\n */\n this.largeImage = assets.large_image || null;\n\n /**\n * ID of the small image asset\n * @type {?Snowflake}\n */\n this.smallImage = assets.small_image || null;\n }\n\n /**\n * Gets the URL of the small image asset\n * @param {Object} [options] Options for the image url\n * @param {string} [options.format] Format of the image\n * @param {number} [options.size] Size of the image\n * @returns {?string} The small image URL\n */\n smallImageURL({ format, size } = {}) {\n if (!this.smallImage) return null;\n return this.activity.presence.client.rest.cdn.AppAsset(this.activity.applicationID, this.smallImage, {\n format,\n size,\n });\n }\n\n /**\n * Gets the URL of the large image asset\n * @param {Object} [options] Options for the image url\n * @param {string} [options.format] Format of the image\n * @param {number} [options.size] Size of the image\n * @returns {?string} The large image URL\n */\n largeImageURL({ format, size } = {}) {\n if (!this.largeImage) return null;\n if (/^spotify:/.test(this.largeImage)) {\n return `https://i.scdn.co/image/${this.largeImage.slice(8)}`;\n } else if (/^twitch:/.test(this.largeImage)) {\n return `https://static-cdn.jtvnw.net/previews-ttv/live_user_${this.largeImage.slice(7)}.png`;\n }\n return this.activity.presence.client.rest.cdn.AppAsset(this.activity.applicationID, this.largeImage, {\n format,\n size,\n });\n }\n}\n\nexports.Presence = Presence;\nexports.Activity = Activity;\nexports.RichPresenceAssets = RichPresenceAssets;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Presence.js?")},"./src/structures/ReactionCollector.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Collector = __webpack_require__(/*! ./interfaces/Collector */ \"./src/structures/interfaces/Collector.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst { Events } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\n\n/**\n * @typedef {CollectorOptions} ReactionCollectorOptions\n * @property {number} max The maximum total amount of reactions to collect\n * @property {number} maxEmojis The maximum number of emojis to collect\n * @property {number} maxUsers The maximum number of users to react\n */\n\n/**\n * Collects reactions on messages.\n * Will automatically stop if the message (`'messageDelete'`),\n * channel (`'channelDelete'`), or guild (`'guildDelete'`) are deleted.\n * @extends {Collector}\n */\nclass ReactionCollector extends Collector {\n /**\n * @param {Message} message The message upon which to collect reactions\n * @param {CollectorFilter} filter The filter to apply to this collector\n * @param {ReactionCollectorOptions} [options={}] The options to apply to this collector\n */\n constructor(message, filter, options = {}) {\n super(message.client, filter, options);\n\n /**\n * The message upon which to collect reactions\n * @type {Message}\n */\n this.message = message;\n\n /**\n * The users which have reacted to this message\n * @type {Collection}\n */\n this.users = new Collection();\n\n /**\n * The total number of reactions collected\n * @type {number}\n */\n this.total = 0;\n\n this.empty = this.empty.bind(this);\n this._handleChannelDeletion = this._handleChannelDeletion.bind(this);\n this._handleGuildDeletion = this._handleGuildDeletion.bind(this);\n this._handleMessageDeletion = this._handleMessageDeletion.bind(this);\n\n this.client.incrementMaxListeners();\n this.client.on(Events.MESSAGE_REACTION_ADD, this.handleCollect);\n this.client.on(Events.MESSAGE_REACTION_REMOVE, this.handleDispose);\n this.client.on(Events.MESSAGE_REACTION_REMOVE_ALL, this.empty);\n this.client.on(Events.MESSAGE_DELETE, this._handleMessageDeletion);\n this.client.on(Events.CHANNEL_DELETE, this._handleChannelDeletion);\n this.client.on(Events.GUILD_DELETE, this._handleGuildDeletion);\n\n this.once('end', () => {\n this.client.removeListener(Events.MESSAGE_REACTION_ADD, this.handleCollect);\n this.client.removeListener(Events.MESSAGE_REACTION_REMOVE, this.handleDispose);\n this.client.removeListener(Events.MESSAGE_REACTION_REMOVE_ALL, this.empty);\n this.client.removeListener(Events.MESSAGE_DELETE, this._handleMessageDeletion);\n this.client.removeListener(Events.CHANNEL_DELETE, this._handleChannelDeletion);\n this.client.removeListener(Events.GUILD_DELETE, this._handleGuildDeletion);\n this.client.decrementMaxListeners();\n });\n\n this.on('collect', (reaction, user) => {\n this.total++;\n this.users.set(user.id, user);\n });\n\n this.on('remove', (reaction, user) => {\n this.total--;\n if (!this.collected.some(r => r.users.cache.has(user.id))) this.users.delete(user.id);\n });\n }\n\n /**\n * Handles an incoming reaction for possible collection.\n * @param {MessageReaction} reaction The reaction to possibly collect\n * @returns {?Snowflake|string}\n * @private\n */\n collect(reaction) {\n /**\n * Emitted whenever a reaction is collected.\n * @event ReactionCollector#collect\n * @param {MessageReaction} reaction The reaction that was collected\n * @param {User} user The user that added the reaction\n */\n if (reaction.message.id !== this.message.id) return null;\n return ReactionCollector.key(reaction);\n }\n\n /**\n * Handles a reaction deletion for possible disposal.\n * @param {MessageReaction} reaction The reaction to possibly dispose of\n * @param {User} user The user that removed the reaction\n * @returns {?Snowflake|string}\n */\n dispose(reaction, user) {\n /**\n * Emitted whenever a reaction is disposed of and the `dispose` option is set to true.\n * @event ReactionCollector#dispose\n * @param {MessageReaction} reaction The reaction that was disposed of\n * @param {User} user The user that removed the reaction\n */\n if (reaction.message.id !== this.message.id) return null;\n\n /**\n * Emitted whenever a reaction is removed from a message and the `dispose` option is set to true.\n * Will emit on all reaction removals, as opposed to {@link Collector#dispose} which will only\n * be emitted when the entire reaction is removed.\n * @event ReactionCollector#remove\n * @param {MessageReaction} reaction The reaction that was removed\n * @param {User} user The user that removed the reaction\n */\n if (this.collected.has(ReactionCollector.key(reaction)) && this.users.has(user.id)) {\n this.emit('remove', reaction, user);\n }\n return reaction.count ? null : ReactionCollector.key(reaction);\n }\n\n /**\n * Empties this reaction collector.\n */\n empty() {\n this.total = 0;\n this.collected.clear();\n this.users.clear();\n this.checkEnd();\n }\n\n endReason() {\n if (this.options.max && this.total >= this.options.max) return 'limit';\n if (this.options.maxEmojis && this.collected.size >= this.options.maxEmojis) return 'emojiLimit';\n if (this.options.maxUsers && this.users.size >= this.options.maxUsers) return 'userLimit';\n return null;\n }\n\n /**\n * Handles checking if the message has been deleted, and if so, stops the collector with the reason 'messageDelete'.\n * @private\n * @param {Message} message The message that was deleted\n * @returns {void}\n */\n _handleMessageDeletion(message) {\n if (message.id === this.message.id) {\n this.stop('messageDelete');\n }\n }\n\n /**\n * Handles checking if the channel has been deleted, and if so, stops the collector with the reason 'channelDelete'.\n * @private\n * @param {GuildChannel} channel The channel that was deleted\n * @returns {void}\n */\n _handleChannelDeletion(channel) {\n if (channel.id === this.message.channel.id) {\n this.stop('channelDelete');\n }\n }\n\n /**\n * Handles checking if the guild has been deleted, and if so, stops the collector with the reason 'guildDelete'.\n * @private\n * @param {Guild} guild The guild that was deleted\n * @returns {void}\n */\n _handleGuildDeletion(guild) {\n if (this.message.guild && guild.id === this.message.guild.id) {\n this.stop('guildDelete');\n }\n }\n\n /**\n * Gets the collector key for a reaction.\n * @param {MessageReaction} reaction The message reaction to get the key for\n * @returns {Snowflake|string}\n */\n static key(reaction) {\n return reaction.emoji.id || reaction.emoji.name;\n }\n}\n\nmodule.exports = ReactionCollector;\n\n\n//# sourceURL=webpack://Discord/./src/structures/ReactionCollector.js?")},"./src/structures/ReactionEmoji.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Emoji = __webpack_require__(/*! ./Emoji */ "./src/structures/Emoji.js");\nconst Util = __webpack_require__(/*! ../util/Util */ "./src/util/Util.js");\n\n/**\n * Represents a limited emoji set used for both custom and unicode emojis. Custom emojis\n * will use this class opposed to the Emoji class when the client doesn\'t know enough\n * information about them.\n * @extends {Emoji}\n */\nclass ReactionEmoji extends Emoji {\n constructor(reaction, emoji) {\n super(reaction.message.client, emoji);\n /**\n * The message reaction this emoji refers to\n * @type {MessageReaction}\n */\n this.reaction = reaction;\n }\n\n toJSON() {\n return Util.flatten(this, { identifier: true });\n }\n\n valueOf() {\n return this.id;\n }\n}\n\nmodule.exports = ReactionEmoji;\n\n\n//# sourceURL=webpack://Discord/./src/structures/ReactionEmoji.js?')},"./src/structures/Role.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst { Error, TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ \"./src/util/Permissions.js\");\nconst Snowflake = __webpack_require__(/*! ../util/Snowflake */ \"./src/util/Snowflake.js\");\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Represents a role on Discord.\n * @extends {Base}\n */\nclass Role extends Base {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} data The data for the role\n * @param {Guild} guild The guild the role is part of\n */\n constructor(client, data, guild) {\n super(client);\n\n /**\n * The guild that the role belongs to\n * @type {Guild}\n */\n this.guild = guild;\n\n if (data) this._patch(data);\n }\n\n _patch(data) {\n /**\n * The ID of the role (unique to the guild it is part of)\n * @type {Snowflake}\n */\n this.id = data.id;\n\n /**\n * The name of the role\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The base 10 color of the role\n * @type {number}\n */\n this.color = data.color;\n\n /**\n * If true, users that are part of this role will appear in a separate category in the users list\n * @type {boolean}\n */\n this.hoist = data.hoist;\n\n /**\n * The raw position of the role from the API\n * @type {number}\n */\n this.rawPosition = data.position;\n\n /**\n * The permissions of the role\n * @type {Readonly<Permissions>}\n */\n this.permissions = new Permissions(data.permissions).freeze();\n\n /**\n * Whether or not the role is managed by an external service\n * @type {boolean}\n */\n this.managed = data.managed;\n\n /**\n * Whether or not the role can be mentioned by anyone\n * @type {boolean}\n */\n this.mentionable = data.mentionable;\n\n /**\n * Whether the role has been deleted\n * @type {boolean}\n */\n this.deleted = false;\n }\n\n /**\n * The timestamp the role was created at\n * @type {number}\n * @readonly\n */\n get createdTimestamp() {\n return Snowflake.deconstruct(this.id).timestamp;\n }\n\n /**\n * The time the role was created at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n /**\n * The hexadecimal version of the role color, with a leading hashtag\n * @type {string}\n * @readonly\n */\n get hexColor() {\n return `#${this.color.toString(16).padStart(6, '0')}`;\n }\n\n /**\n * The cached guild members that have this role\n * @type {Collection<Snowflake, GuildMember>}\n * @readonly\n */\n get members() {\n return this.guild.members.cache.filter(m => m.roles.cache.has(this.id));\n }\n\n /**\n * Whether the role is editable by the client user\n * @type {boolean}\n * @readonly\n */\n get editable() {\n if (this.managed) return false;\n const clientMember = this.guild.member(this.client.user);\n if (!clientMember.permissions.has(Permissions.FLAGS.MANAGE_ROLES)) return false;\n return clientMember.roles.highest.comparePositionTo(this) > 0;\n }\n\n /**\n * The position of the role in the role manager\n * @type {number}\n * @readonly\n */\n get position() {\n const sorted = this.guild._sortedRoles();\n return sorted.array().indexOf(sorted.get(this.id));\n }\n\n /**\n * Compares this role's position to another role's.\n * @param {RoleResolvable} role Role to compare to this one\n * @returns {number} Negative number if this role's position is lower (other role's is higher),\n * positive number if this one is higher (other's is lower), 0 if equal\n */\n comparePositionTo(role) {\n role = this.guild.roles.resolve(role);\n if (!role) throw new TypeError('INVALID_TYPE', 'role', 'Role nor a Snowflake');\n return this.constructor.comparePositions(this, role);\n }\n\n /**\n * The data for a role.\n * @typedef {Object} RoleData\n * @property {string} [name] The name of the role\n * @property {ColorResolvable} [color] The color of the role, either a hex string or a base 10 number\n * @property {boolean} [hoist] Whether or not the role should be hoisted\n * @property {number} [position] The position of the role\n * @property {PermissionResolvable} [permissions] The permissions of the role\n * @property {boolean} [mentionable] Whether or not the role should be mentionable\n */\n\n /**\n * Edits the role.\n * @param {RoleData} data The new data for the role\n * @param {string} [reason] Reason for editing this role\n * @returns {Promise<Role>}\n * @example\n * // Edit a role\n * role.edit({ name: 'new role' })\n * .then(updated => console.log(`Edited role ${updated.name} name to ${updated.name}`))\n * .catch(console.error);\n */\n async edit(data, reason) {\n if (typeof data.permissions !== 'undefined') data.permissions = Permissions.resolve(data.permissions);\n else data.permissions = this.permissions.bitfield;\n if (typeof data.position !== 'undefined') {\n await Util.setPosition(\n this,\n data.position,\n false,\n this.guild._sortedRoles(),\n this.client.api.guilds(this.guild.id).roles,\n reason,\n ).then(updatedRoles => {\n this.client.actions.GuildRolesPositionUpdate.handle({\n guild_id: this.guild.id,\n roles: updatedRoles,\n });\n });\n }\n return this.client.api.guilds[this.guild.id].roles[this.id]\n .patch({\n data: {\n name: data.name || this.name,\n color: data.color !== null ? Util.resolveColor(data.color || this.color) : null,\n hoist: typeof data.hoist !== 'undefined' ? data.hoist : this.hoist,\n permissions: data.permissions,\n mentionable: typeof data.mentionable !== 'undefined' ? data.mentionable : this.mentionable,\n },\n reason,\n })\n .then(role => {\n const clone = this._clone();\n clone._patch(role);\n return clone;\n });\n }\n\n /**\n * Returns `channel.permissionsFor(role)`. Returns permissions for a role in a guild channel,\n * taking into account permission overwrites.\n * @param {ChannelResolvable} channel The guild channel to use as context\n * @returns {Readonly<Permissions>}\n */\n permissionsIn(channel) {\n channel = this.guild.channels.resolve(channel);\n if (!channel) throw new Error('GUILD_CHANNEL_RESOLVE');\n return channel.rolePermissions(this);\n }\n\n /**\n * Sets a new name for the role.\n * @param {string} name The new name of the role\n * @param {string} [reason] Reason for changing the role's name\n * @returns {Promise<Role>}\n * @example\n * // Set the name of the role\n * role.setName('new role')\n * .then(updated => console.log(`Edited name of role ${role.name} to ${updated.name}`))\n * .catch(console.error);\n */\n setName(name, reason) {\n return this.edit({ name }, reason);\n }\n\n /**\n * Sets a new color for the role.\n * @param {ColorResolvable} color The color of the role\n * @param {string} [reason] Reason for changing the role's color\n * @returns {Promise<Role>}\n * @example\n * // Set the color of a role\n * role.setColor('#FF0000')\n * .then(updated => console.log(`Set color of role to ${updated.color}`))\n * .catch(console.error);\n */\n setColor(color, reason) {\n return this.edit({ color }, reason);\n }\n\n /**\n * Sets whether or not the role should be hoisted.\n * @param {boolean} hoist Whether or not to hoist the role\n * @param {string} [reason] Reason for setting whether or not the role should be hoisted\n * @returns {Promise<Role>}\n * @example\n * // Set the hoist of the role\n * role.setHoist(true)\n * .then(r => console.log(`Role hoisted: ${r.hoist}`))\n * .catch(console.error);\n */\n setHoist(hoist, reason) {\n return this.edit({ hoist }, reason);\n }\n\n /**\n * Sets the permissions of the role.\n * @param {PermissionResolvable} permissions The permissions of the role\n * @param {string} [reason] Reason for changing the role's permissions\n * @returns {Promise<Role>}\n * @example\n * // Set the permissions of the role\n * role.setPermissions(['KICK_MEMBERS', 'BAN_MEMBERS'])\n * .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`))\n * .catch(console.error);\n * @example\n * // Remove all permissions from a role\n * role.setPermissions(0)\n * .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`))\n * .catch(console.error);\n */\n setPermissions(permissions, reason) {\n return this.edit({ permissions }, reason);\n }\n\n /**\n * Sets whether this role is mentionable.\n * @param {boolean} mentionable Whether this role should be mentionable\n * @param {string} [reason] Reason for setting whether or not this role should be mentionable\n * @returns {Promise<Role>}\n * @example\n * // Make the role mentionable\n * role.setMentionable(true)\n * .then(updated => console.log(`Role updated ${updated.name}`))\n * .catch(console.error);\n */\n setMentionable(mentionable, reason) {\n return this.edit({ mentionable }, reason);\n }\n\n /**\n * Sets the position of the role.\n * @param {number} position The position of the role\n * @param {Object} [options] Options for setting position\n * @param {boolean} [options.relative=false] Change the position relative to its current value\n * @param {string} [options.reason] Reason for changing the position\n * @returns {Promise<Role>}\n * @example\n * // Set the position of the role\n * role.setPosition(1)\n * .then(updated => console.log(`Role position: ${updated.position}`))\n * .catch(console.error);\n */\n setPosition(position, { relative, reason } = {}) {\n return Util.setPosition(\n this,\n position,\n relative,\n this.guild._sortedRoles(),\n this.client.api.guilds(this.guild.id).roles,\n reason,\n ).then(updatedRoles => {\n this.client.actions.GuildRolesPositionUpdate.handle({\n guild_id: this.guild.id,\n roles: updatedRoles,\n });\n return this;\n });\n }\n\n /**\n * Deletes the role.\n * @param {string} [reason] Reason for deleting this role\n * @returns {Promise<Role>}\n * @example\n * // Delete a role\n * role.delete('The role needed to go')\n * .then(deleted => console.log(`Deleted role ${deleted.name}`))\n * .catch(console.error);\n */\n delete(reason) {\n return this.client.api.guilds[this.guild.id].roles[this.id].delete({ reason }).then(() => {\n this.client.actions.GuildRoleDelete.handle({ guild_id: this.guild.id, role_id: this.id });\n return this;\n });\n }\n\n /**\n * Whether this role equals another role. It compares all properties, so for most operations\n * it is advisable to just compare `role.id === role2.id` as it is much faster and is often\n * what most users need.\n * @param {Role} role Role to compare with\n * @returns {boolean}\n */\n equals(role) {\n return (\n role &&\n this.id === role.id &&\n this.name === role.name &&\n this.color === role.color &&\n this.hoist === role.hoist &&\n this.position === role.position &&\n this.permissions.bitfield === role.permissions.bitfield &&\n this.managed === role.managed\n );\n }\n\n /**\n * When concatenated with a string, this automatically returns the role's mention instead of the Role object.\n * @returns {string}\n * @example\n * // Logs: Role: <@&123456789012345678>\n * console.log(`Role: ${role}`);\n */\n toString() {\n if (this.id === this.guild.id) return '@everyone';\n return `<@&${this.id}>`;\n }\n\n toJSON() {\n return super.toJSON({ createdTimestamp: true });\n }\n\n /**\n * Compares the positions of two roles.\n * @param {Role} role1 First role to compare\n * @param {Role} role2 Second role to compare\n * @returns {number} Negative number if the first role's position is lower (second role's is higher),\n * positive number if the first's is higher (second's is lower), 0 if equal\n */\n static comparePositions(role1, role2) {\n if (role1.position === role2.position) return role2.id - role1.id;\n return role1.position - role2.position;\n }\n}\n\nmodule.exports = Role;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Role.js?")},"./src/structures/StoreChannel.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst GuildChannel = __webpack_require__(/*! ./GuildChannel */ \"./src/structures/GuildChannel.js\");\n\n/**\n * Represents a guild store channel on Discord.\n * @extends {GuildChannel}\n */\nclass StoreChannel extends GuildChannel {\n /**\n * @param {*} guild The guild the store channel is part of\n * @param {*} data The data for the store channel\n */\n constructor(guild, data) {\n super(guild, data);\n\n /**\n * If the guild considers this channel NSFW\n * @type {boolean}\n * @readonly\n */\n this.nsfw = Boolean(data.nsfw);\n }\n\n _patch(data) {\n super._patch(data);\n\n if (typeof data.nsfw !== 'undefined') this.nsfw = Boolean(data.nsfw);\n }\n}\n\nmodule.exports = StoreChannel;\n\n\n//# sourceURL=webpack://Discord/./src/structures/StoreChannel.js?")},"./src/structures/Team.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Base = __webpack_require__(/*! ./Base */ "./src/structures/Base.js");\nconst TeamMember = __webpack_require__(/*! ./TeamMember */ "./src/structures/TeamMember.js");\nconst Collection = __webpack_require__(/*! ../util/Collection */ "./src/util/Collection.js");\nconst Snowflake = __webpack_require__(/*! ../util/Snowflake */ "./src/util/Snowflake.js");\n\n/**\n * Represents a Client OAuth2 Application Team.\n * @extends {Base}\n */\nclass Team extends Base {\n constructor(client, data) {\n super(client);\n this._patch(data);\n }\n\n _patch(data) {\n /**\n * The ID of the Team\n * @type {Snowflake}\n */\n this.id = data.id;\n\n /**\n * The name of the Team\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The Team\'s icon hash\n * @type {?string}\n */\n this.icon = data.icon || null;\n\n /**\n * The Team\'s owner id\n * @type {?string}\n */\n this.ownerID = data.owner_user_id || null;\n\n /**\n * The Team\'s members\n * @type {Collection<Snowflake, TeamMember>}\n */\n this.members = new Collection();\n\n for (const memberData of data.members) {\n const member = new TeamMember(this, memberData);\n this.members.set(member.id, member);\n }\n }\n\n /**\n * The owner of this team\n * @type {?TeamMember}\n * @readonly\n */\n get owner() {\n return this.members.get(this.ownerID) || null;\n }\n\n /**\n * The timestamp the team was created at\n * @type {number}\n * @readonly\n */\n get createdTimestamp() {\n return Snowflake.deconstruct(this.id).timestamp;\n }\n\n /**\n * The time the team was created at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n /**\n * A link to the teams\'s icon.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string} URL to the icon\n */\n iconURL({ format, size } = {}) {\n if (!this.icon) return null;\n return this.client.rest.cdn.TeamIcon(this.id, this.icon, { format, size });\n }\n\n /**\n * When concatenated with a string, this automatically returns the Team\'s name instead of the\n * Team object.\n * @returns {string}\n * @example\n * // Logs: Team name: My Team\n * console.log(`Team name: ${team}`);\n */\n toString() {\n return this.name;\n }\n\n toJSON() {\n return super.toJSON({ createdTimestamp: true });\n }\n}\n\nmodule.exports = Team;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Team.js?')},"./src/structures/TeamMember.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Base = __webpack_require__(/*! ./Base */ "./src/structures/Base.js");\nconst { MembershipStates } = __webpack_require__(/*! ../util/Constants */ "./src/util/Constants.js");\n\n/**\n * Represents a Client OAuth2 Application Team Member.\n * @extends {Base}\n */\nclass TeamMember extends Base {\n constructor(team, data) {\n super(team.client);\n\n /**\n * The Team this member is part of\n * @type {Team}\n */\n this.team = team;\n\n this._patch(data);\n }\n\n _patch(data) {\n /**\n * The permissions this Team Member has with regard to the team\n * @type {string[]}\n */\n this.permissions = data.permissions;\n\n /**\n * The permissions this Team Member has with regard to the team\n * @type {MembershipStates}\n */\n this.membershipState = MembershipStates[data.membership_state];\n\n /**\n * The user for this Team Member\n * @type {User}\n */\n this.user = this.client.users.add(data.user);\n }\n\n /**\n * The ID of the Team Member\n * @type {Snowflake}\n * @readonly\n */\n get id() {\n return this.user.id;\n }\n\n /**\n * When concatenated with a string, this automatically returns the team members\'s mention instead of the\n * TeamMember object.\n * @returns {string}\n * @example\n * // Logs: Team Member\'s mention: <@123456789012345678>\n * console.log(`Team Member\'s mention: ${teamMember}`);\n */\n toString() {\n return this.user.toString();\n }\n}\n\nmodule.exports = TeamMember;\n\n\n//# sourceURL=webpack://Discord/./src/structures/TeamMember.js?')},"./src/structures/TextChannel.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst GuildChannel = __webpack_require__(/*! ./GuildChannel */ \"./src/structures/GuildChannel.js\");\nconst Webhook = __webpack_require__(/*! ./Webhook */ \"./src/structures/Webhook.js\");\nconst TextBasedChannel = __webpack_require__(/*! ./interfaces/TextBasedChannel */ \"./src/structures/interfaces/TextBasedChannel.js\");\nconst MessageManager = __webpack_require__(/*! ../managers/MessageManager */ \"./src/managers/MessageManager.js\");\nconst Collection = __webpack_require__(/*! ../util/Collection */ \"./src/util/Collection.js\");\nconst DataResolver = __webpack_require__(/*! ../util/DataResolver */ \"./src/util/DataResolver.js\");\n\n/**\n * Represents a guild text channel on Discord.\n * @extends {GuildChannel}\n * @implements {TextBasedChannel}\n */\nclass TextChannel extends GuildChannel {\n /**\n * @param {Guild} guild The guild the text channel is part of\n * @param {Object} data The data for the text channel\n */\n constructor(guild, data) {\n super(guild, data);\n /**\n * A manager of the messages sent to this channel\n * @type {MessageManager}\n */\n this.messages = new MessageManager(this);\n\n /**\n * If the guild considers this channel NSFW\n * @type {boolean}\n * @readonly\n */\n this.nsfw = Boolean(data.nsfw);\n this._typing = new Map();\n }\n\n _patch(data) {\n super._patch(data);\n\n /**\n * The topic of the text channel\n * @type {?string}\n */\n this.topic = data.topic;\n\n if (typeof data.nsfw !== 'undefined') this.nsfw = Boolean(data.nsfw);\n\n /**\n * The ID of the last message sent in this channel, if one was sent\n * @type {?Snowflake}\n */\n this.lastMessageID = data.last_message_id;\n\n /**\n * The ratelimit per user for this channel in seconds\n * @type {number}\n */\n this.rateLimitPerUser = data.rate_limit_per_user || 0;\n\n /**\n * The timestamp when the last pinned message was pinned, if there was one\n * @type {?number}\n */\n this.lastPinTimestamp = data.last_pin_timestamp ? new Date(data.last_pin_timestamp).getTime() : null;\n\n if (data.messages) for (const message of data.messages) this.messages.add(message);\n }\n\n /**\n * Sets the rate limit per user for this channel.\n * @param {number} rateLimitPerUser The new ratelimit in seconds\n * @param {string} [reason] Reason for changing the channel's ratelimits\n * @returns {Promise<TextChannel>}\n */\n setRateLimitPerUser(rateLimitPerUser, reason) {\n return this.edit({ rateLimitPerUser }, reason);\n }\n\n /**\n * Sets whether this channel is flagged as NSFW.\n * @param {boolean} nsfw Whether the channel should be considered NSFW\n * @param {string} [reason] Reason for changing the channel's NSFW flag\n * @returns {Promise<TextChannel>}\n */\n setNSFW(nsfw, reason) {\n return this.edit({ nsfw }, reason);\n }\n\n /**\n * Fetches all webhooks for the channel.\n * @returns {Promise<Collection<Snowflake, Webhook>>}\n * @example\n * // Fetch webhooks\n * channel.fetchWebhooks()\n * .then(hooks => console.log(`This channel has ${hooks.size} hooks`))\n * .catch(console.error);\n */\n fetchWebhooks() {\n return this.client.api.channels[this.id].webhooks.get().then(data => {\n const hooks = new Collection();\n for (const hook of data) hooks.set(hook.id, new Webhook(this.client, hook));\n return hooks;\n });\n }\n\n /**\n * Creates a webhook for the channel.\n * @param {string} name The name of the webhook\n * @param {Object} [options] Options for creating the webhook\n * @param {BufferResolvable|Base64Resolvable} [options.avatar] Avatar for the webhook\n * @param {string} [options.reason] Reason for creating the webhook\n * @returns {Promise<Webhook>} webhook The created webhook\n * @example\n * // Create a webhook for the current channel\n * channel.createWebhook('Snek', {\n * avatar: 'https://i.imgur.com/mI8XcpG.jpg',\n * reason: 'Needed a cool new Webhook'\n * })\n * .then(console.log)\n * .catch(console.error)\n */\n async createWebhook(name, { avatar, reason } = {}) {\n if (typeof avatar === 'string' && !avatar.startsWith('data:')) {\n avatar = await DataResolver.resolveImage(avatar);\n }\n return this.client.api.channels[this.id].webhooks\n .post({\n data: {\n name,\n avatar,\n },\n reason,\n })\n .then(data => new Webhook(this.client, data));\n }\n\n // These are here only for documentation purposes - they are implemented by TextBasedChannel\n /* eslint-disable no-empty-function */\n get lastMessage() {}\n get lastPinAt() {}\n send() {}\n startTyping() {}\n stopTyping() {}\n get typing() {}\n get typingCount() {}\n createMessageCollector() {}\n awaitMessages() {}\n bulkDelete() {}\n}\n\nTextBasedChannel.applyToClass(TextChannel, true);\n\nmodule.exports = TextChannel;\n\n\n//# sourceURL=webpack://Discord/./src/structures/TextChannel.js?")},"./src/structures/User.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst { Presence } = __webpack_require__(/*! ./Presence */ \"./src/structures/Presence.js\");\nconst TextBasedChannel = __webpack_require__(/*! ./interfaces/TextBasedChannel */ \"./src/structures/interfaces/TextBasedChannel.js\");\nconst { Error } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst Snowflake = __webpack_require__(/*! ../util/Snowflake */ \"./src/util/Snowflake.js\");\nconst UserFlags = __webpack_require__(/*! ../util/UserFlags */ \"./src/util/UserFlags.js\");\n\n/**\n * Represents a user on Discord.\n * @implements {TextBasedChannel}\n * @extends {Base}\n */\nclass User extends Base {\n /**\n * @param {Client} client The instantiating client\n * @param {Object} data The data for the user\n */\n constructor(client, data) {\n super(client);\n\n /**\n * The ID of the user\n * @type {Snowflake}\n */\n this.id = data.id;\n\n this._patch(data);\n }\n\n _patch(data) {\n if ('username' in data) {\n /**\n * The username of the user\n * @type {?string}\n * @name User#username\n */\n this.username = data.username;\n } else if (typeof this.username !== 'string') {\n this.username = null;\n }\n\n /**\n * Whether or not the user is a bot\n * @type {?boolean}\n * @name User#bot\n */\n this.bot = Boolean(data.bot);\n\n if ('discriminator' in data) {\n /**\n * A discriminator based on username for the user\n * @type {?string}\n * @name User#discriminator\n */\n this.discriminator = data.discriminator;\n } else if (typeof this.discriminator !== 'string') {\n this.discriminator = null;\n }\n\n if ('avatar' in data) {\n /**\n * The ID of the user's avatar\n * @type {?string}\n * @name User#avatar\n */\n this.avatar = data.avatar;\n } else if (typeof this.avatar !== 'string') {\n this.avatar = null;\n }\n\n if ('system' in data) {\n /**\n * Whether the user is an Official Discord System user (part of the urgent message system)\n * @type {?boolean}\n * @name User#system\n */\n this.system = Boolean(data.system);\n }\n\n if ('locale' in data) {\n /**\n * The locale of the user's client (ISO 639-1)\n * @type {?string}\n * @name User#locale\n */\n this.locale = data.locale;\n }\n\n if ('public_flags' in data) {\n /**\n * The flags for this user\n * @type {?UserFlags}\n * @name User#flags\n */\n this.flags = new UserFlags(data.public_flags);\n }\n\n /**\n * The ID of the last message sent by the user, if one was sent\n * @type {?Snowflake}\n */\n this.lastMessageID = null;\n\n /**\n * The ID of the channel for the last message sent by the user, if one was sent\n * @type {?Snowflake}\n */\n this.lastMessageChannelID = null;\n }\n\n /**\n * Whether this User is a partial\n * @type {boolean}\n * @readonly\n */\n get partial() {\n return typeof this.username !== 'string';\n }\n\n /**\n * The timestamp the user was created at\n * @type {number}\n * @readonly\n */\n get createdTimestamp() {\n return Snowflake.deconstruct(this.id).timestamp;\n }\n\n /**\n * The time the user was created at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n /**\n * The Message object of the last message sent by the user, if one was sent\n * @type {?Message}\n * @readonly\n */\n get lastMessage() {\n const channel = this.client.channels.cache.get(this.lastMessageChannelID);\n return (channel && channel.messages.cache.get(this.lastMessageID)) || null;\n }\n\n /**\n * The presence of this user\n * @type {Presence}\n * @readonly\n */\n get presence() {\n for (const guild of this.client.guilds.cache.values()) {\n if (guild.presences.cache.has(this.id)) return guild.presences.cache.get(this.id);\n }\n return new Presence(this.client, { user: { id: this.id } });\n }\n\n /**\n * A link to the user's avatar.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n avatarURL({ format, size, dynamic } = {}) {\n if (!this.avatar) return null;\n return this.client.rest.cdn.Avatar(this.id, this.avatar, format, size, dynamic);\n }\n\n /**\n * A link to the user's default avatar\n * @type {string}\n * @readonly\n */\n get defaultAvatarURL() {\n return this.client.rest.cdn.DefaultAvatar(this.discriminator % 5);\n }\n\n /**\n * A link to the user's avatar if they have one.\n * Otherwise a link to their default avatar will be returned.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {string}\n */\n displayAvatarURL(options) {\n return this.avatarURL(options) || this.defaultAvatarURL;\n }\n\n /**\n * The Discord \"tag\" (e.g. `hydrabolt#0001`) for this user\n * @type {?string}\n * @readonly\n */\n get tag() {\n return typeof this.username === 'string' ? `${this.username}#${this.discriminator}` : null;\n }\n\n /**\n * Checks whether the user is typing in a channel.\n * @param {ChannelResolvable} channel The channel to check in\n * @returns {boolean}\n */\n typingIn(channel) {\n channel = this.client.channels.resolve(channel);\n return channel._typing.has(this.id);\n }\n\n /**\n * Gets the time that the user started typing.\n * @param {ChannelResolvable} channel The channel to get the time in\n * @returns {?Date}\n */\n typingSinceIn(channel) {\n channel = this.client.channels.resolve(channel);\n return channel._typing.has(this.id) ? new Date(channel._typing.get(this.id).since) : null;\n }\n\n /**\n * Gets the amount of time the user has been typing in a channel for (in milliseconds), or -1 if they're not typing.\n * @param {ChannelResolvable} channel The channel to get the time in\n * @returns {number}\n */\n typingDurationIn(channel) {\n channel = this.client.channels.resolve(channel);\n return channel._typing.has(this.id) ? channel._typing.get(this.id).elapsedTime : -1;\n }\n\n /**\n * The DM between the client's user and this user\n * @type {?DMChannel}\n * @readonly\n */\n get dmChannel() {\n return this.client.channels.cache.find(c => c.type === 'dm' && c.recipient.id === this.id) || null;\n }\n\n /**\n * Creates a DM channel between the client and the user.\n * @param {boolean} [force=false] Whether to skip the cache check and request the API\n * @returns {Promise<DMChannel>}\n */\n async createDM(force = false) {\n if (!force) {\n const { dmChannel } = this;\n if (dmChannel && !dmChannel.partial) return dmChannel;\n }\n\n const data = await this.client.api.users(this.client.user.id).channels.post({\n data: {\n recipient_id: this.id,\n },\n });\n return this.client.actions.ChannelCreate.handle(data).channel;\n }\n\n /**\n * Deletes a DM channel (if one exists) between the client and the user. Resolves with the channel if successful.\n * @returns {Promise<DMChannel>}\n */\n async deleteDM() {\n const { dmChannel } = this;\n if (!dmChannel) throw new Error('USER_NO_DMCHANNEL');\n const data = await this.client.api.channels(dmChannel.id).delete();\n return this.client.actions.ChannelDelete.handle(data).channel;\n }\n\n /**\n * Checks if the user is equal to another. It compares ID, username, discriminator, avatar, and bot flags.\n * It is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties.\n * @param {User} user User to compare with\n * @returns {boolean}\n */\n equals(user) {\n let equal =\n user &&\n this.id === user.id &&\n this.username === user.username &&\n this.discriminator === user.discriminator &&\n this.avatar === user.avatar;\n\n return equal;\n }\n\n /**\n * Fetches this user's flags.\n * @param {boolean} [force=false] Whether to skip the cache check and request the AP\n * @returns {Promise<UserFlags>}\n */\n async fetchFlags(force = false) {\n if (this.flags && !force) return this.flags;\n const data = await this.client.api.users(this.id).get();\n this._patch(data);\n return this.flags;\n }\n\n /**\n * Fetches this user.\n * @param {boolean} [force=false] Whether to skip the cache check and request the AP\n * @returns {Promise<User>}\n */\n fetch(force = false) {\n return this.client.users.fetch(this.id, true, force);\n }\n\n /**\n * When concatenated with a string, this automatically returns the user's mention instead of the User object.\n * @returns {string}\n * @example\n * // Logs: Hello from <@123456789012345678>!\n * console.log(`Hello from ${user}!`);\n */\n toString() {\n return `<@${this.id}>`;\n }\n\n toJSON(...props) {\n const json = super.toJSON(\n {\n createdTimestamp: true,\n defaultAvatarURL: true,\n tag: true,\n lastMessage: false,\n lastMessageID: false,\n },\n ...props,\n );\n json.avatarURL = this.avatarURL();\n json.displayAvatarURL = this.displayAvatarURL();\n return json;\n }\n\n // These are here only for documentation purposes - they are implemented by TextBasedChannel\n /* eslint-disable no-empty-function */\n send() {}\n}\n\nTextBasedChannel.applyToClass(User);\n\nmodule.exports = User;\n\n\n//# sourceURL=webpack://Discord/./src/structures/User.js?")},"./src/structures/VoiceChannel.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst GuildChannel = __webpack_require__(/*! ./GuildChannel */ "./src/structures/GuildChannel.js");\nconst { Error } = __webpack_require__(/*! ../errors */ "./src/errors/index.js");\nconst Collection = __webpack_require__(/*! ../util/Collection */ "./src/util/Collection.js");\nconst { browser } = __webpack_require__(/*! ../util/Constants */ "./src/util/Constants.js");\nconst Permissions = __webpack_require__(/*! ../util/Permissions */ "./src/util/Permissions.js");\n\n/**\n * Represents a guild voice channel on Discord.\n * @extends {GuildChannel}\n */\nclass VoiceChannel extends GuildChannel {\n _patch(data) {\n super._patch(data);\n /**\n * The bitrate of this voice channel\n * @type {number}\n */\n this.bitrate = data.bitrate;\n\n /**\n * The maximum amount of users allowed in this channel - 0 means unlimited.\n * @type {number}\n */\n this.userLimit = data.user_limit;\n }\n\n /**\n * The members in this voice channel\n * @type {Collection<Snowflake, GuildMember>}\n * @name VoiceChannel#members\n * @readonly\n */\n get members() {\n const coll = new Collection();\n for (const state of this.guild.voiceStates.cache.values()) {\n if (state.channelID === this.id && state.member) {\n coll.set(state.id, state.member);\n }\n }\n return coll;\n }\n\n /**\n * Checks if the voice channel is full\n * @type {boolean}\n * @readonly\n */\n get full() {\n return this.userLimit > 0 && this.members.size >= this.userLimit;\n }\n\n /**\n * Whether the channel is deletable by the client user\n * @type {boolean}\n * @readonly\n */\n get deletable() {\n return super.deletable && this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false);\n }\n\n /**\n * Whether the channel is editable by the client user\n * @type {boolean}\n * @readonly\n */\n get editable() {\n return this.manageable && this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false);\n }\n\n /**\n * Whether the channel is joinable by the client user\n * @type {boolean}\n * @readonly\n */\n get joinable() {\n if (browser) return false;\n if (!this.viewable) return false;\n if (!this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false)) return false;\n if (this.full && !this.permissionsFor(this.client.user).has(Permissions.FLAGS.MOVE_MEMBERS, false)) return false;\n return true;\n }\n\n /**\n * Checks if the client has permission to send audio to the voice channel\n * @type {boolean}\n * @readonly\n */\n get speakable() {\n return this.permissionsFor(this.client.user).has(Permissions.FLAGS.SPEAK, false);\n }\n\n /**\n * Sets the bitrate of the channel.\n * @param {number} bitrate The new bitrate\n * @param {string} [reason] Reason for changing the channel\'s bitrate\n * @returns {Promise<VoiceChannel>}\n * @example\n * // Set the bitrate of a voice channel\n * voiceChannel.setBitrate(48000)\n * .then(vc => console.log(`Set bitrate to ${vc.bitrate}bps for ${vc.name}`))\n * .catch(console.error);\n */\n setBitrate(bitrate, reason) {\n return this.edit({ bitrate }, reason);\n }\n\n /**\n * Sets the user limit of the channel.\n * @param {number} userLimit The new user limit\n * @param {string} [reason] Reason for changing the user limit\n * @returns {Promise<VoiceChannel>}\n * @example\n * // Set the user limit of a voice channel\n * voiceChannel.setUserLimit(42)\n * .then(vc => console.log(`Set user limit to ${vc.userLimit} for ${vc.name}`))\n * .catch(console.error);\n */\n setUserLimit(userLimit, reason) {\n return this.edit({ userLimit }, reason);\n }\n\n /**\n * Attempts to join this voice channel.\n * @returns {Promise<VoiceConnection>}\n * @example\n * // Join a voice channel\n * voiceChannel.join()\n * .then(connection => console.log(\'Connected!\'))\n * .catch(console.error);\n */\n join() {\n if (browser) return Promise.reject(new Error(\'VOICE_NO_BROWSER\'));\n return this.client.voice.joinChannel(this);\n }\n\n /**\n * Leaves this voice channel.\n * @example\n * // Leave a voice channel\n * voiceChannel.leave();\n */\n leave() {\n if (browser) return;\n const connection = this.client.voice.connections.get(this.guild.id);\n if (connection && connection.channel.id === this.id) connection.disconnect();\n }\n}\n\nmodule.exports = VoiceChannel;\n\n\n//# sourceURL=webpack://Discord/./src/structures/VoiceChannel.js?')},"./src/structures/VoiceRegion.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Util = __webpack_require__(/*! ../util/Util */ "./src/util/Util.js");\n\n/**\n * Represents a Discord voice region for guilds.\n */\nclass VoiceRegion {\n constructor(data) {\n /**\n * The ID of the region\n * @type {string}\n */\n this.id = data.id;\n\n /**\n * Name of the region\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * Whether the region is VIP-only\n * @type {boolean}\n */\n this.vip = data.vip;\n\n /**\n * Whether the region is deprecated\n * @type {boolean}\n */\n this.deprecated = data.deprecated;\n\n /**\n * Whether the region is optimal\n * @type {boolean}\n */\n this.optimal = data.optimal;\n\n /**\n * Whether the region is custom\n * @type {boolean}\n */\n this.custom = data.custom;\n }\n\n toJSON() {\n return Util.flatten(this);\n }\n}\n\nmodule.exports = VoiceRegion;\n\n\n//# sourceURL=webpack://Discord/./src/structures/VoiceRegion.js?')},"./src/structures/VoiceState.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(/*! ./Base */ \"./src/structures/Base.js\");\nconst { Error, TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst { browser } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\n\n/**\n * Represents the voice state for a Guild Member.\n */\nclass VoiceState extends Base {\n /**\n * @param {Guild} guild The guild the voice state is part of\n * @param {Object} data The data for the voice state\n */\n constructor(guild, data) {\n super(guild.client);\n /**\n * The guild of this voice state\n * @type {Guild}\n */\n this.guild = guild;\n /**\n * The ID of the member of this voice state\n * @type {Snowflake}\n */\n this.id = data.user_id;\n this._patch(data);\n }\n\n _patch(data) {\n /**\n * Whether this member is deafened server-wide\n * @type {?boolean}\n */\n this.serverDeaf = data.deaf;\n /**\n * Whether this member is muted server-wide\n * @type {?boolean}\n */\n this.serverMute = data.mute;\n /**\n * Whether this member is self-deafened\n * @type {?boolean}\n */\n this.selfDeaf = data.self_deaf;\n /**\n * Whether this member is self-muted\n * @type {?boolean}\n */\n this.selfMute = data.self_mute;\n /**\n * Whether this member's camera is enabled\n * @type {boolean}\n */\n this.selfVideo = data.self_video;\n /**\n * The session ID of this member's connection\n * @type {?string}\n */\n this.sessionID = data.session_id;\n /**\n * Whether this member is streaming using \"Go Live\"\n * @type {boolean}\n */\n this.streaming = data.self_stream || false;\n /**\n * The ID of the voice channel that this member is in\n * @type {?Snowflake}\n */\n this.channelID = data.channel_id;\n return this;\n }\n\n /**\n * The member that this voice state belongs to\n * @type {?GuildMember}\n * @readonly\n */\n get member() {\n return this.guild.members.cache.get(this.id) || null;\n }\n\n /**\n * The channel that the member is connected to\n * @type {?VoiceChannel}\n * @readonly\n */\n get channel() {\n return this.guild.channels.cache.get(this.channelID) || null;\n }\n\n /**\n * If this is a voice state of the client user, then this will refer to the active VoiceConnection for this guild\n * @type {?VoiceConnection}\n * @readonly\n */\n get connection() {\n if (browser || this.id !== this.client.user.id) return null;\n return this.client.voice.connections.get(this.guild.id) || null;\n }\n\n /**\n * Whether this member is either self-deafened or server-deafened\n * @type {?boolean}\n * @readonly\n */\n get deaf() {\n return this.serverDeaf || this.selfDeaf;\n }\n\n /**\n * Whether this member is either self-muted or server-muted\n * @type {?boolean}\n * @readonly\n */\n get mute() {\n return this.serverMute || this.selfMute;\n }\n\n /**\n * Whether this member is currently speaking. A boolean if the information is available (aka\n * the bot is connected to any voice channel in the guild), otherwise this is null\n * @type {?boolean}\n * @readonly\n */\n get speaking() {\n return this.channel && this.channel.connection ? Boolean(this.channel.connection._speaking.get(this.id)) : null;\n }\n\n /**\n * Mutes/unmutes the member of this voice state.\n * @param {boolean} mute Whether or not the member should be muted\n * @param {string} [reason] Reason for muting or unmuting\n * @returns {Promise<GuildMember>}\n */\n setMute(mute, reason) {\n return this.member ? this.member.edit({ mute }, reason) : Promise.reject(new Error('VOICE_STATE_UNCACHED_MEMBER'));\n }\n\n /**\n * Deafens/undeafens the member of this voice state.\n * @param {boolean} deaf Whether or not the member should be deafened\n * @param {string} [reason] Reason for deafening or undeafening\n * @returns {Promise<GuildMember>}\n */\n setDeaf(deaf, reason) {\n return this.member ? this.member.edit({ deaf }, reason) : Promise.reject(new Error('VOICE_STATE_UNCACHED_MEMBER'));\n }\n\n /**\n * Kicks the member from the voice channel.\n * @param {string} [reason] Reason for kicking member from the channel\n * @returns {Promise<GuildMember>}\n */\n kick(reason) {\n return this.setChannel(null, reason);\n }\n\n /**\n * Moves the member to a different channel, or disconnects them from the one they're in.\n * @param {ChannelResolvable|null} [channel] Channel to move the member to, or `null` if you want to disconnect them\n * from voice.\n * @param {string} [reason] Reason for moving member to another channel or disconnecting\n * @returns {Promise<GuildMember>}\n */\n setChannel(channel, reason) {\n return this.member\n ? this.member.edit({ channel }, reason)\n : Promise.reject(new Error('VOICE_STATE_UNCACHED_MEMBER'));\n }\n\n /**\n * Self-mutes/unmutes the bot for this voice state.\n * @param {boolean} mute Whether or not the bot should be self-muted\n * @returns {Promise<boolean>} true if the voice state was successfully updated, otherwise false\n */\n async setSelfMute(mute) {\n if (this.id !== this.client.user.id) throw new Error('VOICE_STATE_NOT_OWN');\n if (typeof mute !== 'boolean') throw new TypeError('VOICE_STATE_INVALID_TYPE', 'mute');\n if (!this.connection) return false;\n this.selfMute = mute;\n await this.connection.sendVoiceStateUpdate();\n return true;\n }\n\n /**\n * Self-deafens/undeafens the bot for this voice state.\n * @param {boolean} deaf Whether or not the bot should be self-deafened\n * @returns {Promise<boolean>} true if the voice state was successfully updated, otherwise false\n */\n async setSelfDeaf(deaf) {\n if (this.id !== this.client.user.id) return new Error('VOICE_STATE_NOT_OWN');\n if (typeof deaf !== 'boolean') return new TypeError('VOICE_STATE_INVALID_TYPE', 'deaf');\n if (!this.connection) return false;\n this.selfDeaf = deaf;\n await this.connection.sendVoiceStateUpdate();\n return true;\n }\n\n toJSON() {\n return super.toJSON({\n id: true,\n serverDeaf: true,\n serverMute: true,\n selfDeaf: true,\n selfMute: true,\n sessionID: true,\n channelID: 'channel',\n });\n }\n}\n\nmodule.exports = VoiceState;\n\n\n//# sourceURL=webpack://Discord/./src/structures/VoiceState.js?")},"./src/structures/Webhook.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst APIMessage = __webpack_require__(/*! ./APIMessage */ \"./src/structures/APIMessage.js\");\nconst Channel = __webpack_require__(/*! ./Channel */ \"./src/structures/Channel.js\");\nconst { WebhookTypes } = __webpack_require__(/*! ../util/Constants */ \"./src/util/Constants.js\");\nconst DataResolver = __webpack_require__(/*! ../util/DataResolver */ \"./src/util/DataResolver.js\");\nconst Snowflake = __webpack_require__(/*! ../util/Snowflake */ \"./src/util/Snowflake.js\");\n\n/**\n * Represents a webhook.\n */\nclass Webhook {\n constructor(client, data) {\n /**\n * The client that instantiated the webhook\n * @name Webhook#client\n * @type {Client}\n * @readonly\n */\n Object.defineProperty(this, 'client', { value: client });\n if (data) this._patch(data);\n }\n\n _patch(data) {\n /**\n * The name of the webhook\n * @type {string}\n */\n this.name = data.name;\n\n /**\n * The token for the webhook\n * @name Webhook#token\n * @type {?string}\n */\n Object.defineProperty(this, 'token', { value: data.token || null, writable: true, configurable: true });\n\n /**\n * The avatar for the webhook\n * @type {?string}\n */\n this.avatar = data.avatar;\n\n /**\n * The ID of the webhook\n * @type {Snowflake}\n */\n this.id = data.id;\n\n /**\n * The type of the webhook\n * @type {WebhookTypes}\n */\n this.type = WebhookTypes[data.type];\n\n /**\n * The guild the webhook belongs to\n * @type {Snowflake}\n */\n this.guildID = data.guild_id;\n\n /**\n * The channel the webhook belongs to\n * @type {Snowflake}\n */\n this.channelID = data.channel_id;\n\n if (data.user) {\n /**\n * The owner of the webhook\n * @type {?User|Object}\n */\n this.owner = this.client.users ? this.client.users.cache.get(data.user.id) : data.user;\n } else {\n this.owner = null;\n }\n }\n\n /**\n * Options that can be passed into send.\n * @typedef {Object} WebhookMessageOptions\n * @property {string} [username=this.name] Username override for the message\n * @property {string} [avatarURL] Avatar URL override for the message\n * @property {boolean} [tts=false] Whether or not the message should be spoken aloud\n * @property {string} [nonce=''] The nonce for the message\n * @property {Object[]} [embeds] An array of embeds for the message\n * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content\n * (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)\n * @property {DisableMentionType} [disableMentions=this.client.options.disableMentions] Whether or not all mentions or\n * everyone/here mentions should be sanitized to prevent unexpected mentions\n * @property {FileOptions[]|string[]} [files] Files to send with the message\n * @property {string|boolean} [code] Language for optional codeblock formatting to apply\n * @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if\n * it exceeds the character limit. If an object is provided, these are the options for splitting the message.\n */\n\n /**\n * Sends a message with this webhook.\n * @param {StringResolvable|APIMessage} [content=''] The content to send\n * @param {WebhookMessageOptions|MessageAdditions} [options={}] The options to provide\n * @returns {Promise<Message|Object>}\n * @example\n * // Send a basic message\n * webhook.send('hello!')\n * .then(message => console.log(`Sent message: ${message.content}`))\n * .catch(console.error);\n * @example\n * // Send a remote file\n * webhook.send({\n * files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n * })\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Send a local file\n * webhook.send({\n * files: [{\n * attachment: 'entire/path/to/file.jpg',\n * name: 'file.jpg'\n * }]\n * })\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Send an embed with a local image inside\n * webhook.send('This is an embed', {\n * embeds: [{\n * thumbnail: {\n * url: 'attachment://file.jpg'\n * }\n * }],\n * files: [{\n * attachment: 'entire/path/to/file.jpg',\n * name: 'file.jpg'\n * }]\n * })\n * .then(console.log)\n * .catch(console.error);\n */\n async send(content, options) {\n let apiMessage;\n\n if (content instanceof APIMessage) {\n apiMessage = content.resolveData();\n } else {\n apiMessage = APIMessage.create(this, content, options).resolveData();\n if (Array.isArray(apiMessage.data.content)) {\n return Promise.all(apiMessage.split().map(this.send.bind(this)));\n }\n }\n\n const { data, files } = await apiMessage.resolveFiles();\n return this.client.api\n .webhooks(this.id, this.token)\n .post({\n data,\n files,\n query: { wait: true },\n auth: false,\n })\n .then(d => {\n const channel = this.client.channels ? this.client.channels.cache.get(d.channel_id) : undefined;\n if (!channel) return d;\n return channel.messages.add(d, false);\n });\n }\n\n /**\n * Sends a raw slack message with this webhook.\n * @param {Object} body The raw body to send\n * @returns {Promise<boolean>}\n * @example\n * // Send a slack message\n * webhook.sendSlackMessage({\n * 'username': 'Wumpus',\n * 'attachments': [{\n * 'pretext': 'this looks pretty cool',\n * 'color': '#F0F',\n * 'footer_icon': 'http://snek.s3.amazonaws.com/topSnek.png',\n * 'footer': 'Powered by sneks',\n * 'ts': Date.now() / 1000\n * }]\n * }).catch(console.error);\n */\n sendSlackMessage(body) {\n return this.client.api\n .webhooks(this.id, this.token)\n .slack.post({\n query: { wait: true },\n auth: false,\n data: body,\n })\n .then(data => data.toString() === 'ok');\n }\n\n /**\n * Edits the webhook.\n * @param {Object} options Options\n * @param {string} [options.name=this.name] New name for this webhook\n * @param {BufferResolvable} [options.avatar] New avatar for this webhook\n * @param {ChannelResolvable} [options.channel] New channel for this webhook\n * @param {string} [reason] Reason for editing this webhook\n * @returns {Promise<Webhook>}\n */\n async edit({ name = this.name, avatar, channel }, reason) {\n if (avatar && typeof avatar === 'string' && !avatar.startsWith('data:')) {\n avatar = await DataResolver.resolveImage(avatar);\n }\n if (channel) channel = channel instanceof Channel ? channel.id : channel;\n const data = await this.client.api.webhooks(this.id, channel ? undefined : this.token).patch({\n data: { name, avatar, channel_id: channel },\n reason,\n });\n\n this.name = data.name;\n this.avatar = data.avatar;\n this.channelID = data.channel_id;\n return this;\n }\n\n /**\n * Deletes the webhook.\n * @param {string} [reason] Reason for deleting this webhook\n * @returns {Promise}\n */\n delete(reason) {\n return this.client.api.webhooks(this.id, this.token).delete({ reason });\n }\n /**\n * The timestamp the webhook was created at\n * @type {number}\n * @readonly\n */\n get createdTimestamp() {\n return Snowflake.deconstruct(this.id).timestamp;\n }\n\n /**\n * The time the webhook was created at\n * @type {Date}\n * @readonly\n */\n get createdAt() {\n return new Date(this.createdTimestamp);\n }\n\n /**\n * The url of this webhook\n * @type {string}\n * @readonly\n */\n get url() {\n return this.client.options.http.api + this.client.api.webhooks(this.id, this.token);\n }\n\n /**\n * A link to the webhook's avatar.\n * @param {ImageURLOptions} [options={}] Options for the Image URL\n * @returns {?string}\n */\n avatarURL({ format, size } = {}) {\n if (!this.avatar) return null;\n return this.client.rest.cdn.Avatar(this.id, this.avatar, format, size);\n }\n\n static applyToClass(structure) {\n for (const prop of ['send', 'sendSlackMessage', 'edit', 'delete', 'createdTimestamp', 'createdAt', 'url']) {\n Object.defineProperty(structure.prototype, prop, Object.getOwnPropertyDescriptor(Webhook.prototype, prop));\n }\n }\n}\n\nmodule.exports = Webhook;\n\n\n//# sourceURL=webpack://Discord/./src/structures/Webhook.js?")},"./src/structures/interfaces/Collector.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\nconst Collection = __webpack_require__(/*! ../../util/Collection */ \"./src/util/Collection.js\");\nconst Util = __webpack_require__(/*! ../../util/Util */ \"./src/util/Util.js\");\n\n/**\n * Filter to be applied to the collector.\n * @typedef {Function} CollectorFilter\n * @param {...*} args Any arguments received by the listener\n * @param {Collection} collection The items collected by this collector\n * @returns {boolean|Promise<boolean>}\n */\n\n/**\n * Options to be applied to the collector.\n * @typedef {Object} CollectorOptions\n * @property {number} [time] How long to run the collector for in milliseconds\n * @property {number} [idle] How long to stop the collector after inactivity in milliseconds\n * @property {boolean} [dispose=false] Whether to dispose data when it's deleted\n */\n\n/**\n * Abstract class for defining a new Collector.\n * @abstract\n */\nclass Collector extends EventEmitter {\n constructor(client, filter, options = {}) {\n super();\n\n /**\n * The client that instantiated this Collector\n * @name Collector#client\n * @type {Client}\n * @readonly\n */\n Object.defineProperty(this, 'client', { value: client });\n\n /**\n * The filter applied to this collector\n * @type {CollectorFilter}\n */\n this.filter = filter;\n\n /**\n * The options of this collector\n * @type {CollectorOptions}\n */\n this.options = options;\n\n /**\n * The items collected by this collector\n * @type {Collection}\n */\n this.collected = new Collection();\n\n /**\n * Whether this collector has finished collecting\n * @type {boolean}\n */\n this.ended = false;\n\n /**\n * Timeout for cleanup\n * @type {?Timeout}\n * @private\n */\n this._timeout = null;\n\n /**\n * Timeout for cleanup due to inactivity\n * @type {?Timeout}\n * @private\n */\n this._idletimeout = null;\n\n this.handleCollect = this.handleCollect.bind(this);\n this.handleDispose = this.handleDispose.bind(this);\n\n if (options.time) this._timeout = this.client.setTimeout(() => this.stop('time'), options.time);\n if (options.idle) this._idletimeout = this.client.setTimeout(() => this.stop('idle'), options.idle);\n }\n\n /**\n * Call this to handle an event as a collectable element. Accepts any event data as parameters.\n * @param {...*} args The arguments emitted by the listener\n * @emits Collector#collect\n */\n async handleCollect(...args) {\n const collect = this.collect(...args);\n\n if (collect && (await this.filter(...args, this.collected))) {\n this.collected.set(collect, args[0]);\n\n /**\n * Emitted whenever an element is collected.\n * @event Collector#collect\n * @param {...*} args The arguments emitted by the listener\n */\n this.emit('collect', ...args);\n\n if (this._idletimeout) {\n this.client.clearTimeout(this._idletimeout);\n this._idletimeout = this.client.setTimeout(() => this.stop('idle'), this.options.idle);\n }\n }\n this.checkEnd();\n }\n\n /**\n * Call this to remove an element from the collection. Accepts any event data as parameters.\n * @param {...*} args The arguments emitted by the listener\n * @emits Collector#dispose\n */\n handleDispose(...args) {\n if (!this.options.dispose) return;\n\n const dispose = this.dispose(...args);\n if (!dispose || !this.filter(...args) || !this.collected.has(dispose)) return;\n this.collected.delete(dispose);\n\n /**\n * Emitted whenever an element is disposed of.\n * @event Collector#dispose\n * @param {...*} args The arguments emitted by the listener\n */\n this.emit('dispose', ...args);\n this.checkEnd();\n }\n\n /**\n * Returns a promise that resolves with the next collected element;\n * rejects with collected elements if the collector finishes without receiving a next element\n * @type {Promise}\n * @readonly\n */\n get next() {\n return new Promise((resolve, reject) => {\n if (this.ended) {\n reject(this.collected);\n return;\n }\n\n const cleanup = () => {\n this.removeListener('collect', onCollect);\n this.removeListener('end', onEnd);\n };\n\n const onCollect = item => {\n cleanup();\n resolve(item);\n };\n\n const onEnd = () => {\n cleanup();\n reject(this.collected); // eslint-disable-line prefer-promise-reject-errors\n };\n\n this.on('collect', onCollect);\n this.on('end', onEnd);\n });\n }\n\n /**\n * Stops this collector and emits the `end` event.\n * @param {string} [reason='user'] The reason this collector is ending\n * @emits Collector#end\n */\n stop(reason = 'user') {\n if (this.ended) return;\n\n if (this._timeout) {\n this.client.clearTimeout(this._timeout);\n this._timeout = null;\n }\n if (this._idletimeout) {\n this.client.clearTimeout(this._idletimeout);\n this._idletimeout = null;\n }\n this.ended = true;\n\n /**\n * Emitted when the collector is finished collecting.\n * @event Collector#end\n * @param {Collection} collected The elements collected by the collector\n * @param {string} reason The reason the collector ended\n */\n this.emit('end', this.collected, reason);\n }\n\n /**\n * Resets the collectors timeout and idle timer.\n * @param {Object} [options] Options\n * @param {number} [options.time] How long to run the collector for in milliseconds\n * @param {number} [options.idle] How long to stop the collector after inactivity in milliseconds\n */\n resetTimer({ time, idle } = {}) {\n if (this._timeout) {\n this.client.clearTimeout(this._timeout);\n this._timeout = this.client.setTimeout(() => this.stop('time'), time || this.options.time);\n }\n if (this._idletimeout) {\n this.client.clearTimeout(this._idletimeout);\n this._idletimeout = this.client.setTimeout(() => this.stop('idle'), idle || this.options.idle);\n }\n }\n\n /**\n * Checks whether the collector should end, and if so, ends it.\n */\n checkEnd() {\n const reason = this.endReason();\n if (reason) this.stop(reason);\n }\n\n /**\n * Allows collectors to be consumed with for-await-of loops\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of}\n */\n async *[Symbol.asyncIterator]() {\n const queue = [];\n const onCollect = item => queue.push(item);\n this.on('collect', onCollect);\n\n try {\n while (queue.length || !this.ended) {\n if (queue.length) {\n yield queue.shift();\n } else {\n // eslint-disable-next-line no-await-in-loop\n await new Promise(resolve => {\n const tick = () => {\n this.removeListener('collect', tick);\n this.removeListener('end', tick);\n return resolve();\n };\n this.on('collect', tick);\n this.on('end', tick);\n });\n }\n }\n } finally {\n this.removeListener('collect', onCollect);\n }\n }\n\n toJSON() {\n return Util.flatten(this);\n }\n\n /* eslint-disable no-empty-function, valid-jsdoc */\n /**\n * Handles incoming events from the `handleCollect` function. Returns null if the event should not\n * be collected, or returns an object describing the data that should be stored.\n * @see Collector#handleCollect\n * @param {...*} args Any args the event listener emits\n * @returns {?{key, value}} Data to insert into collection, if any\n * @abstract\n */\n collect() {}\n\n /**\n * Handles incoming events from the `handleDispose`. Returns null if the event should not\n * be disposed, or returns the key that should be removed.\n * @see Collector#handleDispose\n * @param {...*} args Any args the event listener emits\n * @returns {?*} Key to remove from the collection, if any\n * @abstract\n */\n dispose() {}\n\n /**\n * The reason this collector has ended or will end with.\n * @returns {?string} Reason to end the collector, if any\n * @abstract\n */\n endReason() {}\n /* eslint-enable no-empty-function, valid-jsdoc */\n}\n\nmodule.exports = Collector;\n\n\n//# sourceURL=webpack://Discord/./src/structures/interfaces/Collector.js?")},"./src/structures/interfaces/TextBasedChannel.js":function(module,exports,__webpack_require__){"use strict";eval("\n\n/* eslint-disable import/order */\nconst MessageCollector = __webpack_require__(/*! ../MessageCollector */ \"./src/structures/MessageCollector.js\");\nconst APIMessage = __webpack_require__(/*! ../APIMessage */ \"./src/structures/APIMessage.js\");\nconst Snowflake = __webpack_require__(/*! ../../util/Snowflake */ \"./src/util/Snowflake.js\");\nconst Collection = __webpack_require__(/*! ../../util/Collection */ \"./src/util/Collection.js\");\nconst { RangeError, TypeError } = __webpack_require__(/*! ../../errors */ \"./src/errors/index.js\");\n\n/**\n * Interface for classes that have text-channel-like features.\n * @interface\n */\nclass TextBasedChannel {\n constructor() {\n /**\n * A manager of the messages sent to this channel\n * @type {MessageManager}\n */\n this.messages = new MessageManager(this);\n\n /**\n * The ID of the last message in the channel, if one was sent\n * @type {?Snowflake}\n */\n this.lastMessageID = null;\n\n /**\n * The timestamp when the last pinned message was pinned, if there was one\n * @type {?number}\n */\n this.lastPinTimestamp = null;\n }\n\n /**\n * The Message object of the last message in the channel, if one was sent\n * @type {?Message}\n * @readonly\n */\n get lastMessage() {\n return this.messages.cache.get(this.lastMessageID) || null;\n }\n\n /**\n * The date when the last pinned message was pinned, if there was one\n * @type {?Date}\n * @readonly\n */\n get lastPinAt() {\n return this.lastPinTimestamp ? new Date(this.lastPinTimestamp) : null;\n }\n\n /**\n * Options provided when sending or editing a message.\n * @typedef {Object} MessageOptions\n * @property {boolean} [tts=false] Whether or not the message should be spoken aloud\n * @property {string} [nonce=''] The nonce for the message\n * @property {string} [content=''] The content for the message\n * @property {MessageEmbed|Object} [embed] An embed for the message\n * (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details)\n * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content\n * @property {DisableMentionType} [disableMentions=this.client.options.disableMentions] Whether or not all mentions or\n * everyone/here mentions should be sanitized to prevent unexpected mentions\n * @property {FileOptions[]|BufferResolvable[]} [files] Files to send with the message\n * @property {string|boolean} [code] Language for optional codeblock formatting to apply\n * @property {boolean|SplitOptions} [split=false] Whether or not the message should be split into multiple messages if\n * it exceeds the character limit. If an object is provided, these are the options for splitting the message\n * @property {UserResolvable} [reply] User to reply to (prefixes the message with a mention, except in DMs)\n */\n\n /**\n * Options provided to control parsing of mentions by Discord\n * @typedef {Object} MessageMentionOptions\n * @property {MessageMentionTypes[]} [parse] Types of mentions to be parsed\n * @property {Snowflake[]} [users] Snowflakes of Users to be parsed as mentions\n * @property {Snowflake[]} [roles] Snowflakes of Roles to be parsed as mentions\n */\n\n /**\n * Types of mentions to enable in MessageMentionOptions.\n * - `roles`\n * - `users`\n * - `everyone`\n * @typedef {string} MessageMentionTypes\n */\n\n /**\n * The type of mentions to disable.\n * - `none`\n * - `all`\n * - `everyone`\n * @typedef {string} DisableMentionType\n */\n\n /**\n * @typedef {Object} FileOptions\n * @property {BufferResolvable} attachment File to attach\n * @property {string} [name='file.jpg'] Filename of the attachment\n */\n\n /**\n * Options for splitting a message.\n * @typedef {Object} SplitOptions\n * @property {number} [maxLength=2000] Maximum character length per message piece\n * @property {string} [char='\\n'] Character to split the message with\n * @property {string} [prepend=''] Text to prepend to every piece except the first\n * @property {string} [append=''] Text to append to every piece except the last\n */\n\n /**\n * Sends a message to this channel.\n * @param {StringResolvable|APIMessage} [content=''] The content to send\n * @param {MessageOptions|MessageAdditions} [options={}] The options to provide\n * @returns {Promise<Message|Message[]>}\n * @example\n * // Send a basic message\n * channel.send('hello!')\n * .then(message => console.log(`Sent message: ${message.content}`))\n * .catch(console.error);\n * @example\n * // Send a remote file\n * channel.send({\n * files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']\n * })\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Send a local file\n * channel.send({\n * files: [{\n * attachment: 'entire/path/to/file.jpg',\n * name: 'file.jpg'\n * }]\n * })\n * .then(console.log)\n * .catch(console.error);\n * @example\n * // Send an embed with a local image inside\n * channel.send('This is an embed', {\n * embed: {\n * thumbnail: {\n * url: 'attachment://file.jpg'\n * }\n * },\n * files: [{\n * attachment: 'entire/path/to/file.jpg',\n * name: 'file.jpg'\n * }]\n * })\n * .then(console.log)\n * .catch(console.error);\n */\n async send(content, options) {\n const User = __webpack_require__(/*! ../User */ \"./src/structures/User.js\");\n const GuildMember = __webpack_require__(/*! ../GuildMember */ \"./src/structures/GuildMember.js\");\n\n if (this instanceof User || this instanceof GuildMember) {\n return this.createDM().then(dm => dm.send(content, options));\n }\n\n let apiMessage;\n\n if (content instanceof APIMessage) {\n apiMessage = content.resolveData();\n } else {\n apiMessage = APIMessage.create(this, content, options).resolveData();\n if (Array.isArray(apiMessage.data.content)) {\n return Promise.all(apiMessage.split().map(this.send.bind(this)));\n }\n }\n\n const { data, files } = await apiMessage.resolveFiles();\n return this.client.api.channels[this.id].messages\n .post({ data, files })\n .then(d => this.client.actions.MessageCreate.handle(d).message);\n }\n\n /**\n * Starts a typing indicator in the channel.\n * @param {number} [count=1] The number of times startTyping should be considered to have been called\n * @returns {Promise} Resolves once the bot stops typing gracefully, or rejects when an error occurs\n * @example\n * // Start typing in a channel, or increase the typing count by one\n * channel.startTyping();\n * @example\n * // Start typing in a channel with a typing count of five, or set it to five\n * channel.startTyping(5);\n */\n startTyping(count) {\n if (typeof count !== 'undefined' && count < 1) throw new RangeError('TYPING_COUNT');\n if (this.client.user._typing.has(this.id)) {\n const entry = this.client.user._typing.get(this.id);\n entry.count = count || entry.count + 1;\n return entry.promise;\n }\n\n const entry = {};\n entry.promise = new Promise((resolve, reject) => {\n const endpoint = this.client.api.channels[this.id].typing;\n Object.assign(entry, {\n count: count || 1,\n interval: this.client.setInterval(() => {\n endpoint.post().catch(error => {\n this.client.clearInterval(entry.interval);\n this.client.user._typing.delete(this.id);\n reject(error);\n });\n }, 9000),\n resolve,\n });\n endpoint.post().catch(error => {\n this.client.clearInterval(entry.interval);\n this.client.user._typing.delete(this.id);\n reject(error);\n });\n this.client.user._typing.set(this.id, entry);\n });\n return entry.promise;\n }\n\n /**\n * Stops the typing indicator in the channel.\n * The indicator will only stop if this is called as many times as startTyping().\n * <info>It can take a few seconds for the client user to stop typing.</info>\n * @param {boolean} [force=false] Whether or not to reset the call count and force the indicator to stop\n * @example\n * // Reduce the typing count by one and stop typing if it reached 0\n * channel.stopTyping();\n * @example\n * // Force typing to fully stop regardless of typing count\n * channel.stopTyping(true);\n */\n stopTyping(force = false) {\n if (this.client.user._typing.has(this.id)) {\n const entry = this.client.user._typing.get(this.id);\n entry.count--;\n if (entry.count <= 0 || force) {\n this.client.clearInterval(entry.interval);\n this.client.user._typing.delete(this.id);\n entry.resolve();\n }\n }\n }\n\n /**\n * Whether or not the typing indicator is being shown in the channel\n * @type {boolean}\n * @readonly\n */\n get typing() {\n return this.client.user._typing.has(this.id);\n }\n\n /**\n * Number of times `startTyping` has been called\n * @type {number}\n * @readonly\n */\n get typingCount() {\n if (this.client.user._typing.has(this.id)) return this.client.user._typing.get(this.id).count;\n return 0;\n }\n\n /**\n * Creates a Message Collector.\n * @param {CollectorFilter} filter The filter to create the collector with\n * @param {MessageCollectorOptions} [options={}] The options to pass to the collector\n * @returns {MessageCollector}\n * @example\n * // Create a message collector\n * const filter = m => m.content.includes('discord');\n * const collector = channel.createMessageCollector(filter, { time: 15000 });\n * collector.on('collect', m => console.log(`Collected ${m.content}`));\n * collector.on('end', collected => console.log(`Collected ${collected.size} items`));\n */\n createMessageCollector(filter, options = {}) {\n return new MessageCollector(this, filter, options);\n }\n\n /**\n * An object containing the same properties as CollectorOptions, but a few more:\n * @typedef {MessageCollectorOptions} AwaitMessagesOptions\n * @property {string[]} [errors] Stop/end reasons that cause the promise to reject\n */\n\n /**\n * Similar to createMessageCollector but in promise form.\n * Resolves with a collection of messages that pass the specified filter.\n * @param {CollectorFilter} filter The filter function to use\n * @param {AwaitMessagesOptions} [options={}] Optional options to pass to the internal collector\n * @returns {Promise<Collection<Snowflake, Message>>}\n * @example\n * // Await !vote messages\n * const filter = m => m.content.startsWith('!vote');\n * // Errors: ['time'] treats ending because of the time limit as an error\n * channel.awaitMessages(filter, { max: 4, time: 60000, errors: ['time'] })\n * .then(collected => console.log(collected.size))\n * .catch(collected => console.log(`After a minute, only ${collected.size} out of 4 voted.`));\n */\n awaitMessages(filter, options = {}) {\n return new Promise((resolve, reject) => {\n const collector = this.createMessageCollector(filter, options);\n collector.once('end', (collection, reason) => {\n if (options.errors && options.errors.includes(reason)) {\n reject(collection);\n } else {\n resolve(collection);\n }\n });\n });\n }\n\n /**\n * Bulk deletes given messages that are newer than two weeks.\n * @param {Collection<Snowflake, Message>|MessageResolvable[]|number} messages\n * Messages or number of messages to delete\n * @param {boolean} [filterOld=false] Filter messages to remove those which are older than two weeks automatically\n * @returns {Promise<Collection<Snowflake, Message>>} Deleted messages\n * @example\n * // Bulk delete messages\n * channel.bulkDelete(5)\n * .then(messages => console.log(`Bulk deleted ${messages.size} messages`))\n * .catch(console.error);\n */\n async bulkDelete(messages, filterOld = false) {\n if (Array.isArray(messages) || messages instanceof Collection) {\n let messageIDs = messages instanceof Collection ? messages.keyArray() : messages.map(m => m.id || m);\n if (filterOld) {\n messageIDs = messageIDs.filter(id => Date.now() - Snowflake.deconstruct(id).date.getTime() < 1209600000);\n }\n if (messageIDs.length === 0) return new Collection();\n if (messageIDs.length === 1) {\n await this.client.api.channels(this.id).messages(messageIDs[0]).delete();\n const message = this.client.actions.MessageDelete.getMessage(\n {\n message_id: messageIDs[0],\n },\n this,\n );\n return message ? new Collection([[message.id, message]]) : new Collection();\n }\n await this.client.api.channels[this.id].messages['bulk-delete'].post({ data: { messages: messageIDs } });\n return messageIDs.reduce(\n (col, id) =>\n col.set(\n id,\n this.client.actions.MessageDeleteBulk.getMessage(\n {\n message_id: id,\n },\n this,\n ),\n ),\n new Collection(),\n );\n }\n if (!isNaN(messages)) {\n const msgs = await this.messages.fetch({ limit: messages });\n return this.bulkDelete(msgs, filterOld);\n }\n throw new TypeError('MESSAGE_BULK_DELETE_TYPE');\n }\n\n static applyToClass(structure, full = false, ignore = []) {\n const props = ['send'];\n if (full) {\n props.push(\n 'lastMessage',\n 'lastPinAt',\n 'bulkDelete',\n 'startTyping',\n 'stopTyping',\n 'typing',\n 'typingCount',\n 'createMessageCollector',\n 'awaitMessages',\n );\n }\n for (const prop of props) {\n if (ignore.includes(prop)) continue;\n Object.defineProperty(\n structure.prototype,\n prop,\n Object.getOwnPropertyDescriptor(TextBasedChannel.prototype, prop),\n );\n }\n }\n}\n\nmodule.exports = TextBasedChannel;\n\n// Fixes Circular\nconst MessageManager = __webpack_require__(/*! ../../managers/MessageManager */ \"./src/managers/MessageManager.js\");\n\n\n//# sourceURL=webpack://Discord/./src/structures/interfaces/TextBasedChannel.js?")},"./src/util/ActivityFlags.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BitField = __webpack_require__(/*! ./BitField */ "./src/util/BitField.js");\n\n/**\n * Data structure that makes it easy to interact with an {@link Activity#flags} bitfield.\n * @extends {BitField}\n */\nclass ActivityFlags extends BitField {}\n\n/**\n * @name ActivityFlags\n * @kind constructor\n * @memberof ActivityFlags\n * @param {BitFieldResolvable} [bits=0] Bit(s) to read from\n */\n\n/**\n * Numeric activity flags. All available properties:\n * * `INSTANCE`\n * * `JOIN`\n * * `SPECTATE`\n * * `JOIN_REQUEST`\n * * `SYNC`\n * * `PLAY`\n * @type {Object}\n * @see {@link https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags}\n */\nActivityFlags.FLAGS = {\n INSTANCE: 1 << 0,\n JOIN: 1 << 1,\n SPECTATE: 1 << 2,\n JOIN_REQUEST: 1 << 3,\n SYNC: 1 << 4,\n PLAY: 1 << 5,\n};\n\nmodule.exports = ActivityFlags;\n\n\n//# sourceURL=webpack://Discord/./src/util/ActivityFlags.js?')},"./src/util/BitField.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst { RangeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\n\n/**\n * Data structure that makes it easy to interact with a bitfield.\n */\nclass BitField {\n /**\n * @param {BitFieldResolvable} [bits=0] Bit(s) to read from\n */\n constructor(bits) {\n /**\n * Bitfield of the packed bits\n * @type {number}\n */\n this.bitfield = this.constructor.resolve(bits);\n }\n\n /**\n * Checks whether the bitfield has a bit, or any of multiple bits.\n * @param {BitFieldResolvable} bit Bit(s) to check for\n * @returns {boolean}\n */\n any(bit) {\n return (this.bitfield & this.constructor.resolve(bit)) !== 0;\n }\n\n /**\n * Checks if this bitfield equals another\n * @param {BitFieldResolvable} bit Bit(s) to check for\n * @returns {boolean}\n */\n equals(bit) {\n return this.bitfield === this.constructor.resolve(bit);\n }\n\n /**\n * Checks whether the bitfield has a bit, or multiple bits.\n * @param {BitFieldResolvable} bit Bit(s) to check for\n * @returns {boolean}\n */\n has(bit) {\n if (Array.isArray(bit)) return bit.every(p => this.has(p));\n bit = this.constructor.resolve(bit);\n return (this.bitfield & bit) === bit;\n }\n\n /**\n * Gets all given bits that are missing from the bitfield.\n * @param {BitFieldResolvable} bits Bit(s) to check for\n * @param {...*} hasParams Additional parameters for the has method, if any\n * @returns {string[]}\n */\n missing(bits, ...hasParams) {\n if (!Array.isArray(bits)) bits = new this.constructor(bits).toArray(false);\n return bits.filter(p => !this.has(p, ...hasParams));\n }\n\n /**\n * Freezes these bits, making them immutable.\n * @returns {Readonly<BitField>} These bits\n */\n freeze() {\n return Object.freeze(this);\n }\n\n /**\n * Adds bits to these ones.\n * @param {...BitFieldResolvable} [bits] Bits to add\n * @returns {BitField} These bits or new BitField if the instance is frozen.\n */\n add(...bits) {\n let total = 0;\n for (const bit of bits) {\n total |= this.constructor.resolve(bit);\n }\n if (Object.isFrozen(this)) return new this.constructor(this.bitfield | total);\n this.bitfield |= total;\n return this;\n }\n\n /**\n * Removes bits from these.\n * @param {...BitFieldResolvable} [bits] Bits to remove\n * @returns {BitField} These bits or new BitField if the instance is frozen.\n */\n remove(...bits) {\n let total = 0;\n for (const bit of bits) {\n total |= this.constructor.resolve(bit);\n }\n if (Object.isFrozen(this)) return new this.constructor(this.bitfield & ~total);\n this.bitfield &= ~total;\n return this;\n }\n\n /**\n * Gets an object mapping field names to a {@link boolean} indicating whether the\n * bit is available.\n * @param {...*} hasParams Additional parameters for the has method, if any\n * @returns {Object}\n */\n serialize(...hasParams) {\n const serialized = {};\n for (const [flag, bit] of Object.entries(this.constructor.FLAGS)) serialized[flag] = this.has(bit, ...hasParams);\n return serialized;\n }\n\n /**\n * Gets an {@link Array} of bitfield names based on the bits available.\n * @param {...*} hasParams Additional parameters for the has method, if any\n * @returns {string[]}\n */\n toArray(...hasParams) {\n return Object.keys(this.constructor.FLAGS).filter(bit => this.has(bit, ...hasParams));\n }\n\n toJSON() {\n return this.bitfield;\n }\n\n valueOf() {\n return this.bitfield;\n }\n\n *[Symbol.iterator]() {\n yield* this.toArray();\n }\n\n /**\n * Data that can be resolved to give a bitfield. This can be:\n * * A string (see {@link BitField.FLAGS})\n * * A bit number\n * * An instance of BitField\n * * An Array of BitFieldResolvable\n * @typedef {string|number|BitField|BitFieldResolvable[]} BitFieldResolvable\n */\n\n /**\n * Resolves bitfields to their numeric form.\n * @param {BitFieldResolvable} [bit=0] - bit(s) to resolve\n * @returns {number}\n */\n static resolve(bit = 0) {\n if (typeof bit === 'number' && bit >= 0) return bit;\n if (bit instanceof BitField) return bit.bitfield;\n if (Array.isArray(bit)) return bit.map(p => this.resolve(p)).reduce((prev, p) => prev | p, 0);\n if (typeof bit === 'string' && typeof this.FLAGS[bit] !== 'undefined') return this.FLAGS[bit];\n const error = new RangeError('BITFIELD_INVALID');\n error.bit = bit;\n throw error;\n }\n}\n\n/**\n * Numeric bitfield flags.\n * <info>Defined in extension classes</info>\n * @type {Object}\n * @abstract\n */\nBitField.FLAGS = {};\n\nmodule.exports = BitField;\n\n\n//# sourceURL=webpack://Discord/./src/util/BitField.js?")},"./src/util/Collection.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BaseCollection = __webpack_require__(/*! @discordjs/collection */ "./node_modules/@discordjs/collection/dist/index.js");\nconst Util = __webpack_require__(/*! ./Util */ "./src/util/Util.js");\n\nclass Collection extends BaseCollection {\n toJSON() {\n return this.map(e => (typeof e.toJSON === \'function\' ? e.toJSON() : Util.flatten(e)));\n }\n}\n\nmodule.exports = Collection;\n\n/**\n * @external Collection\n * @see {@link https://discord.js.org/#/docs/collection/master/class/Collection}\n */\n\n\n//# sourceURL=webpack://Discord/./src/util/Collection.js?')},"./src/util/Constants.js":function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nconst Package = (exports.Package = __webpack_require__(/*! ../../package.json */ \"./package.json\"));\nconst { Error, RangeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst browser = (exports.browser = typeof window !== 'undefined');\n\n/**\n * Options for a client.\n * @typedef {Object} ClientOptions\n * @property {number|number[]|string} [shards] ID of the shard to run, or an array of shard IDs. If not specified,\n * the client will spawn {@link ClientOptions#shardCount} shards. If set to `auto`, it will fetch the\n * recommended amount of shards from Discord and spawn that amount\n * @property {number} [shardCount=1] The total amount of shards used by all processes of this bot\n * (e.g. recommended shard count, shard count of the ShardingManager)\n * @property {number} [messageCacheMaxSize=200] Maximum number of messages to cache per channel\n * (-1 or Infinity for unlimited - don't do this without message sweeping, otherwise memory usage will climb\n * indefinitely)\n * @property {number} [messageCacheLifetime=0] How long a message should stay in the cache until it is considered\n * sweepable (in seconds, 0 for forever)\n * @property {number} [messageSweepInterval=0] How frequently to remove messages from the cache that are older than\n * the message cache lifetime (in seconds, 0 for never)\n * @property {boolean} [fetchAllMembers=false] Whether to cache all guild members and users upon startup, as well as\n * upon joining a guild (should be avoided whenever possible)\n * @property {DisableMentionType} [disableMentions='none'] Default value for {@link MessageOptions#disableMentions}\n * @property {MessageMentionOptions} [allowedMentions] Default value for {@link MessageOptions#allowedMentions}\n * @property {PartialType[]} [partials] Structures allowed to be partial. This means events can be emitted even when\n * they're missing all the data for a particular structure. See the \"Partials\" topic listed in the sidebar for some\n * important usage information, as partials require you to put checks in place when handling data.\n * @property {number} [restWsBridgeTimeout=5000] Maximum time permitted between REST responses and their\n * corresponding websocket events\n * @property {number} [restTimeOffset=500] Extra time in millseconds to wait before continuing to make REST\n * requests (higher values will reduce rate-limiting errors on bad connections)\n * @property {number} [restRequestTimeout=15000] Time to wait before cancelling a REST request, in milliseconds\n * @property {number} [restSweepInterval=60] How frequently to delete inactive request buckets, in seconds\n * (or 0 for never)\n * @property {number} [retryLimit=1] How many times to retry on 5XX errors (Infinity for indefinite amount of retries)\n * @property {PresenceData} [presence] Presence data to use upon login\n * @property {WebsocketOptions} [ws] Options for the WebSocket\n * @property {HTTPOptions} [http] HTTP options\n */\nexports.DefaultOptions = {\n shardCount: 1,\n messageCacheMaxSize: 200,\n messageCacheLifetime: 0,\n messageSweepInterval: 0,\n fetchAllMembers: false,\n disableMentions: 'none',\n partials: [],\n restWsBridgeTimeout: 5000,\n restRequestTimeout: 15000,\n retryLimit: 1,\n restTimeOffset: 500,\n restSweepInterval: 60,\n presence: {},\n\n /**\n * WebSocket options (these are left as snake_case to match the API)\n * @typedef {Object} WebsocketOptions\n * @property {number} [large_threshold=50] Number of members in a guild after which offline users will no longer be\n * sent in the initial guild member list, must be between 50 and 250\n * @property {IntentsResolvable} [intents] Intents to enable for this connection\n */\n ws: {\n large_threshold: 50,\n compress: false,\n properties: {\n $os: browser ? 'browser' : process.platform,\n $browser: 'discord.js',\n $device: 'discord.js',\n },\n version: 6,\n },\n\n /**\n * HTTP options\n * @typedef {Object} HTTPOptions\n * @property {number} [version=7] API version to use\n * @property {string} [api='https://discord.com/api'] Base url of the API\n * @property {string} [cdn='https://cdn.discordapp.com'] Base url of the CDN\n * @property {string} [invite='https://discord.gg'] Base url of invites\n */\n http: {\n version: 7,\n api: 'https://discordapp.com/api',\n cdn: 'https://cdn.discordapp.com',\n invite: 'https://discord.gg',\n },\n};\n\nexports.UserAgent = browser\n ? null\n : `DiscordBot (${Package.homepage.split('#')[0]}, ${Package.version}) Node.js/${process.version}`;\n\nexports.WSCodes = {\n 1000: 'WS_CLOSE_REQUESTED',\n 4004: 'TOKEN_INVALID',\n 4010: 'SHARDING_INVALID',\n 4011: 'SHARDING_REQUIRED',\n 4013: 'INVALID_INTENTS',\n 4014: 'DISALLOWED_INTENTS',\n};\n\nconst AllowedImageFormats = ['webp', 'png', 'jpg', 'jpeg', 'gif'];\n\nconst AllowedImageSizes = Array.from({ length: 9 }, (e, i) => 2 ** (i + 4));\n\nfunction makeImageUrl(root, { format = 'webp', size } = {}) {\n if (format && !AllowedImageFormats.includes(format)) throw new Error('IMAGE_FORMAT', format);\n if (size && !AllowedImageSizes.includes(size)) throw new RangeError('IMAGE_SIZE', size);\n return `${root}.${format}${size ? `?size=${size}` : ''}`;\n}\n/**\n * Options for Image URLs.\n * @typedef {Object} ImageURLOptions\n * @property {string} [format] One of `webp`, `png`, `jpg`, `jpeg`, `gif`. If no format is provided,\n * defaults to `webp`.\n * @property {boolean} [dynamic] If true, the format will dynamically change to `gif` for\n * animated avatars; the default is false.\n * @property {number} [size] One of `16`, `32`, `64`, `128`, `256`, `512`, `1024`, `2048`, `4096`\n */\n\nexports.Endpoints = {\n CDN(root) {\n return {\n Emoji: (emojiID, format = 'png') => `${root}/emojis/${emojiID}.${format}`,\n Asset: name => `${root}/assets/${name}`,\n DefaultAvatar: discriminator => `${root}/embed/avatars/${discriminator}.png`,\n Avatar: (userID, hash, format = 'webp', size, dynamic = false) => {\n if (dynamic) format = hash.startsWith('a_') ? 'gif' : format;\n return makeImageUrl(`${root}/avatars/${userID}/${hash}`, { format, size });\n },\n Banner: (guildID, hash, format = 'webp', size) =>\n makeImageUrl(`${root}/banners/${guildID}/${hash}`, { format, size }),\n Icon: (guildID, hash, format = 'webp', size, dynamic = false) => {\n if (dynamic) format = hash.startsWith('a_') ? 'gif' : format;\n return makeImageUrl(`${root}/icons/${guildID}/${hash}`, { format, size });\n },\n AppIcon: (clientID, hash, { format = 'webp', size } = {}) =>\n makeImageUrl(`${root}/app-icons/${clientID}/${hash}`, { size, format }),\n AppAsset: (clientID, hash, { format = 'webp', size } = {}) =>\n makeImageUrl(`${root}/app-assets/${clientID}/${hash}`, { size, format }),\n GDMIcon: (channelID, hash, format = 'webp', size) =>\n makeImageUrl(`${root}/channel-icons/${channelID}/${hash}`, { size, format }),\n Splash: (guildID, hash, format = 'webp', size) =>\n makeImageUrl(`${root}/splashes/${guildID}/${hash}`, { size, format }),\n DiscoverySplash: (guildID, hash, format = 'webp', size) =>\n makeImageUrl(`${root}/discovery-splashes/${guildID}/${hash}`, { size, format }),\n TeamIcon: (teamID, hash, { format = 'webp', size } = {}) =>\n makeImageUrl(`${root}/team-icons/${teamID}/${hash}`, { size, format }),\n };\n },\n invite: (root, code) => `${root}/${code}`,\n botGateway: '/gateway/bot',\n};\n\n/**\n * The current status of the client. Here are the available statuses:\n * * READY: 0\n * * CONNECTING: 1\n * * RECONNECTING: 2\n * * IDLE: 3\n * * NEARLY: 4\n * * DISCONNECTED: 5\n * * WAITING_FOR_GUILDS: 6\n * * IDENTIFYING: 7\n * * RESUMING: 8\n * @typedef {number} Status\n */\nexports.Status = {\n READY: 0,\n CONNECTING: 1,\n RECONNECTING: 2,\n IDLE: 3,\n NEARLY: 4,\n DISCONNECTED: 5,\n WAITING_FOR_GUILDS: 6,\n IDENTIFYING: 7,\n RESUMING: 8,\n};\n\n/**\n * The current status of a voice connection. Here are the available statuses:\n * * CONNECTED: 0\n * * CONNECTING: 1\n * * AUTHENTICATING: 2\n * * RECONNECTING: 3\n * * DISCONNECTED: 4\n * @typedef {number} VoiceStatus\n */\nexports.VoiceStatus = {\n CONNECTED: 0,\n CONNECTING: 1,\n AUTHENTICATING: 2,\n RECONNECTING: 3,\n DISCONNECTED: 4,\n};\n\nexports.OPCodes = {\n DISPATCH: 0,\n HEARTBEAT: 1,\n IDENTIFY: 2,\n STATUS_UPDATE: 3,\n VOICE_STATE_UPDATE: 4,\n VOICE_GUILD_PING: 5,\n RESUME: 6,\n RECONNECT: 7,\n REQUEST_GUILD_MEMBERS: 8,\n INVALID_SESSION: 9,\n HELLO: 10,\n HEARTBEAT_ACK: 11,\n};\n\nexports.VoiceOPCodes = {\n IDENTIFY: 0,\n SELECT_PROTOCOL: 1,\n READY: 2,\n HEARTBEAT: 3,\n SESSION_DESCRIPTION: 4,\n SPEAKING: 5,\n HELLO: 8,\n CLIENT_CONNECT: 12,\n CLIENT_DISCONNECT: 13,\n};\n\nexports.Events = {\n RATE_LIMIT: 'rateLimit',\n CLIENT_READY: 'ready',\n GUILD_CREATE: 'guildCreate',\n GUILD_DELETE: 'guildDelete',\n GUILD_UPDATE: 'guildUpdate',\n GUILD_UNAVAILABLE: 'guildUnavailable',\n GUILD_AVAILABLE: 'guildAvailable',\n GUILD_MEMBER_ADD: 'guildMemberAdd',\n GUILD_MEMBER_REMOVE: 'guildMemberRemove',\n GUILD_MEMBER_UPDATE: 'guildMemberUpdate',\n GUILD_MEMBER_AVAILABLE: 'guildMemberAvailable',\n GUILD_MEMBER_SPEAKING: 'guildMemberSpeaking',\n GUILD_MEMBERS_CHUNK: 'guildMembersChunk',\n GUILD_INTEGRATIONS_UPDATE: 'guildIntegrationsUpdate',\n GUILD_ROLE_CREATE: 'roleCreate',\n GUILD_ROLE_DELETE: 'roleDelete',\n INVITE_CREATE: 'inviteCreate',\n INVITE_DELETE: 'inviteDelete',\n GUILD_ROLE_UPDATE: 'roleUpdate',\n GUILD_EMOJI_CREATE: 'emojiCreate',\n GUILD_EMOJI_DELETE: 'emojiDelete',\n GUILD_EMOJI_UPDATE: 'emojiUpdate',\n GUILD_BAN_ADD: 'guildBanAdd',\n GUILD_BAN_REMOVE: 'guildBanRemove',\n CHANNEL_CREATE: 'channelCreate',\n CHANNEL_DELETE: 'channelDelete',\n CHANNEL_UPDATE: 'channelUpdate',\n CHANNEL_PINS_UPDATE: 'channelPinsUpdate',\n MESSAGE_CREATE: 'message',\n MESSAGE_DELETE: 'messageDelete',\n MESSAGE_UPDATE: 'messageUpdate',\n MESSAGE_BULK_DELETE: 'messageDeleteBulk',\n MESSAGE_REACTION_ADD: 'messageReactionAdd',\n MESSAGE_REACTION_REMOVE: 'messageReactionRemove',\n MESSAGE_REACTION_REMOVE_ALL: 'messageReactionRemoveAll',\n MESSAGE_REACTION_REMOVE_EMOJI: 'messageReactionRemoveEmoji',\n USER_UPDATE: 'userUpdate',\n PRESENCE_UPDATE: 'presenceUpdate',\n VOICE_SERVER_UPDATE: 'voiceServerUpdate',\n VOICE_STATE_UPDATE: 'voiceStateUpdate',\n VOICE_BROADCAST_SUBSCRIBE: 'subscribe',\n VOICE_BROADCAST_UNSUBSCRIBE: 'unsubscribe',\n TYPING_START: 'typingStart',\n TYPING_STOP: 'typingStop',\n WEBHOOKS_UPDATE: 'webhookUpdate',\n ERROR: 'error',\n WARN: 'warn',\n DEBUG: 'debug',\n SHARD_DISCONNECT: 'shardDisconnect',\n SHARD_ERROR: 'shardError',\n SHARD_RECONNECTING: 'shardReconnecting',\n SHARD_READY: 'shardReady',\n SHARD_RESUME: 'shardResume',\n INVALIDATED: 'invalidated',\n RAW: 'raw',\n};\n\nexports.ShardEvents = {\n CLOSE: 'close',\n DESTROYED: 'destroyed',\n INVALID_SESSION: 'invalidSession',\n READY: 'ready',\n RESUMED: 'resumed',\n ALL_READY: 'allReady',\n};\n\n/**\n * The type of Structure allowed to be a partial:\n * * USER\n * * CHANNEL (only affects DMChannels)\n * * GUILD_MEMBER\n * * MESSAGE\n * * REACTION\n * <warn>Partials require you to put checks in place when handling data, read the Partials topic listed in the\n * sidebar for more information.</warn>\n * @typedef {string} PartialType\n */\nexports.PartialTypes = keyMirror(['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE', 'REACTION']);\n\n/**\n * The type of a websocket message event, e.g. `MESSAGE_CREATE`. Here are the available events:\n * * READY\n * * RESUMED\n * * GUILD_CREATE\n * * GUILD_DELETE\n * * GUILD_UPDATE\n * * INVITE_CREATE\n * * INVITE_DELETE\n * * GUILD_MEMBER_ADD\n * * GUILD_MEMBER_REMOVE\n * * GUILD_MEMBER_UPDATE\n * * GUILD_MEMBERS_CHUNK\n * * GUILD_INTEGRATIONS_UPDATE\n * * GUILD_ROLE_CREATE\n * * GUILD_ROLE_DELETE\n * * GUILD_ROLE_UPDATE\n * * GUILD_BAN_ADD\n * * GUILD_BAN_REMOVE\n * * GUILD_EMOJIS_UPDATE\n * * CHANNEL_CREATE\n * * CHANNEL_DELETE\n * * CHANNEL_UPDATE\n * * CHANNEL_PINS_UPDATE\n * * MESSAGE_CREATE\n * * MESSAGE_DELETE\n * * MESSAGE_UPDATE\n * * MESSAGE_DELETE_BULK\n * * MESSAGE_REACTION_ADD\n * * MESSAGE_REACTION_REMOVE\n * * MESSAGE_REACTION_REMOVE_ALL\n * * MESSAGE_REACTION_REMOVE_EMOJI\n * * USER_UPDATE\n * * PRESENCE_UPDATE\n * * TYPING_START\n * * VOICE_STATE_UPDATE\n * * VOICE_SERVER_UPDATE\n * * WEBHOOKS_UPDATE\n * @typedef {string} WSEventType\n */\nexports.WSEvents = keyMirror([\n 'READY',\n 'RESUMED',\n 'GUILD_CREATE',\n 'GUILD_DELETE',\n 'GUILD_UPDATE',\n 'INVITE_CREATE',\n 'INVITE_DELETE',\n 'GUILD_MEMBER_ADD',\n 'GUILD_MEMBER_REMOVE',\n 'GUILD_MEMBER_UPDATE',\n 'GUILD_MEMBERS_CHUNK',\n 'GUILD_INTEGRATIONS_UPDATE',\n 'GUILD_ROLE_CREATE',\n 'GUILD_ROLE_DELETE',\n 'GUILD_ROLE_UPDATE',\n 'GUILD_BAN_ADD',\n 'GUILD_BAN_REMOVE',\n 'GUILD_EMOJIS_UPDATE',\n 'CHANNEL_CREATE',\n 'CHANNEL_DELETE',\n 'CHANNEL_UPDATE',\n 'CHANNEL_PINS_UPDATE',\n 'MESSAGE_CREATE',\n 'MESSAGE_DELETE',\n 'MESSAGE_UPDATE',\n 'MESSAGE_DELETE_BULK',\n 'MESSAGE_REACTION_ADD',\n 'MESSAGE_REACTION_REMOVE',\n 'MESSAGE_REACTION_REMOVE_ALL',\n 'MESSAGE_REACTION_REMOVE_EMOJI',\n 'USER_UPDATE',\n 'PRESENCE_UPDATE',\n 'TYPING_START',\n 'VOICE_STATE_UPDATE',\n 'VOICE_SERVER_UPDATE',\n 'WEBHOOKS_UPDATE',\n]);\n\n/**\n * The type of a message, e.g. `DEFAULT`. Here are the available types:\n * * DEFAULT\n * * RECIPIENT_ADD\n * * RECIPIENT_REMOVE\n * * CALL\n * * CHANNEL_NAME_CHANGE\n * * CHANNEL_ICON_CHANGE\n * * PINS_ADD\n * * GUILD_MEMBER_JOIN\n * * USER_PREMIUM_GUILD_SUBSCRIPTION\n * * USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1\n * * USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2\n * * USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3\n * * CHANNEL_FOLLOW_ADD\n * * GUILD_DISCOVERY_DISQUALIFIED\n * * GUILD_DISCOVERY_REQUALIFIED\n * @typedef {string} MessageType\n */\nexports.MessageTypes = [\n 'DEFAULT',\n 'RECIPIENT_ADD',\n 'RECIPIENT_REMOVE',\n 'CALL',\n 'CHANNEL_NAME_CHANGE',\n 'CHANNEL_ICON_CHANGE',\n 'PINS_ADD',\n 'GUILD_MEMBER_JOIN',\n 'USER_PREMIUM_GUILD_SUBSCRIPTION',\n 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1',\n 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2',\n 'USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3',\n 'CHANNEL_FOLLOW_ADD',\n null,\n 'GUILD_DISCOVERY_DISQUALIFIED',\n 'GUILD_DISCOVERY_REQUALIFIED',\n];\n\n/**\n * <info>Bots cannot set a `CUSTOM_STATUS`, it is only for custom statuses received from users</info>\n * The type of an activity of a users presence, e.g. `PLAYING`. Here are the available types:\n * * PLAYING\n * * STREAMING\n * * LISTENING\n * * WATCHING\n * * CUSTOM_STATUS\n * @typedef {string} ActivityType\n */\nexports.ActivityTypes = ['PLAYING', 'STREAMING', 'LISTENING', 'WATCHING', 'CUSTOM_STATUS'];\n\nexports.ChannelTypes = {\n TEXT: 0,\n DM: 1,\n VOICE: 2,\n GROUP: 3,\n CATEGORY: 4,\n NEWS: 5,\n STORE: 6,\n};\n\nexports.ClientApplicationAssetTypes = {\n SMALL: 1,\n BIG: 2,\n};\n\nexports.Colors = {\n DEFAULT: 0x000000,\n WHITE: 0xffffff,\n AQUA: 0x1abc9c,\n GREEN: 0x2ecc71,\n BLUE: 0x3498db,\n YELLOW: 0xffff00,\n PURPLE: 0x9b59b6,\n LUMINOUS_VIVID_PINK: 0xe91e63,\n GOLD: 0xf1c40f,\n ORANGE: 0xe67e22,\n RED: 0xe74c3c,\n GREY: 0x95a5a6,\n NAVY: 0x34495e,\n DARK_AQUA: 0x11806a,\n DARK_GREEN: 0x1f8b4c,\n DARK_BLUE: 0x206694,\n DARK_PURPLE: 0x71368a,\n DARK_VIVID_PINK: 0xad1457,\n DARK_GOLD: 0xc27c0e,\n DARK_ORANGE: 0xa84300,\n DARK_RED: 0x992d22,\n DARK_GREY: 0x979c9f,\n DARKER_GREY: 0x7f8c8d,\n LIGHT_GREY: 0xbcc0c0,\n DARK_NAVY: 0x2c3e50,\n BLURPLE: 0x7289da,\n GREYPLE: 0x99aab5,\n DARK_BUT_NOT_BLACK: 0x2c2f33,\n NOT_QUITE_BLACK: 0x23272a,\n};\n\n/**\n * The value set for the explicit content filter levels for a guild:\n * * DISABLED\n * * MEMBERS_WITHOUT_ROLES\n * * ALL_MEMBERS\n * @typedef {string} ExplicitContentFilterLevel\n */\nexports.ExplicitContentFilterLevels = ['DISABLED', 'MEMBERS_WITHOUT_ROLES', 'ALL_MEMBERS'];\n\n/**\n * The value set for the verification levels for a guild:\n * * NONE\n * * LOW\n * * MEDIUM\n * * HIGH\n * * VERY_HIGH\n * @typedef {string} VerificationLevel\n */\nexports.VerificationLevels = ['NONE', 'LOW', 'MEDIUM', 'HIGH', 'VERY_HIGH'];\n\n/**\n * An error encountered while performing an API request. Here are the potential errors:\n * * UNKNOWN_ACCOUNT\n * * UNKNOWN_APPLICATION\n * * UNKNOWN_CHANNEL\n * * UNKNOWN_GUILD\n * * UNKNOWN_INTEGRATION\n * * UNKNOWN_INVITE\n * * UNKNOWN_MEMBER\n * * UNKNOWN_MESSAGE\n * * UNKNOWN_OVERWRITE\n * * UNKNOWN_PROVIDER\n * * UNKNOWN_ROLE\n * * UNKNOWN_TOKEN\n * * UNKNOWN_USER\n * * UNKNOWN_EMOJI\n * * UNKNOWN_WEBHOOK\n * * BOT_PROHIBITED_ENDPOINT\n * * BOT_ONLY_ENDPOINT\n * * MAXIMUM_GUILDS\n * * MAXIMUM_FRIENDS\n * * MAXIMUM_PINS\n * * MAXIMUM_ROLES\n * * MAXIMUM_REACTIONS\n * * MAXIMUM_CHANNELS\n * * MAXIMUM_INVITES\n * * UNAUTHORIZED\n * * USER_BANNED\n * * MISSING_ACCESS\n * * INVALID_ACCOUNT_TYPE\n * * CANNOT_EXECUTE_ON_DM\n * * EMBED_DISABLED\n * * CANNOT_EDIT_MESSAGE_BY_OTHER\n * * CANNOT_SEND_EMPTY_MESSAGE\n * * CANNOT_MESSAGE_USER\n * * CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL\n * * CHANNEL_VERIFICATION_LEVEL_TOO_HIGH\n * * OAUTH2_APPLICATION_BOT_ABSENT\n * * MAXIMUM_OAUTH2_APPLICATIONS\n * * INVALID_OAUTH_STATE\n * * MISSING_PERMISSIONS\n * * INVALID_AUTHENTICATION_TOKEN\n * * NOTE_TOO_LONG\n * * INVALID_BULK_DELETE_QUANTITY\n * * CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL\n * * INVALID_OR_TAKEN_INVITE_CODE\n * * CANNOT_EXECUTE_ON_SYSTEM_MESSAGE\n * * INVALID_OAUTH_TOKEN\n * * BULK_DELETE_MESSAGE_TOO_OLD\n * * INVALID_FORM_BODY\n * * INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT\n * * INVALID_API_VERSION\n * * REACTION_BLOCKED\n * * RESOURCE_OVERLOADED\n * @typedef {string} APIError\n */\nexports.APIErrors = {\n UNKNOWN_ACCOUNT: 10001,\n UNKNOWN_APPLICATION: 10002,\n UNKNOWN_CHANNEL: 10003,\n UNKNOWN_GUILD: 10004,\n UNKNOWN_INTEGRATION: 10005,\n UNKNOWN_INVITE: 10006,\n UNKNOWN_MEMBER: 10007,\n UNKNOWN_MESSAGE: 10008,\n UNKNOWN_OVERWRITE: 10009,\n UNKNOWN_PROVIDER: 10010,\n UNKNOWN_ROLE: 10011,\n UNKNOWN_TOKEN: 10012,\n UNKNOWN_USER: 10013,\n UNKNOWN_EMOJI: 10014,\n UNKNOWN_WEBHOOK: 10015,\n BOT_PROHIBITED_ENDPOINT: 20001,\n BOT_ONLY_ENDPOINT: 20002,\n MAXIMUM_GUILDS: 30001,\n MAXIMUM_FRIENDS: 30002,\n MAXIMUM_PINS: 30003,\n MAXIMUM_ROLES: 30005,\n MAXIMUM_REACTIONS: 30010,\n MAXIMUM_CHANNELS: 30013,\n MAXIMUM_INVITES: 30016,\n UNAUTHORIZED: 40001,\n USER_BANNED: 40007,\n MISSING_ACCESS: 50001,\n INVALID_ACCOUNT_TYPE: 50002,\n CANNOT_EXECUTE_ON_DM: 50003,\n EMBED_DISABLED: 50004,\n CANNOT_EDIT_MESSAGE_BY_OTHER: 50005,\n CANNOT_SEND_EMPTY_MESSAGE: 50006,\n CANNOT_MESSAGE_USER: 50007,\n CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL: 50008,\n CHANNEL_VERIFICATION_LEVEL_TOO_HIGH: 50009,\n OAUTH2_APPLICATION_BOT_ABSENT: 50010,\n MAXIMUM_OAUTH2_APPLICATIONS: 50011,\n INVALID_OAUTH_STATE: 50012,\n MISSING_PERMISSIONS: 50013,\n INVALID_AUTHENTICATION_TOKEN: 50014,\n NOTE_TOO_LONG: 50015,\n INVALID_BULK_DELETE_QUANTITY: 50016,\n CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL: 50019,\n INVALID_OR_TAKEN_INVITE_CODE: 50020,\n CANNOT_EXECUTE_ON_SYSTEM_MESSAGE: 50021,\n INVALID_OAUTH_TOKEN: 50025,\n BULK_DELETE_MESSAGE_TOO_OLD: 50034,\n INVALID_FORM_BODY: 50035,\n INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT: 50036,\n INVALID_API_VERSION: 50041,\n REACTION_BLOCKED: 90001,\n RESOURCE_OVERLOADED: 130000,\n};\n\n/**\n * The value set for a guild's default message notifications, e.g. `ALL`. Here are the available types:\n * * ALL\n * * MENTIONS\n * @typedef {string} DefaultMessageNotifications\n */\nexports.DefaultMessageNotifications = ['ALL', 'MENTIONS'];\n\n/**\n * The value set for a team members's membership state:\n * * INVITED\n * * ACCEPTED\n * @typedef {string} MembershipStates\n */\nexports.MembershipStates = [\n // They start at 1\n null,\n 'INVITED',\n 'ACCEPTED',\n];\n\n/**\n * The value set for a webhook's type:\n * * Incoming\n * * Channel Follower\n * @typedef {string} WebhookTypes\n */\nexports.WebhookTypes = [\n // They start at 1\n null,\n 'Incoming',\n 'Channel Follower',\n];\n\nfunction keyMirror(arr) {\n let tmp = Object.create(null);\n for (const value of arr) tmp[value] = value;\n return tmp;\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://Discord/./src/util/Constants.js?")},"./src/util/DataResolver.js":function(module,exports,__webpack_require__){"use strict";eval('/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst fs = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js");\nconst path = __webpack_require__(/*! path */ "./node_modules/node-libs-browser/mock/empty.js");\nconst stream = __webpack_require__(/*! stream */ "./node_modules/stream-browserify/index.js");\nconst fetch = __webpack_require__(/*! node-fetch */ "./node_modules/node-fetch/browser.js");\nconst { Error: DiscordError, TypeError } = __webpack_require__(/*! ../errors */ "./src/errors/index.js");\nconst { browser } = __webpack_require__(/*! ../util/Constants */ "./src/util/Constants.js");\nconst Util = __webpack_require__(/*! ../util/Util */ "./src/util/Util.js");\n\n/**\n * The DataResolver identifies different objects and tries to resolve a specific piece of information from them.\n * @private\n */\nclass DataResolver {\n constructor() {\n throw new Error(`The ${this.constructor.name} class may not be instantiated.`);\n }\n\n /**\n * Data that can be resolved to give an invite code. This can be:\n * * An invite code\n * * An invite URL\n * @typedef {string} InviteResolvable\n */\n\n /**\n * Resolves InviteResolvable to an invite code.\n * @param {InviteResolvable} data The invite resolvable to resolve\n * @returns {string}\n */\n static resolveInviteCode(data) {\n const inviteRegex = /discord(?:(?:app)?\\.com\\/invite|\\.gg(?:\\/invite)?)\\/([\\w-]{2,255})/i;\n const match = inviteRegex.exec(data);\n if (match && match[1]) return match[1];\n return data;\n }\n\n /**\n * Resolves a Base64Resolvable, a string, or a BufferResolvable to a Base 64 image.\n * @param {BufferResolvable|Base64Resolvable} image The image to be resolved\n * @returns {Promise<?string>}\n */\n static async resolveImage(image) {\n if (!image) return null;\n if (typeof image === \'string\' && image.startsWith(\'data:\')) {\n return image;\n }\n const file = await this.resolveFileAsBuffer(image);\n return DataResolver.resolveBase64(file);\n }\n\n /**\n * Data that resolves to give a Base64 string, typically for image uploading. This can be:\n * * A Buffer\n * * A base64 string\n * @typedef {Buffer|string} Base64Resolvable\n */\n\n /**\n * Resolves a Base64Resolvable to a Base 64 image.\n * @param {Base64Resolvable} data The base 64 resolvable you want to resolve\n * @returns {?string}\n */\n static resolveBase64(data) {\n if (Buffer.isBuffer(data)) return `data:image/jpg;base64,${data.toString(\'base64\')}`;\n return data;\n }\n\n /**\n * Data that can be resolved to give a Buffer. This can be:\n * * A Buffer\n * * The path to a local file\n * * A URL\n * @typedef {string|Buffer} BufferResolvable\n */\n\n /**\n * @external Stream\n * @see {@link https://nodejs.org/api/stream.html}\n */\n\n /**\n * Resolves a BufferResolvable to a Buffer or a Stream.\n * @param {BufferResolvable|Stream} resource The buffer or stream resolvable to resolve\n * @returns {Promise<Buffer|Stream>}\n */\n static async resolveFile(resource) {\n if (!browser && Buffer.isBuffer(resource)) return resource;\n if (browser && resource instanceof ArrayBuffer) return Util.convertToBuffer(resource);\n // eslint-disable-next-line no-undef\n if (browser && resource instanceof Blob) return resource;\n if (resource instanceof stream.Readable) return resource;\n\n if (typeof resource === \'string\') {\n if (/^https?:\\/\\//.test(resource)) {\n const res = await fetch(resource);\n return browser ? res.blob() : res.body;\n } else if (!browser) {\n return new Promise((resolve, reject) => {\n const file = path.resolve(resource);\n fs.stat(file, (err, stats) => {\n if (err) return reject(err);\n if (!stats.isFile()) return reject(new DiscordError(\'FILE_NOT_FOUND\', file));\n return resolve(fs.createReadStream(file));\n });\n });\n }\n }\n\n throw new TypeError(\'REQ_RESOURCE_TYPE\');\n }\n\n /**\n * Resolves a BufferResolvable to a Buffer.\n * @param {BufferResolvable|Stream} resource The buffer or stream resolvable to resolve\n * @returns {Promise<Buffer>}\n */\n static async resolveFileAsBuffer(resource) {\n const file = await this.resolveFile(resource);\n if (Buffer.isBuffer(file)) return file;\n\n const buffers = [];\n for await (const data of file) buffers.push(data);\n return Buffer.concat(buffers);\n }\n}\n\nmodule.exports = DataResolver;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/buffer/index.js */ "./node_modules/buffer/index.js").Buffer))\n\n//# sourceURL=webpack://Discord/./src/util/DataResolver.js?')},"./src/util/Intents.js":function(module,exports,__webpack_require__){"use strict";eval('\nconst BitField = __webpack_require__(/*! ./BitField */ "./src/util/BitField.js");\n\n/**\n * Data structure that makes it easy to calculate intents.\n * @extends {BitField}\n */\nclass Intents extends BitField {}\n\n/**\n * @name Intents\n * @kind constructor\n * @memberof Intents\n * @param {IntentsResolvable} [bits=0] Bit(s) to read from\n */\n\n/**\n * Data that can be resolved to give a permission number. This can be:\n * * A string (see {@link Intents.FLAGS})\n * * An intents flag\n * * An instance of Intents\n * * An array of IntentsResolvable\n * @typedef {string|number|Intents|IntentsResolvable[]} IntentsResolvable\n */\n\n/**\n * Numeric websocket intents. All available properties:\n * * `GUILDS`\n * * `GUILD_MEMBERS`\n * * `GUILD_BANS`\n * * `GUILD_EMOJIS`\n * * `GUILD_INTEGRATIONS`\n * * `GUILD_WEBHOOKS`\n * * `GUILD_INVITES`\n * * `GUILD_VOICE_STATES`\n * * `GUILD_PRESENCES`\n * * `GUILD_MESSAGES`\n * * `GUILD_MESSAGE_REACTIONS`\n * * `GUILD_MESSAGE_TYPING`\n * * `DIRECT_MESSAGES`\n * * `DIRECT_MESSAGE_REACTIONS`\n * * `DIRECT_MESSAGE_TYPING`\n * @type {Object}\n * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents}\n */\nIntents.FLAGS = {\n GUILDS: 1 << 0,\n GUILD_MEMBERS: 1 << 1,\n GUILD_BANS: 1 << 2,\n GUILD_EMOJIS: 1 << 3,\n GUILD_INTEGRATIONS: 1 << 4,\n GUILD_WEBHOOKS: 1 << 5,\n GUILD_INVITES: 1 << 6,\n GUILD_VOICE_STATES: 1 << 7,\n GUILD_PRESENCES: 1 << 8,\n GUILD_MESSAGES: 1 << 9,\n GUILD_MESSAGE_REACTIONS: 1 << 10,\n GUILD_MESSAGE_TYPING: 1 << 11,\n DIRECT_MESSAGES: 1 << 12,\n DIRECT_MESSAGE_REACTIONS: 1 << 13,\n DIRECT_MESSAGE_TYPING: 1 << 14,\n};\n\n/**\n * Bitfield representing all privileged intents\n * @type {number}\n * @see {@link https://discord.com/developers/docs/topics/gateway#privileged-intents}\n */\nIntents.PRIVILEGED = Intents.FLAGS.GUILD_MEMBERS | Intents.FLAGS.GUILD_PRESENCES;\n\n/**\n * Bitfield representing all intents combined\n * @type {number}\n */\nIntents.ALL = Object.values(Intents.FLAGS).reduce((acc, p) => acc | p, 0);\n\n/**\n * Bitfield representing all non-privileged intents\n * @type {number}\n */\nIntents.NON_PRIVILEGED = Intents.ALL & ~Intents.PRIVILEGED;\n\nmodule.exports = Intents;\n\n\n//# sourceURL=webpack://Discord/./src/util/Intents.js?')},"./src/util/LimitedCollection.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst Collection = __webpack_require__(/*! ./Collection.js */ "./src/util/Collection.js");\n\n/**\n * A Collection which holds a max amount of entries. The first key is deleted if the Collection has\n * reached max size.\n * @extends {Collection}\n * @param {number} [maxSize=0] The maximum size of the Collection\n * @param {Iterable} [iterable=null] Optional entries passed to the Map constructor.\n * @private\n */\nclass LimitedCollection extends Collection {\n constructor(maxSize = 0, iterable = null) {\n super(iterable);\n /**\n * The max size of the Collection.\n * @type {number}\n */\n this.maxSize = maxSize;\n }\n\n set(key, value) {\n if (this.maxSize === 0) return this;\n if (this.size >= this.maxSize && !this.has(key)) this.delete(this.firstKey());\n return super.set(key, value);\n }\n\n static get [Symbol.species]() {\n return Collection;\n }\n}\n\nmodule.exports = LimitedCollection;\n\n\n//# sourceURL=webpack://Discord/./src/util/LimitedCollection.js?')},"./src/util/MessageFlags.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BitField = __webpack_require__(/*! ./BitField */ "./src/util/BitField.js");\n\n/**\n * Data structure that makes it easy to interact with an {@link Message#flags} bitfield.\n * @extends {BitField}\n */\nclass MessageFlags extends BitField {}\n\n/**\n * @name MessageFlags\n * @kind constructor\n * @memberof MessageFlags\n * @param {BitFieldResolvable} [bits=0] Bit(s) to read from\n */\n\n/**\n * Numeric message flags. All available properties:\n * * `CROSSPOSTED`\n * * `IS_CROSSPOST`\n * * `SUPPRESS_EMBEDS`\n * * `SOURCE_MESSAGE_DELETED`\n * * `URGENT`\n * @type {Object}\n * @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-flags}\n */\nMessageFlags.FLAGS = {\n CROSSPOSTED: 1 << 0,\n IS_CROSSPOST: 1 << 1,\n SUPPRESS_EMBEDS: 1 << 2,\n SOURCE_MESSAGE_DELETED: 1 << 3,\n URGENT: 1 << 4,\n};\n\nmodule.exports = MessageFlags;\n\n\n//# sourceURL=webpack://Discord/./src/util/MessageFlags.js?')},"./src/util/Permissions.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BitField = __webpack_require__(/*! ./BitField */ "./src/util/BitField.js");\n\n/**\n * Data structure that makes it easy to interact with a permission bitfield. All {@link GuildMember}s have a set of\n * permissions in their guild, and each channel in the guild may also have {@link PermissionOverwrites} for the member\n * that override their default permissions.\n * @extends {BitField}\n */\nclass Permissions extends BitField {\n /**\n * @name Permissions\n * @kind constructor\n * @memberof Permissions\n * @param {PermissionResolvable} [bits=0] Bit(s) to read from\n */\n\n /**\n * Data that can be resolved to give a permission number. This can be:\n * * A string (see {@link Permissions.FLAGS})\n * * A permission number\n * * An instance of Permissions\n * * An Array of PermissionResolvable\n * @typedef {string|number|Permissions|PermissionResolvable[]} PermissionResolvable\n */\n\n /**\n * Checks whether the bitfield has a permission, or any of multiple permissions.\n * @param {PermissionResolvable} permission Permission(s) to check for\n * @param {boolean} [checkAdmin=true] Whether to allow the administrator permission to override\n * @returns {boolean}\n */\n any(permission, checkAdmin = true) {\n return (checkAdmin && super.has(this.constructor.FLAGS.ADMINISTRATOR)) || super.any(permission);\n }\n\n /**\n * Checks whether the bitfield has a permission, or multiple permissions.\n * @param {PermissionResolvable} permission Permission(s) to check for\n * @param {boolean} [checkAdmin=true] Whether to allow the administrator permission to override\n * @returns {boolean}\n */\n has(permission, checkAdmin = true) {\n return (checkAdmin && super.has(this.constructor.FLAGS.ADMINISTRATOR)) || super.has(permission);\n }\n}\n\n/**\n * Numeric permission flags. All available properties:\n * * `ADMINISTRATOR` (implicitly has *all* permissions, and bypasses all channel overwrites)\n * * `CREATE_INSTANT_INVITE` (create invitations to the guild)\n * * `KICK_MEMBERS`\n * * `BAN_MEMBERS`\n * * `MANAGE_CHANNELS` (edit and reorder channels)\n * * `MANAGE_GUILD` (edit the guild information, region, etc.)\n * * `ADD_REACTIONS` (add new reactions to messages)\n * * `VIEW_AUDIT_LOG`\n * * `PRIORITY_SPEAKER`\n * * `STREAM`\n * * `VIEW_CHANNEL`\n * * `SEND_MESSAGES`\n * * `SEND_TTS_MESSAGES`\n * * `MANAGE_MESSAGES` (delete messages and reactions)\n * * `EMBED_LINKS` (links posted will have a preview embedded)\n * * `ATTACH_FILES`\n * * `READ_MESSAGE_HISTORY` (view messages that were posted prior to opening Discord)\n * * `MENTION_EVERYONE`\n * * `USE_EXTERNAL_EMOJIS` (use emojis from different guilds)\n * * `VIEW_GUILD_INSIGHTS`\n * * `CONNECT` (connect to a voice channel)\n * * `SPEAK` (speak in a voice channel)\n * * `MUTE_MEMBERS` (mute members across all voice channels)\n * * `DEAFEN_MEMBERS` (deafen members across all voice channels)\n * * `MOVE_MEMBERS` (move members between voice channels)\n * * `USE_VAD` (use voice activity detection)\n * * `CHANGE_NICKNAME`\n * * `MANAGE_NICKNAMES` (change other members\' nicknames)\n * * `MANAGE_ROLES`\n * * `MANAGE_WEBHOOKS`\n * * `MANAGE_EMOJIS`\n * @type {Object}\n * @see {@link https://discord.com/developers/docs/topics/permissions}\n */\nPermissions.FLAGS = {\n CREATE_INSTANT_INVITE: 1 << 0,\n KICK_MEMBERS: 1 << 1,\n BAN_MEMBERS: 1 << 2,\n ADMINISTRATOR: 1 << 3,\n MANAGE_CHANNELS: 1 << 4,\n MANAGE_GUILD: 1 << 5,\n ADD_REACTIONS: 1 << 6,\n VIEW_AUDIT_LOG: 1 << 7,\n PRIORITY_SPEAKER: 1 << 8,\n STREAM: 1 << 9,\n VIEW_CHANNEL: 1 << 10,\n SEND_MESSAGES: 1 << 11,\n SEND_TTS_MESSAGES: 1 << 12,\n MANAGE_MESSAGES: 1 << 13,\n EMBED_LINKS: 1 << 14,\n ATTACH_FILES: 1 << 15,\n READ_MESSAGE_HISTORY: 1 << 16,\n MENTION_EVERYONE: 1 << 17,\n USE_EXTERNAL_EMOJIS: 1 << 18,\n VIEW_GUILD_INSIGHTS: 1 << 19,\n CONNECT: 1 << 20,\n SPEAK: 1 << 21,\n MUTE_MEMBERS: 1 << 22,\n DEAFEN_MEMBERS: 1 << 23,\n MOVE_MEMBERS: 1 << 24,\n USE_VAD: 1 << 25,\n CHANGE_NICKNAME: 1 << 26,\n MANAGE_NICKNAMES: 1 << 27,\n MANAGE_ROLES: 1 << 28,\n MANAGE_WEBHOOKS: 1 << 29,\n MANAGE_EMOJIS: 1 << 30,\n};\n\n/**\n * Bitfield representing every permission combined\n * @type {number}\n */\nPermissions.ALL = Object.values(Permissions.FLAGS).reduce((all, p) => all | p, 0);\n\n/**\n * Bitfield representing the default permissions for users\n * @type {number}\n */\nPermissions.DEFAULT = 104324673;\n\nmodule.exports = Permissions;\n\n\n//# sourceURL=webpack://Discord/./src/util/Permissions.js?')},"./src/util/Snowflake.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Util = __webpack_require__(/*! ../util/Util */ \"./src/util/Util.js\");\n\n// Discord epoch (2015-01-01T00:00:00.000Z)\nconst EPOCH = 1420070400000;\nlet INCREMENT = 0;\n\n/**\n * A container for useful snowflake-related methods.\n */\nclass SnowflakeUtil {\n constructor() {\n throw new Error(`The ${this.constructor.name} class may not be instantiated.`);\n }\n\n /**\n * A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z\n * ```\n * If we have a snowflake '266241948824764416' we can represent it as binary:\n *\n * 64 22 17 12 0\n * 000000111011000111100001101001000101000000 00001 00000 000000000000\n * number of ms since Discord epoch worker pid increment\n * ```\n * @typedef {string} Snowflake\n */\n\n /**\n * Generates a Discord snowflake.\n * <info>This hardcodes the worker ID as 1 and the process ID as 0.</info>\n * @param {number|Date} [timestamp=Date.now()] Timestamp or date of the snowflake to generate\n * @returns {Snowflake} The generated snowflake\n */\n static generate(timestamp = Date.now()) {\n if (timestamp instanceof Date) timestamp = timestamp.getTime();\n if (typeof timestamp !== 'number' || isNaN(timestamp)) {\n throw new TypeError(\n `\"timestamp\" argument must be a number (received ${isNaN(timestamp) ? 'NaN' : typeof timestamp})`,\n );\n }\n if (INCREMENT >= 4095) INCREMENT = 0;\n // eslint-disable-next-line max-len\n const BINARY = `${(timestamp - EPOCH).toString(2).padStart(42, '0')}0000100000${(INCREMENT++)\n .toString(2)\n .padStart(12, '0')}`;\n return Util.binaryToID(BINARY);\n }\n\n /**\n * A deconstructed snowflake.\n * @typedef {Object} DeconstructedSnowflake\n * @property {number} timestamp Timestamp the snowflake was created\n * @property {Date} date Date the snowflake was created\n * @property {number} workerID Worker ID in the snowflake\n * @property {number} processID Process ID in the snowflake\n * @property {number} increment Increment in the snowflake\n * @property {string} binary Binary representation of the snowflake\n */\n\n /**\n * Deconstructs a Discord snowflake.\n * @param {Snowflake} snowflake Snowflake to deconstruct\n * @returns {DeconstructedSnowflake} Deconstructed snowflake\n */\n static deconstruct(snowflake) {\n const BINARY = Util.idToBinary(snowflake).toString(2).padStart(64, '0');\n const res = {\n timestamp: parseInt(BINARY.substring(0, 42), 2) + EPOCH,\n workerID: parseInt(BINARY.substring(42, 47), 2),\n processID: parseInt(BINARY.substring(47, 52), 2),\n increment: parseInt(BINARY.substring(52, 64), 2),\n binary: BINARY,\n };\n Object.defineProperty(res, 'date', {\n get: function get() {\n return new Date(this.timestamp);\n },\n enumerable: true,\n });\n return res;\n }\n}\n\nmodule.exports = SnowflakeUtil;\n\n\n//# sourceURL=webpack://Discord/./src/util/Snowflake.js?")},"./src/util/Speaking.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BitField = __webpack_require__(/*! ./BitField */ "./src/util/BitField.js");\n\n/**\n * Data structure that makes it easy to interact with a {@link VoiceConnection#speaking}\n * and {@link guildMemberSpeaking} event bitfields.\n * @extends {BitField}\n */\nclass Speaking extends BitField {}\n\n/**\n * @name Speaking\n * @kind constructor\n * @memberof Speaking\n * @param {BitFieldResolvable} [bits=0] Bit(s) to read from\n */\n\n/**\n * Numeric speaking flags. All available properties:\n * * `SPEAKING`\n * * `SOUNDSHARE`\n * * `PRIORITY_SPEAKING`\n * @type {Object}\n * @see {@link https://discord.com/developers/docs/topics/voice-connections#speaking}\n */\nSpeaking.FLAGS = {\n SPEAKING: 1 << 0,\n SOUNDSHARE: 1 << 1,\n PRIORITY_SPEAKING: 1 << 2,\n};\n\nmodule.exports = Speaking;\n\n\n//# sourceURL=webpack://Discord/./src/util/Speaking.js?')},"./src/util/Structures.js":function(module,exports,__webpack_require__){"use strict";eval('\n\n/**\n * An extendable structure:\n * * **`GuildEmoji`**\n * * **`DMChannel`**\n * * **`TextChannel`**\n * * **`VoiceChannel`**\n * * **`CategoryChannel`**\n * * **`NewsChannel`**\n * * **`StoreChannel`**\n * * **`GuildMember`**\n * * **`Guild`**\n * * **`Message`**\n * * **`MessageReaction`**\n * * **`Presence`**\n * * **`ClientPresence`**\n * * **`VoiceState`**\n * * **`Role`**\n * * **`User`**\n * @typedef {string} ExtendableStructure\n */\n\n/**\n * Allows for the extension of built-in Discord.js structures that are instantiated by {@link BaseManager Managers}.\n */\nclass Structures {\n constructor() {\n throw new Error(`The ${this.constructor.name} class may not be instantiated.`);\n }\n\n /**\n * Retrieves a structure class.\n * @param {string} structure Name of the structure to retrieve\n * @returns {Function}\n */\n static get(structure) {\n if (typeof structure === \'string\') return structures[structure];\n throw new TypeError(`"structure" argument must be a string (received ${typeof structure})`);\n }\n\n /**\n * Extends a structure.\n * <warn> Make sure to extend all structures before instantiating your client.\n * Extending after doing so may not work as expected. </warn>\n * @param {ExtendableStructure} structure Name of the structure class to extend\n * @param {Function} extender Function that takes the base class to extend as its only parameter and returns the\n * extended class/prototype\n * @returns {Function} Extended class/prototype returned from the extender\n * @example\n * const { Structures } = require(\'discord.js\');\n *\n * Structures.extend(\'Guild\', Guild => {\n * class CoolGuild extends Guild {\n * constructor(client, data) {\n * super(client, data);\n * this.cool = true;\n * }\n * }\n *\n * return CoolGuild;\n * });\n */\n static extend(structure, extender) {\n if (!structures[structure]) throw new RangeError(`"${structure}" is not a valid extensible structure.`);\n if (typeof extender !== \'function\') {\n const received = `(received ${typeof extender})`;\n throw new TypeError(\n `"extender" argument must be a function that returns the extended structure class/prototype ${received}.`,\n );\n }\n\n const extended = extender(structures[structure]);\n if (typeof extended !== \'function\') {\n const received = `(received ${typeof extended})`;\n throw new TypeError(`The extender function must return the extended structure class/prototype ${received}.`);\n }\n\n if (!(extended.prototype instanceof structures[structure])) {\n const prototype = Object.getPrototypeOf(extended);\n const received = `${extended.name || \'unnamed\'}${prototype.name ? ` extends ${prototype.name}` : \'\'}`;\n throw new Error(\n \'The class/prototype returned from the extender function must extend the existing structure class/prototype\' +\n ` (received function ${received}; expected extension of ${structures[structure].name}).`,\n );\n }\n\n structures[structure] = extended;\n return extended;\n }\n}\n\nconst structures = {\n GuildEmoji: __webpack_require__(/*! ../structures/GuildEmoji */ "./src/structures/GuildEmoji.js"),\n DMChannel: __webpack_require__(/*! ../structures/DMChannel */ "./src/structures/DMChannel.js"),\n TextChannel: __webpack_require__(/*! ../structures/TextChannel */ "./src/structures/TextChannel.js"),\n VoiceChannel: __webpack_require__(/*! ../structures/VoiceChannel */ "./src/structures/VoiceChannel.js"),\n CategoryChannel: __webpack_require__(/*! ../structures/CategoryChannel */ "./src/structures/CategoryChannel.js"),\n NewsChannel: __webpack_require__(/*! ../structures/NewsChannel */ "./src/structures/NewsChannel.js"),\n StoreChannel: __webpack_require__(/*! ../structures/StoreChannel */ "./src/structures/StoreChannel.js"),\n GuildMember: __webpack_require__(/*! ../structures/GuildMember */ "./src/structures/GuildMember.js"),\n Guild: __webpack_require__(/*! ../structures/Guild */ "./src/structures/Guild.js"),\n Message: __webpack_require__(/*! ../structures/Message */ "./src/structures/Message.js"),\n MessageReaction: __webpack_require__(/*! ../structures/MessageReaction */ "./src/structures/MessageReaction.js"),\n Presence: __webpack_require__(/*! ../structures/Presence */ "./src/structures/Presence.js").Presence,\n ClientPresence: __webpack_require__(/*! ../structures/ClientPresence */ "./src/structures/ClientPresence.js"),\n VoiceState: __webpack_require__(/*! ../structures/VoiceState */ "./src/structures/VoiceState.js"),\n Role: __webpack_require__(/*! ../structures/Role */ "./src/structures/Role.js"),\n User: __webpack_require__(/*! ../structures/User */ "./src/structures/User.js"),\n};\n\nmodule.exports = Structures;\n\n\n//# sourceURL=webpack://Discord/./src/util/Structures.js?')},"./src/util/SystemChannelFlags.js":function(module,exports,__webpack_require__){"use strict";eval('\n\nconst BitField = __webpack_require__(/*! ./BitField */ "./src/util/BitField.js");\n\n/**\n * Data structure that makes it easy to interact with a {@link Guild#systemChannelFlags} bitfield.\n * <info>Note that all event message types are enabled by default,\n * and by setting their corresponding flags you are disabling them</info>\n * @extends {BitField}\n */\nclass SystemChannelFlags extends BitField {}\n\n/**\n * @name SystemChannelFlags\n * @kind constructor\n * @memberof SystemChannelFlags\n * @param {SystemChannelFlagsResolvable} [bits=0] Bit(s) to read from\n */\n\n/**\n * Data that can be resolved to give a sytem channel flag bitfield. This can be:\n * * A string (see {@link SystemChannelFlags.FLAGS})\n * * A sytem channel flag\n * * An instance of SystemChannelFlags\n * * An Array of SystemChannelFlagsResolvable\n * @typedef {string|number|SystemChannelFlags|SystemChannelFlagsResolvable[]} SystemChannelFlagsResolvable\n */\n\n/**\n * Numeric system channel flags. All available properties:\n * * `WELCOME_MESSAGE_DISABLED`\n * * `BOOST_MESSAGE_DISABLED`\n * @type {Object}\n */\nSystemChannelFlags.FLAGS = {\n WELCOME_MESSAGE_DISABLED: 1 << 0,\n BOOST_MESSAGE_DISABLED: 1 << 1,\n};\n\nmodule.exports = SystemChannelFlags;\n\n\n//# sourceURL=webpack://Discord/./src/util/SystemChannelFlags.js?')},"./src/util/UserFlags.js":function(module,exports,__webpack_require__){"use strict";eval('\nconst BitField = __webpack_require__(/*! ./BitField */ "./src/util/BitField.js");\n\n/**\n * Data structure that makes it easy to interact with a {@link User#flags} bitfield.\n * @extends {BitField}\n */\nclass UserFlags extends BitField {}\n\n/**\n * @name UserFlags\n * @kind constructor\n * @memberof UserFlags\n * @param {BitFieldResolvable} [bits=0] Bit(s) to read from\n */\n\n/**\n * Numeric user flags. All available properties:\n * * `DISCORD_EMPLOYEE`\n * * `DISCORD_PARTNER`\n * * `HYPESQUAD_EVENTS`\n * * `BUGHUNTER_LEVEL_1`\n * * `HOUSE_BRAVERY`\n * * `HOUSE_BRILLIANCE`\n * * `HOUSE_BALANCE`\n * * `EARLY_SUPPORTER`\n * * `TEAM_USER`\n * * `SYSTEM`\n * * `BUGHUNTER_LEVEL_2`\n * * `VERIFIED_BOT`\n * * `VERIFIED_DEVELOPER`\n * @type {Object}\n * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-flags}\n */\nUserFlags.FLAGS = {\n DISCORD_EMPLOYEE: 1 << 0,\n DISCORD_PARTNER: 1 << 1,\n HYPESQUAD_EVENTS: 1 << 2,\n BUGHUNTER_LEVEL_1: 1 << 3,\n HOUSE_BRAVERY: 1 << 6,\n HOUSE_BRILLIANCE: 1 << 7,\n HOUSE_BALANCE: 1 << 8,\n EARLY_SUPPORTER: 1 << 9,\n TEAM_USER: 1 << 10,\n SYSTEM: 1 << 12,\n BUGHUNTER_LEVEL_2: 1 << 14,\n VERIFIED_BOT: 1 << 16,\n VERIFIED_DEVELOPER: 1 << 17,\n};\n\nmodule.exports = UserFlags;\n\n\n//# sourceURL=webpack://Discord/./src/util/UserFlags.js?')},"./src/util/Util.js":function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst { parse } = __webpack_require__(/*! path */ \"./node_modules/node-libs-browser/mock/empty.js\");\nconst fetch = __webpack_require__(/*! node-fetch */ \"./node_modules/node-fetch/browser.js\");\nconst { Colors, DefaultOptions, Endpoints } = __webpack_require__(/*! ./Constants */ \"./src/util/Constants.js\");\nconst { Error: DiscordError, RangeError, TypeError } = __webpack_require__(/*! ../errors */ \"./src/errors/index.js\");\nconst has = (o, k) => Object.prototype.hasOwnProperty.call(o, k);\nconst isObject = d => typeof d === 'object' && d !== null;\n\n/**\n * Contains various general-purpose utility methods. These functions are also available on the base `Discord` object.\n */\nclass Util {\n constructor() {\n throw new Error(`The ${this.constructor.name} class may not be instantiated.`);\n }\n\n /**\n * Flatten an object. Any properties that are collections will get converted to an array of keys.\n * @param {Object} obj The object to flatten.\n * @param {...Object<string, boolean|string>} [props] Specific properties to include/exclude.\n * @returns {Object}\n */\n static flatten(obj, ...props) {\n if (!isObject(obj)) return obj;\n\n const objProps = Object.keys(obj)\n .filter(k => !k.startsWith('_'))\n .map(k => ({ [k]: true }));\n\n props = objProps.length ? Object.assign(...objProps, ...props) : Object.assign({}, ...props);\n\n const out = {};\n\n for (let [prop, newProp] of Object.entries(props)) {\n if (!newProp) continue;\n newProp = newProp === true ? prop : newProp;\n\n const element = obj[prop];\n const elemIsObj = isObject(element);\n const valueOf = elemIsObj && typeof element.valueOf === 'function' ? element.valueOf() : null;\n\n // If it's a Collection, make the array of keys\n if (element instanceof __webpack_require__(/*! ./Collection */ \"./src/util/Collection.js\")) out[newProp] = Array.from(element.keys());\n // If the valueOf is a Collection, use its array of keys\n else if (valueOf instanceof __webpack_require__(/*! ./Collection */ \"./src/util/Collection.js\")) out[newProp] = Array.from(valueOf.keys());\n // If it's an array, flatten each element\n else if (Array.isArray(element)) out[newProp] = element.map(e => Util.flatten(e));\n // If it's an object with a primitive `valueOf`, use that value\n else if (typeof valueOf !== 'object') out[newProp] = valueOf;\n // If it's a primitive\n else if (!elemIsObj) out[newProp] = element;\n }\n\n return out;\n }\n\n /**\n * Splits a string into multiple chunks at a designated character that do not exceed a specific length.\n * @param {StringResolvable} text Content to split\n * @param {SplitOptions} [options] Options controlling the behavior of the split\n * @returns {string[]}\n */\n static splitMessage(text, { maxLength = 2000, char = '\\n', prepend = '', append = '' } = {}) {\n text = Util.resolveString(text);\n if (text.length <= maxLength) return [text];\n const splitText = text.split(char);\n if (splitText.some(chunk => chunk.length > maxLength)) throw new RangeError('SPLIT_MAX_LEN');\n const messages = [];\n let msg = '';\n for (const chunk of splitText) {\n if (msg && (msg + char + chunk + append).length > maxLength) {\n messages.push(msg + append);\n msg = prepend;\n }\n msg += (msg && msg !== prepend ? char : '') + chunk;\n }\n return messages.concat(msg).filter(m => m);\n }\n\n /**\n * Escapes any Discord-flavour markdown in a string.\n * @param {string} text Content to escape\n * @param {Object} [options={}] What types of markdown to escape\n * @param {boolean} [options.codeBlock=true] Whether to escape code blocks or not\n * @param {boolean} [options.inlineCode=true] Whether to escape inline code or not\n * @param {boolean} [options.bold=true] Whether to escape bolds or not\n * @param {boolean} [options.italic=true] Whether to escape italics or not\n * @param {boolean} [options.underline=true] Whether to escape underlines or not\n * @param {boolean} [options.strikethrough=true] Whether to escape strikethroughs or not\n * @param {boolean} [options.spoiler=true] Whether to escape spoilers or not\n * @param {boolean} [options.codeBlockContent=true] Whether to escape text inside code blocks or not\n * @param {boolean} [options.inlineCodeContent=true] Whether to escape text inside inline code or not\n * @returns {string}\n */\n static escapeMarkdown(\n text,\n {\n codeBlock = true,\n inlineCode = true,\n bold = true,\n italic = true,\n underline = true,\n strikethrough = true,\n spoiler = true,\n codeBlockContent = true,\n inlineCodeContent = true,\n } = {},\n ) {\n if (!codeBlockContent) {\n return text\n .split('```')\n .map((subString, index, array) => {\n if (index % 2 && index !== array.length - 1) return subString;\n return Util.escapeMarkdown(subString, {\n inlineCode,\n bold,\n italic,\n underline,\n strikethrough,\n spoiler,\n inlineCodeContent,\n });\n })\n .join(codeBlock ? '\\\\`\\\\`\\\\`' : '```');\n }\n if (!inlineCodeContent) {\n return text\n .split(/(?<=^|[^`])`(?=[^`]|$)/g)\n .map((subString, index, array) => {\n if (index % 2 && index !== array.length - 1) return subString;\n return Util.escapeMarkdown(subString, {\n codeBlock,\n bold,\n italic,\n underline,\n strikethrough,\n spoiler,\n });\n })\n .join(inlineCode ? '\\\\`' : '`');\n }\n if (inlineCode) text = Util.escapeInlineCode(text);\n if (codeBlock) text = Util.escapeCodeBlock(text);\n if (italic) text = Util.escapeItalic(text);\n if (bold) text = Util.escapeBold(text);\n if (underline) text = Util.escapeUnderline(text);\n if (strikethrough) text = Util.escapeStrikethrough(text);\n if (spoiler) text = Util.escapeSpoiler(text);\n return text;\n }\n\n /**\n * Escapes code block markdown in a string.\n * @param {string} text Content to escape\n * @returns {string}\n */\n static escapeCodeBlock(text) {\n return text.replace(/```/g, '\\\\`\\\\`\\\\`');\n }\n\n /**\n * Escapes inline code markdown in a string.\n * @param {string} text Content to escape\n * @returns {string}\n */\n static escapeInlineCode(text) {\n return text.replace(/(?<=^|[^`])`(?=[^`]|$)/g, '\\\\`');\n }\n\n /**\n * Escapes italic markdown in a string.\n * @param {string} text Content to escape\n * @returns {string}\n */\n static escapeItalic(text) {\n let i = 0;\n text = text.replace(/(?<=^|[^*])\\*([^*]|\\*\\*|$)/g, (_, match) => {\n if (match === '**') return ++i % 2 ? `\\\\*${match}` : `${match}\\\\*`;\n return `\\\\*${match}`;\n });\n i = 0;\n return text.replace(/(?<=^|[^_])_([^_]|__|$)/g, (_, match) => {\n if (match === '__') return ++i % 2 ? `\\\\_${match}` : `${match}\\\\_`;\n return `\\\\_${match}`;\n });\n }\n\n /**\n * Escapes bold markdown in a string.\n * @param {string} text Content to escape\n * @returns {string}\n */\n static escapeBold(text) {\n let i = 0;\n return text.replace(/\\*\\*(\\*)?/g, (_, match) => {\n if (match) return ++i % 2 ? `${match}\\\\*\\\\*` : `\\\\*\\\\*${match}`;\n return '\\\\*\\\\*';\n });\n }\n\n /**\n * Escapes underline markdown in a string.\n * @param {string} text Content to escape\n * @returns {string}\n */\n static escapeUnderline(text) {\n let i = 0;\n return text.replace(/__(_)?/g, (_, match) => {\n if (match) return ++i % 2 ? `${match}\\\\_\\\\_` : `\\\\_\\\\_${match}`;\n return '\\\\_\\\\_';\n });\n }\n\n /**\n * Escapes strikethrough markdown in a string.\n * @param {string} text Content to escape\n * @returns {string}\n */\n static escapeStrikethrough(text) {\n return text.replace(/~~/g, '\\\\~\\\\~');\n }\n\n /**\n * Escapes spoiler markdown in a string.\n * @param {string} text Content to escape\n * @returns {string}\n */\n static escapeSpoiler(text) {\n return text.replace(/\\|\\|/g, '\\\\|\\\\|');\n }\n\n /**\n * Gets the recommended shard count from Discord.\n * @param {string} token Discord auth token\n * @param {number} [guildsPerShard=1000] Number of guilds per shard\n * @returns {Promise<number>} The recommended number of shards\n */\n static fetchRecommendedShards(token, guildsPerShard = 1000) {\n if (!token) throw new DiscordError('TOKEN_MISSING');\n return fetch(`${DefaultOptions.http.api}/v${DefaultOptions.http.version}${Endpoints.botGateway}`, {\n method: 'GET',\n headers: { Authorization: `Bot ${token.replace(/^Bot\\s*/i, '')}` },\n })\n .then(res => {\n if (res.ok) return res.json();\n throw res;\n })\n .then(data => data.shards * (1000 / guildsPerShard));\n }\n\n /**\n * Parses emoji info out of a string. The string must be one of:\n * * A UTF-8 emoji (no ID)\n * * A URL-encoded UTF-8 emoji (no ID)\n * * A Discord custom emoji (`<:name:id>` or `<a:name:id>`)\n * @param {string} text Emoji string to parse\n * @returns {Object} Object with `animated`, `name`, and `id` properties\n * @private\n */\n static parseEmoji(text) {\n if (text.includes('%')) text = decodeURIComponent(text);\n if (!text.includes(':')) return { animated: false, name: text, id: null };\n const m = text.match(/<?(?:(a):)?(\\w{2,32}):(\\d{17,19})?>?/);\n if (!m) return null;\n return { animated: Boolean(m[1]), name: m[2], id: m[3] || null };\n }\n\n /**\n * Shallow-copies an object with its class/prototype intact.\n * @param {Object} obj Object to clone\n * @returns {Object}\n * @private\n */\n static cloneObject(obj) {\n return Object.assign(Object.create(obj), obj);\n }\n\n /**\n * Sets default properties on an object that aren't already specified.\n * @param {Object} def Default properties\n * @param {Object} given Object to assign defaults to\n * @returns {Object}\n * @private\n */\n static mergeDefault(def, given) {\n if (!given) return def;\n for (const key in def) {\n if (!has(given, key) || given[key] === undefined) {\n given[key] = def[key];\n } else if (given[key] === Object(given[key])) {\n given[key] = Util.mergeDefault(def[key], given[key]);\n }\n }\n\n return given;\n }\n\n /**\n * Converts an ArrayBuffer or string to a Buffer.\n * @param {ArrayBuffer|string} ab ArrayBuffer to convert\n * @returns {Buffer}\n * @private\n */\n static convertToBuffer(ab) {\n if (typeof ab === 'string') ab = Util.str2ab(ab);\n return Buffer.from(ab);\n }\n\n /**\n * Converts a string to an ArrayBuffer.\n * @param {string} str String to convert\n * @returns {ArrayBuffer}\n * @private\n */\n static str2ab(str) {\n const buffer = new ArrayBuffer(str.length * 2);\n const view = new Uint16Array(buffer);\n for (var i = 0, strLen = str.length; i < strLen; i++) view[i] = str.charCodeAt(i);\n return buffer;\n }\n\n /**\n * Makes an Error from a plain info object.\n * @param {Object} obj Error info\n * @param {string} obj.name Error type\n * @param {string} obj.message Message for the error\n * @param {string} obj.stack Stack for the error\n * @returns {Error}\n * @private\n */\n static makeError(obj) {\n const err = new Error(obj.message);\n err.name = obj.name;\n err.stack = obj.stack;\n return err;\n }\n\n /**\n * Makes a plain error info object from an Error.\n * @param {Error} err Error to get info from\n * @returns {Object}\n * @private\n */\n static makePlainError(err) {\n return {\n name: err.name,\n message: err.message,\n stack: err.stack,\n };\n }\n\n /**\n * Moves an element in an array *in place*.\n * @param {Array<*>} array Array to modify\n * @param {*} element Element to move\n * @param {number} newIndex Index or offset to move the element to\n * @param {boolean} [offset=false] Move the element by an offset amount rather than to a set index\n * @returns {number}\n * @private\n */\n static moveElementInArray(array, element, newIndex, offset = false) {\n const index = array.indexOf(element);\n newIndex = (offset ? index : 0) + newIndex;\n if (newIndex > -1 && newIndex < array.length) {\n const removedElement = array.splice(index, 1)[0];\n array.splice(newIndex, 0, removedElement);\n }\n return array.indexOf(element);\n }\n\n /**\n * Data that can be resolved to give a string. This can be:\n * * A string\n * * An array (joined with a new line delimiter to give a string)\n * * Any value\n * @typedef {string|Array|*} StringResolvable\n */\n\n /**\n * Resolves a StringResolvable to a string.\n * @param {StringResolvable} data The string resolvable to resolve\n * @returns {string}\n */\n static resolveString(data) {\n if (typeof data === 'string') return data;\n if (Array.isArray(data)) return data.join('\\n');\n return String(data);\n }\n\n /**\n * Can be a number, hex string, an RGB array like:\n * ```js\n * [255, 0, 255] // purple\n * ```\n * or one of the following strings:\n * - `DEFAULT`\n * - `WHITE`\n * - `AQUA`\n * - `GREEN`\n * - `BLUE`\n * - `YELLOW`\n * - `PURPLE`\n * - `LUMINOUS_VIVID_PINK`\n * - `GOLD`\n * - `ORANGE`\n * - `RED`\n * - `GREY`\n * - `DARKER_GREY`\n * - `NAVY`\n * - `DARK_AQUA`\n * - `DARK_GREEN`\n * - `DARK_BLUE`\n * - `DARK_PURPLE`\n * - `DARK_VIVID_PINK`\n * - `DARK_GOLD`\n * - `DARK_ORANGE`\n * - `DARK_RED`\n * - `DARK_GREY`\n * - `LIGHT_GREY`\n * - `DARK_NAVY`\n * - `BLURPLE`\n * - `GREYPLE`\n * - `DARK_BUT_NOT_BLACK`\n * - `NOT_QUITE_BLACK`\n * - `RANDOM`\n * @typedef {string|number|number[]} ColorResolvable\n */\n\n /**\n * Resolves a ColorResolvable into a color number.\n * @param {ColorResolvable} color Color to resolve\n * @returns {number} A color\n */\n static resolveColor(color) {\n if (typeof color === 'string') {\n if (color === 'RANDOM') return Math.floor(Math.random() * (0xffffff + 1));\n if (color === 'DEFAULT') return 0;\n color = Colors[color] || parseInt(color.replace('#', ''), 16);\n } else if (Array.isArray(color)) {\n color = (color[0] << 16) + (color[1] << 8) + color[2];\n }\n\n if (color < 0 || color > 0xffffff) throw new RangeError('COLOR_RANGE');\n else if (color && isNaN(color)) throw new TypeError('COLOR_CONVERT');\n\n return color;\n }\n\n /**\n * Sorts by Discord's position and ID.\n * @param {Collection} collection Collection of objects to sort\n * @returns {Collection}\n */\n static discordSort(collection) {\n return collection.sorted(\n (a, b) =>\n a.rawPosition - b.rawPosition ||\n parseInt(b.id.slice(0, -10)) - parseInt(a.id.slice(0, -10)) ||\n parseInt(b.id.slice(10)) - parseInt(a.id.slice(10)),\n );\n }\n\n /**\n * Sets the position of a Channel or Role.\n * @param {Channel|Role} item Object to set the position of\n * @param {number} position New position for the object\n * @param {boolean} relative Whether `position` is relative to its current position\n * @param {Collection<string, Channel|Role>} sorted A collection of the objects sorted properly\n * @param {APIRouter} route Route to call PATCH on\n * @param {string} [reason] Reason for the change\n * @returns {Promise<Object[]>} Updated item list, with `id` and `position` properties\n * @private\n */\n static setPosition(item, position, relative, sorted, route, reason) {\n let updatedItems = sorted.array();\n Util.moveElementInArray(updatedItems, item, position, relative);\n updatedItems = updatedItems.map((r, i) => ({ id: r.id, position: i }));\n return route.patch({ data: updatedItems, reason }).then(() => updatedItems);\n }\n\n /**\n * Alternative to Node's `path.basename`, removing query string after the extension if it exists.\n * @param {string} path Path to get the basename of\n * @param {string} [ext] File extension to remove\n * @returns {string} Basename of the path\n * @private\n */\n static basename(path, ext) {\n let res = parse(path);\n return ext && res.ext.startsWith(ext) ? res.name : res.base.split('?')[0];\n }\n\n /**\n * Transforms a snowflake from a decimal string to a bit string.\n * @param {Snowflake} num Snowflake to be transformed\n * @returns {string}\n * @private\n */\n static idToBinary(num) {\n let bin = '';\n let high = parseInt(num.slice(0, -10)) || 0;\n let low = parseInt(num.slice(-10));\n while (low > 0 || high > 0) {\n bin = String(low & 1) + bin;\n low = Math.floor(low / 2);\n if (high > 0) {\n low += 5000000000 * (high % 2);\n high = Math.floor(high / 2);\n }\n }\n return bin;\n }\n\n /**\n * Transforms a snowflake from a bit string to a decimal string.\n * @param {string} num Bit string to be transformed\n * @returns {Snowflake}\n * @private\n */\n static binaryToID(num) {\n let dec = '';\n\n while (num.length > 50) {\n const high = parseInt(num.slice(0, -32), 2);\n const low = parseInt((high % 10).toString(2) + num.slice(-32), 2);\n\n dec = (low % 10).toString() + dec;\n num =\n Math.floor(high / 10).toString(2) +\n Math.floor(low / 10)\n .toString(2)\n .padStart(32, '0');\n }\n\n num = parseInt(num, 2);\n while (num > 0) {\n dec = (num % 10).toString() + dec;\n num = Math.floor(num / 10);\n }\n\n return dec;\n }\n\n /**\n * Breaks user, role and everyone/here mentions by adding a zero width space after every @ character\n * @param {string} str The string to sanitize\n * @returns {string}\n */\n static removeMentions(str) {\n return str.replace(/@/g, '@\\u200b');\n }\n\n /**\n * The content to have all mentions replaced by the equivalent text.\n * @param {string} str The string to be converted\n * @param {Message} message The message object to reference\n * @returns {string}\n */\n static cleanContent(str, message) {\n str = str\n .replace(/<@!?[0-9]+>/g, input => {\n const id = input.replace(/<|!|>|@/g, '');\n if (message.channel.type === 'dm') {\n const user = message.client.users.cache.get(id);\n return user ? Util.removeMentions(`@${user.username}`) : input;\n }\n\n const member = message.channel.guild.members.cache.get(id);\n if (member) {\n return Util.removeMentions(`@${member.displayName}`);\n } else {\n const user = message.client.users.cache.get(id);\n return user ? Util.removeMentions(`@${user.username}`) : input;\n }\n })\n .replace(/<#[0-9]+>/g, input => {\n const channel = message.client.channels.cache.get(input.replace(/<|#|>/g, ''));\n return channel ? `#${channel.name}` : input;\n })\n .replace(/<@&[0-9]+>/g, input => {\n if (message.channel.type === 'dm') return input;\n const role = message.guild.roles.cache.get(input.replace(/<|@|>|&/g, ''));\n return role ? `@${role.name}` : input;\n });\n if (message.client.options.disableMentions === 'everyone') {\n str = str.replace(/@([^<>@ ]*)/gmsu, (match, target) => {\n if (target.match(/^[&!]?\\d+$/)) {\n return `@${target}`;\n } else {\n return `@\\u200b${target}`;\n }\n });\n }\n if (message.client.options.disableMentions === 'all') {\n return Util.removeMentions(str);\n } else {\n return str;\n }\n }\n\n /**\n * The content to put in a codeblock with all codeblock fences replaced by the equivalent backticks.\n * @param {string} text The string to be converted\n * @returns {string}\n */\n static cleanCodeBlockContent(text) {\n return text.replace(/```/g, '`\\u200b``');\n }\n\n /**\n * Creates a Promise that resolves after a specified duration.\n * @param {number} ms How long to wait before resolving (in milliseconds)\n * @returns {Promise<void>}\n * @private\n */\n static delayFor(ms) {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n }\n}\n\nmodule.exports = Util;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/buffer/index.js */ \"./node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack://Discord/./src/util/Util.js?")},0:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/https_(ignored)?")},1:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/util_(ignored)?")},10:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/./sharding/ShardClientUtil_(ignored)?")},11:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/./sharding/ShardingManager_(ignored)?")},2:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/util_(ignored)?")},3:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/./voice/ClientVoiceManager_(ignored)?")},4:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/erlpack_(ignored)?")},5:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/ws_(ignored)?")},6:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/zlib-sync_(ignored)?")},7:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/../sharding/ShardClientUtil_(ignored)?")},8:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/worker_threads_(ignored)?")},9:function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://Discord/./sharding/Shard_(ignored)?")}})}));