mirror of
https://github.com/danbulant/discord.js
synced 2026-06-18 06:01:03 +00:00
Webpack build for branch v11: 747d76de10
This commit is contained in:
parent
cbb8812143
commit
0ac44b2a8d
2 changed files with 2 additions and 2 deletions
|
|
@ -834,7 +834,7 @@ eval("const Action = __webpack_require__(/*! ./Action */ \"./src/client/actions/
|
|||
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
eval("const snekfetch = __webpack_require__(/*! snekfetch */ \"./node_modules/snekfetch/esm.mjs\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass APIRequest {\n constructor(rest, method, path, auth, data, files, reason) {\n this.rest = rest;\n this.client = rest.client;\n this.method = method;\n this.path = path.toString();\n this.auth = auth;\n this.data = data;\n this.files = files;\n this.route = this.getRoute(this.path);\n this.reason = reason;\n }\n\n getRoute(url) {\n let route = url.split('?')[0];\n if (route.includes('/channels/') || route.includes('/guilds/')) {\n const startInd = route.includes('/channels/') ? route.indexOf('/channels/') : route.indexOf('/guilds/');\n const majorID = route.substring(startInd).split('/')[2];\n route = route.replace(/(\\d{8,})/g, ':id').replace(':id', majorID);\n }\n return route;\n }\n\n getAuth() {\n if (this.client.token && this.client.user && this.client.user.bot) {\n return `Bot ${this.client.token}`;\n } else if (this.client.token) {\n return this.client.token;\n }\n throw new Error(Constants.Errors.NO_TOKEN);\n }\n\n gen() {\n const API = `${this.client.options.http.host}/api/v${this.client.options.http.version}`;\n const request = snekfetch[this.method](`${API}${this.path}`);\n if (this.auth) request.set('Authorization', this.getAuth());\n if (this.reason) request.set('X-Audit-Log-Reason', encodeURIComponent(this.reason));\n if (!this.rest.client.browser) request.set('User-Agent', this.rest.userAgentManager.userAgent);\n if (this.files) {\n for (const file of this.files) if (file && file.file) request.attach(file.name, file.file, file.name);\n if (typeof this.data !== 'undefined') request.attach('payload_json', JSON.stringify(this.data));\n } else if (this.data) {\n request.send(this.data);\n }\n return request;\n }\n}\n\nmodule.exports = APIRequest;\n\n\n//# sourceURL=webpack:///./src/client/rest/APIRequest.js?");
|
||||
eval("const snekfetch = __webpack_require__(/*! snekfetch */ \"./node_modules/snekfetch/esm.mjs\");\nconst Constants = __webpack_require__(/*! ../../util/Constants */ \"./src/util/Constants.js\");\n\nclass APIRequest {\n constructor(rest, method, path, auth, data, files, reason) {\n this.rest = rest;\n this.client = rest.client;\n this.method = method;\n this.path = path.toString();\n this.auth = auth;\n this.data = data;\n this.files = files;\n this.route = this.getRoute(this.path);\n this.reason = reason;\n }\n\n getRoute(url) {\n const route = url.split('?')[0].split('/');\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 routeBucket.join('/');\n }\n\n getAuth() {\n if (this.client.token && this.client.user && this.client.user.bot) {\n return `Bot ${this.client.token}`;\n } else if (this.client.token) {\n return this.client.token;\n }\n throw new Error(Constants.Errors.NO_TOKEN);\n }\n\n gen() {\n const API = `${this.client.options.http.host}/api/v${this.client.options.http.version}`;\n const request = snekfetch[this.method](`${API}${this.path}`);\n if (this.auth) request.set('Authorization', this.getAuth());\n if (this.reason) request.set('X-Audit-Log-Reason', encodeURIComponent(this.reason));\n if (!this.rest.client.browser) request.set('User-Agent', this.rest.userAgentManager.userAgent);\n if (this.files) {\n for (const file of this.files) if (file && file.file) request.attach(file.name, file.file, file.name);\n if (typeof this.data !== 'undefined') request.attach('payload_json', JSON.stringify(this.data));\n } else if (this.data) {\n request.send(this.data);\n }\n return request;\n }\n}\n\nmodule.exports = APIRequest;\n\n\n//# sourceURL=webpack:///./src/client/rest/APIRequest.js?");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
|
|
|||
2
discord.v11.min.js
vendored
2
discord.v11.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue