mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 20:51:14 +00:00
Webpack build for branch 11.1-dev: 8a7a805d92
This commit is contained in:
parent
a31ebae536
commit
d335b09872
2 changed files with 1102 additions and 1076 deletions
|
|
@ -667,7 +667,7 @@ exports.Colors = {
|
|||
NOT_QUITE_BLACK: 0x23272A,
|
||||
};
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
|
||||
|
||||
/***/ }),
|
||||
/* 1 */
|
||||
|
|
@ -1111,7 +1111,7 @@ module.exports = Collection;
|
|||
/* 4 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
/* WEBPACK VAR INJECTION */(function(Buffer) {const snekfetch = __webpack_require__(39);
|
||||
/* WEBPACK VAR INJECTION */(function(Buffer) {const snekfetch = __webpack_require__(38);
|
||||
const Constants = __webpack_require__(0);
|
||||
const ConstantsHttp = Constants.DefaultOptions.http;
|
||||
|
||||
|
|
@ -3125,6 +3125,87 @@ function isnan (val) {
|
|||
|
||||
/***/ }),
|
||||
/* 6 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Long = __webpack_require__(34);
|
||||
|
||||
// Discord epoch (2015-01-01T00:00:00.000Z)
|
||||
const EPOCH = 1420070400000;
|
||||
let INCREMENT = 0;
|
||||
|
||||
/**
|
||||
* A container for useful snowflake-related methods.
|
||||
*/
|
||||
class SnowflakeUtil {
|
||||
constructor() {
|
||||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z
|
||||
* ```
|
||||
* If we have a snowflake '266241948824764416' we can represent it as binary:
|
||||
*
|
||||
* 64 22 17 12 0
|
||||
* 000000111011000111100001101001000101000000 00001 00000 000000000000
|
||||
* number of ms since Discord epoch worker pid increment
|
||||
* ```
|
||||
* @typedef {string} Snowflake
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generates a Discord snowflake.
|
||||
* <info>This hardcodes the worker ID as 1 and the process ID as 0.</info>
|
||||
* @returns {Snowflake} The generated snowflake
|
||||
*/
|
||||
static generate() {
|
||||
if (INCREMENT >= 4095) INCREMENT = 0;
|
||||
const BINARY = `${pad((Date.now() - EPOCH).toString(2), 42)}0000100000${pad((INCREMENT++).toString(2), 12)}`;
|
||||
return Long.fromString(BINARY, 2).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* A deconstructed snowflake.
|
||||
* @typedef {Object} DeconstructedSnowflake
|
||||
* @property {number} timestamp Timestamp the snowflake was created
|
||||
* @property {Date} date Date the snowflake was created
|
||||
* @property {number} workerID Worker ID in the snowflake
|
||||
* @property {number} processID Process ID in the snowflake
|
||||
* @property {number} increment Increment in the snowflake
|
||||
* @property {string} binary Binary representation of the snowflake
|
||||
*/
|
||||
|
||||
/**
|
||||
* Deconstructs a Discord snowflake.
|
||||
* @param {Snowflake} snowflake Snowflake to deconstruct
|
||||
* @returns {DeconstructedSnowflake} Deconstructed snowflake
|
||||
*/
|
||||
static deconstruct(snowflake) {
|
||||
const BINARY = pad(Long.fromString(snowflake).toString(2), 64);
|
||||
const res = {
|
||||
timestamp: parseInt(BINARY.substring(0, 42), 2) + EPOCH,
|
||||
workerID: parseInt(BINARY.substring(42, 47), 2),
|
||||
processID: parseInt(BINARY.substring(47, 52), 2),
|
||||
increment: parseInt(BINARY.substring(52, 64), 2),
|
||||
binary: BINARY,
|
||||
};
|
||||
Object.defineProperty(res, 'date', {
|
||||
get: function get() { return new Date(this.timestamp); },
|
||||
enumerable: true,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
function pad(v, n, c = '0') {
|
||||
return String(v).length >= n ? String(v) : (String(c).repeat(n) + v).slice(-n);
|
||||
}
|
||||
|
||||
module.exports = SnowflakeUtil;
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 7 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
// shim for using process in browser
|
||||
|
|
@ -3297,6 +3378,10 @@ process.off = noop;
|
|||
process.removeListener = noop;
|
||||
process.removeAllListeners = noop;
|
||||
process.emit = noop;
|
||||
process.prependListener = noop;
|
||||
process.prependOnceListener = noop;
|
||||
|
||||
process.listeners = function (name) { return [] }
|
||||
|
||||
process.binding = function (name) {
|
||||
throw new Error('process.binding is not supported');
|
||||
|
|
@ -3309,87 +3394,6 @@ process.chdir = function (dir) {
|
|||
process.umask = function() { return 0; };
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 7 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Long = __webpack_require__(35);
|
||||
|
||||
// Discord epoch (2015-01-01T00:00:00.000Z)
|
||||
const EPOCH = 1420070400000;
|
||||
let INCREMENT = 0;
|
||||
|
||||
/**
|
||||
* A container for useful snowflake-related methods.
|
||||
*/
|
||||
class SnowflakeUtil {
|
||||
constructor() {
|
||||
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z
|
||||
* ```
|
||||
* If we have a snowflake '266241948824764416' we can represent it as binary:
|
||||
*
|
||||
* 64 22 17 12 0
|
||||
* 000000111011000111100001101001000101000000 00001 00000 000000000000
|
||||
* number of ms since Discord epoch worker pid increment
|
||||
* ```
|
||||
* @typedef {string} Snowflake
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generates a Discord snowflake.
|
||||
* <info>This hardcodes the worker ID as 1 and the process ID as 0.</info>
|
||||
* @returns {Snowflake} The generated snowflake
|
||||
*/
|
||||
static generate() {
|
||||
if (INCREMENT >= 4095) INCREMENT = 0;
|
||||
const BINARY = `${pad((Date.now() - EPOCH).toString(2), 42)}0000100000${pad((INCREMENT++).toString(2), 12)}`;
|
||||
return Long.fromString(BINARY, 2).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* A deconstructed snowflake.
|
||||
* @typedef {Object} DeconstructedSnowflake
|
||||
* @property {number} timestamp Timestamp the snowflake was created
|
||||
* @property {Date} date Date the snowflake was created
|
||||
* @property {number} workerID Worker ID in the snowflake
|
||||
* @property {number} processID Process ID in the snowflake
|
||||
* @property {number} increment Increment in the snowflake
|
||||
* @property {string} binary Binary representation of the snowflake
|
||||
*/
|
||||
|
||||
/**
|
||||
* Deconstructs a Discord snowflake.
|
||||
* @param {Snowflake} snowflake Snowflake to deconstruct
|
||||
* @returns {DeconstructedSnowflake} Deconstructed snowflake
|
||||
*/
|
||||
static deconstruct(snowflake) {
|
||||
const BINARY = pad(Long.fromString(snowflake).toString(2), 64);
|
||||
const res = {
|
||||
timestamp: parseInt(BINARY.substring(0, 42), 2) + EPOCH,
|
||||
workerID: parseInt(BINARY.substring(42, 47), 2),
|
||||
processID: parseInt(BINARY.substring(47, 52), 2),
|
||||
increment: parseInt(BINARY.substring(52, 64), 2),
|
||||
binary: BINARY,
|
||||
};
|
||||
Object.defineProperty(res, 'date', {
|
||||
get: function get() { return new Date(this.timestamp); },
|
||||
enumerable: true,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
function pad(v, n, c = '0') {
|
||||
return String(v).length >= n ? String(v) : (String(c).repeat(n) + v).slice(-n);
|
||||
}
|
||||
|
||||
module.exports = SnowflakeUtil;
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 8 */
|
||||
/***/ (function(module, exports) {
|
||||
|
|
@ -4158,7 +4162,7 @@ var objectKeys = Object.keys || function (obj) {
|
|||
module.exports = Duplex;
|
||||
|
||||
/*<replacement>*/
|
||||
var processNextTick = __webpack_require__(36);
|
||||
var processNextTick = __webpack_require__(35);
|
||||
/*</replacement>*/
|
||||
|
||||
/*<replacement>*/
|
||||
|
|
@ -4167,7 +4171,7 @@ util.inherits = __webpack_require__(10);
|
|||
/*</replacement>*/
|
||||
|
||||
var Readable = __webpack_require__(59);
|
||||
var Writable = __webpack_require__(38);
|
||||
var Writable = __webpack_require__(37);
|
||||
|
||||
util.inherits(Duplex, Readable);
|
||||
|
||||
|
|
@ -4218,7 +4222,7 @@ function forEach(xs, f) {
|
|||
/* 14 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Snowflake = __webpack_require__(7);
|
||||
const Snowflake = __webpack_require__(6);
|
||||
|
||||
/**
|
||||
* Represents any channel on Discord.
|
||||
|
|
@ -4293,7 +4297,7 @@ module.exports = Channel;
|
|||
/* 15 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Snowflake = __webpack_require__(7);
|
||||
const Snowflake = __webpack_require__(6);
|
||||
const Permissions = __webpack_require__(9);
|
||||
const util = __webpack_require__(22);
|
||||
|
||||
|
|
@ -4660,7 +4664,7 @@ module.exports = Role;
|
|||
const TextBasedChannel = __webpack_require__(23);
|
||||
const Constants = __webpack_require__(0);
|
||||
const Presence = __webpack_require__(11).Presence;
|
||||
const Snowflake = __webpack_require__(7);
|
||||
const Snowflake = __webpack_require__(6);
|
||||
|
||||
/**
|
||||
* Represents a user on Discord.
|
||||
|
|
@ -4968,7 +4972,7 @@ module.exports = User;
|
|||
|
||||
const Constants = __webpack_require__(0);
|
||||
const Collection = __webpack_require__(3);
|
||||
const Snowflake = __webpack_require__(7);
|
||||
const Snowflake = __webpack_require__(6);
|
||||
|
||||
/**
|
||||
* Represents a custom emoji.
|
||||
|
|
@ -5581,7 +5585,7 @@ class GuildMember {
|
|||
*/
|
||||
addRole(role) {
|
||||
if (!(role instanceof Role)) role = this.guild.roles.get(role);
|
||||
if (!role) throw new TypeError('Supplied parameter was neither a Role nor a Snowflake.');
|
||||
if (!role) return Promise.reject(new TypeError('Supplied parameter was neither a Role nor a Snowflake.'));
|
||||
return this.client.rest.methods.addMemberRole(this, role);
|
||||
}
|
||||
|
||||
|
|
@ -5608,7 +5612,7 @@ class GuildMember {
|
|||
*/
|
||||
removeRole(role) {
|
||||
if (!(role instanceof Role)) role = this.guild.roles.get(role);
|
||||
if (!role) throw new TypeError('Supplied parameter was neither a Role nor a Snowflake.');
|
||||
if (!role) return Promise.reject(new TypeError('Supplied parameter was neither a Role nor a Snowflake.'));
|
||||
return this.client.rest.methods.removeMemberRole(this, role);
|
||||
}
|
||||
|
||||
|
|
@ -6408,7 +6412,7 @@ function objectToString(o) {
|
|||
exports = module.exports = __webpack_require__(59);
|
||||
exports.Stream = exports;
|
||||
exports.Readable = exports;
|
||||
exports.Writable = __webpack_require__(38);
|
||||
exports.Writable = __webpack_require__(37);
|
||||
exports.Duplex = __webpack_require__(13);
|
||||
exports.Transform = __webpack_require__(60);
|
||||
exports.PassThrough = __webpack_require__(85);
|
||||
|
|
@ -7005,7 +7009,7 @@ function hasOwnProperty(obj, prop) {
|
|||
return Object.prototype.hasOwnProperty.call(obj, prop);
|
||||
}
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8), __webpack_require__(6)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8), __webpack_require__(7)))
|
||||
|
||||
/***/ }),
|
||||
/* 23 */
|
||||
|
|
@ -7571,7 +7575,7 @@ exports.EOL = '\n';
|
|||
/* 25 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Long = __webpack_require__(35);
|
||||
const Long = __webpack_require__(34);
|
||||
const User = __webpack_require__(16);
|
||||
const Role = __webpack_require__(15);
|
||||
const Emoji = __webpack_require__(17);
|
||||
|
|
@ -7580,7 +7584,7 @@ const GuildMember = __webpack_require__(18);
|
|||
const Constants = __webpack_require__(0);
|
||||
const Collection = __webpack_require__(3);
|
||||
const Util = __webpack_require__(4);
|
||||
const Snowflake = __webpack_require__(7);
|
||||
const Snowflake = __webpack_require__(6);
|
||||
|
||||
/**
|
||||
* Represents a guild (or a server) on Discord.
|
||||
|
|
@ -8995,7 +8999,7 @@ module.exports = GuildChannel;
|
|||
/* 27 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Snowflake = __webpack_require__(7);
|
||||
const Snowflake = __webpack_require__(6);
|
||||
|
||||
/**
|
||||
* Represents an OAuth2 Application.
|
||||
|
|
@ -9368,16 +9372,10 @@ var substr = 'ab'.substr(-1) === 'b'
|
|||
}
|
||||
;
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
|
||||
|
||||
/***/ }),
|
||||
/* 29 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 30 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Channel = __webpack_require__(14);
|
||||
|
|
@ -9563,7 +9561,7 @@ module.exports = GroupDMChannel;
|
|||
|
||||
|
||||
/***/ }),
|
||||
/* 31 */
|
||||
/* 30 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/**
|
||||
|
|
@ -9618,7 +9616,7 @@ module.exports = ReactionEmoji;
|
|||
|
||||
|
||||
/***/ }),
|
||||
/* 32 */
|
||||
/* 31 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const path = __webpack_require__(28);
|
||||
|
|
@ -9850,7 +9848,7 @@ module.exports = Webhook;
|
|||
|
||||
|
||||
/***/ }),
|
||||
/* 33 */
|
||||
/* 32 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Collection = __webpack_require__(3);
|
||||
|
|
@ -10034,7 +10032,7 @@ module.exports = Collector;
|
|||
|
||||
|
||||
/***/ }),
|
||||
/* 34 */
|
||||
/* 33 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
|
@ -10150,7 +10148,7 @@ exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
|
|||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
|
||||
|
||||
/***/ }),
|
||||
/* 35 */
|
||||
/* 34 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
|
||||
|
|
@ -11368,7 +11366,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|||
|
||||
|
||||
/***/ }),
|
||||
/* 36 */
|
||||
/* 35 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
|
@ -11416,10 +11414,10 @@ function nextTick(fn, arg1, arg2, arg3) {
|
|||
}
|
||||
}
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
|
||||
|
||||
/***/ }),
|
||||
/* 37 */
|
||||
/* 36 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
|
@ -11430,7 +11428,7 @@ exports.encode = exports.stringify = __webpack_require__(83);
|
|||
|
||||
|
||||
/***/ }),
|
||||
/* 38 */
|
||||
/* 37 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
|
@ -11443,7 +11441,7 @@ exports.encode = exports.stringify = __webpack_require__(83);
|
|||
module.exports = Writable;
|
||||
|
||||
/*<replacement>*/
|
||||
var processNextTick = __webpack_require__(36);
|
||||
var processNextTick = __webpack_require__(35);
|
||||
/*</replacement>*/
|
||||
|
||||
/*<replacement>*/
|
||||
|
|
@ -11473,7 +11471,7 @@ var Stream = __webpack_require__(61);
|
|||
|
||||
var Buffer = __webpack_require__(5).Buffer;
|
||||
/*<replacement>*/
|
||||
var bufferShim = __webpack_require__(34);
|
||||
var bufferShim = __webpack_require__(33);
|
||||
/*</replacement>*/
|
||||
|
||||
util.inherits(Writable, Stream);
|
||||
|
|
@ -11978,82 +11976,87 @@ function CorkedRequest(state) {
|
|||
}
|
||||
};
|
||||
}
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(99).setImmediate))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7), __webpack_require__(99).setImmediate))
|
||||
|
||||
/***/ }),
|
||||
/* 39 */
|
||||
/* 38 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
/* WEBPACK VAR INJECTION */(function(__dirname, Buffer, process) {const Snekfetch = __webpack_require__(93);
|
||||
const Snekfetch = __webpack_require__(93);
|
||||
|
||||
const ENV_VAR = '__SNEKFETCH_SYNC_REQUEST';
|
||||
let first = true;
|
||||
|
||||
for (let method of Snekfetch.METHODS) {
|
||||
method = method === 'M-SEARCH' ? 'msearch' : method.toLowerCase();
|
||||
Snekfetch[`${method}Sync`] = (url, options = {}) => {
|
||||
if (first) {
|
||||
first = false;
|
||||
console.error(
|
||||
'Performing sync requests is a really stupid thing to do. ' +
|
||||
'https://www.google.com/search?q=why+sync+requests+are+bad+nodejs'
|
||||
);
|
||||
}
|
||||
options.url = url;
|
||||
options.method = method;
|
||||
const cp = __webpack_require__(29);
|
||||
const result = JSON.parse(
|
||||
cp.execSync(`node ${__dirname}/index.js`, {
|
||||
env: { [ENV_VAR]: JSON.stringify(options) },
|
||||
}).toString(),
|
||||
(k, v) => {
|
||||
if (v === null) return v;
|
||||
if (v.type === 'Buffer' && Array.isArray(v.data)) return new Buffer(v.data);
|
||||
if (v.__CONVERT_TO_ERROR) {
|
||||
const e = new Error();
|
||||
for (const key of Object.keys(v)) {
|
||||
if (key === '__CONVERT_TO_ERROR') continue;
|
||||
e[key] = v[key];
|
||||
}
|
||||
return e;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
);
|
||||
if (result.error) throw result.error;
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
if (process.env[ENV_VAR]) {
|
||||
const options = JSON.parse(process.env[ENV_VAR]);
|
||||
const request = Snekfetch[options.method](options.url);
|
||||
if (options.headers) request.set(options.headers);
|
||||
if (options.body) request.send(options.body);
|
||||
request.end((err, res = {}) => {
|
||||
if (err) {
|
||||
const alt = {};
|
||||
for (const name of Object.getOwnPropertyNames(err)) alt[name] = err[name];
|
||||
res.error = alt;
|
||||
res.error.__CONVERT_TO_ERROR = true;
|
||||
}
|
||||
// circulars
|
||||
res.request = null;
|
||||
process.stdout.write(JSON.stringify(res));
|
||||
});
|
||||
}
|
||||
// const ENV_VAR = '__SNEKFETCH_SYNC_REQUEST';
|
||||
// let first = true;
|
||||
//
|
||||
// for (let method of Snekfetch.METHODS) {
|
||||
// method = method === 'M-SEARCH' ? 'msearch' : method.toLowerCase();
|
||||
// Snekfetch[`${method}Sync`] = (url, options = {}) => {
|
||||
// if (first) {
|
||||
// first = false;
|
||||
// console.error(
|
||||
// 'Performing sync requests is a really stupid thing to do. ' +
|
||||
// 'https://www.google.com/search?q=why+sync+requests+are+bad+nodejs'
|
||||
// );
|
||||
// }
|
||||
// options.url = url;
|
||||
// options.method = method;
|
||||
// const cp = require('child_process');
|
||||
// const result = JSON.parse(
|
||||
// cp.execSync(`node ${__dirname}/index.js`, {
|
||||
// env: { [ENV_VAR]: JSON.stringify(options) },
|
||||
// }).toString(),
|
||||
// (k, v) => {
|
||||
// if (v === null) return v;
|
||||
// if (v.type === 'Buffer' && Array.isArray(v.data)) return new Buffer(v.data);
|
||||
// if (v.__CONVERT_TO_ERROR) {
|
||||
// const e = new Error();
|
||||
// for (const key of Object.keys(v)) {
|
||||
// if (key === '__CONVERT_TO_ERROR') continue;
|
||||
// e[key] = v[key];
|
||||
// }
|
||||
// return e;
|
||||
// }
|
||||
// return v;
|
||||
// }
|
||||
// );
|
||||
// if (result.error) throw result.error;
|
||||
// return result;
|
||||
// };
|
||||
// }
|
||||
//
|
||||
// if (process.env[ENV_VAR]) {
|
||||
// const options = JSON.parse(process.env[ENV_VAR]);
|
||||
// const request = Snekfetch[options.method](options.url);
|
||||
// if (options.headers) request.set(options.headers);
|
||||
// if (options.body) request.send(options.body);
|
||||
// request.end((err, res = {}) => {
|
||||
// if (err) {
|
||||
// const alt = {};
|
||||
// for (const name of Object.getOwnPropertyNames(err)) alt[name] = err[name];
|
||||
// res.error = alt;
|
||||
// res.error.__CONVERT_TO_ERROR = true;
|
||||
// }
|
||||
// // circulars
|
||||
// res.request = null;
|
||||
// process.stdout.write(JSON.stringify(res));
|
||||
// });
|
||||
// }
|
||||
|
||||
module.exports = Snekfetch;
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, "node_modules/snekfetch", __webpack_require__(5).Buffer, __webpack_require__(6)))
|
||||
|
||||
/***/ }),
|
||||
/* 39 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 40 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
/* WEBPACK VAR INJECTION */(function(Buffer) {const path = __webpack_require__(28);
|
||||
const fs = __webpack_require__(29);
|
||||
const snekfetch = __webpack_require__(39);
|
||||
const fs = __webpack_require__(39);
|
||||
const snekfetch = __webpack_require__(38);
|
||||
|
||||
const Constants = __webpack_require__(0);
|
||||
const convertToBuffer = __webpack_require__(4).convertToBuffer;
|
||||
|
|
@ -12063,7 +12066,7 @@ const Guild = __webpack_require__(25);
|
|||
const Channel = __webpack_require__(14);
|
||||
const GuildMember = __webpack_require__(18);
|
||||
const Emoji = __webpack_require__(17);
|
||||
const ReactionEmoji = __webpack_require__(31);
|
||||
const ReactionEmoji = __webpack_require__(30);
|
||||
|
||||
/**
|
||||
* The DataResolver identifies different objects and tries to resolve a specific piece of information from them, e.g.
|
||||
|
|
@ -12440,7 +12443,8 @@ module.exports = {
|
|||
"discord.js-docgen": "hydrabolt/discord.js-docgen",
|
||||
"eslint": "^3.19.0",
|
||||
"parallel-webpack": "^1.6.0",
|
||||
"uglify-js": "mishoo/UglifyJS2#harmony",
|
||||
"uglify-js": "mishoo/UglifyJS2#harmony-v2.8.22",
|
||||
"uglifyjs-webpack-plugin": "^0.4.3",
|
||||
"webpack": "^2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -12991,7 +12995,7 @@ module.exports = DMChannel;
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Collection = __webpack_require__(3);
|
||||
const Snowflake = __webpack_require__(7);
|
||||
const Snowflake = __webpack_require__(6);
|
||||
|
||||
const Targets = {
|
||||
GUILD: 'GUILD',
|
||||
|
|
@ -13518,7 +13522,7 @@ module.exports = MessageAttachment;
|
|||
/* 48 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Collector = __webpack_require__(33);
|
||||
const Collector = __webpack_require__(32);
|
||||
const util = __webpack_require__(22);
|
||||
|
||||
/**
|
||||
|
|
@ -14139,7 +14143,7 @@ class MessageMentions {
|
|||
MessageMentions.EVERYONE_PATTERN = /@(everyone|here)/g;
|
||||
|
||||
/**
|
||||
* Regular expression that globally matches user mentions like `<#81440962496172032>`
|
||||
* Regular expression that globally matches user mentions like `<@81440962496172032>`
|
||||
* @type {RegExp}
|
||||
*/
|
||||
MessageMentions.USERS_PATTERN = /<@!?[0-9]+>/g;
|
||||
|
|
@ -14165,7 +14169,7 @@ module.exports = MessageMentions;
|
|||
|
||||
const Collection = __webpack_require__(3);
|
||||
const Emoji = __webpack_require__(17);
|
||||
const ReactionEmoji = __webpack_require__(31);
|
||||
const ReactionEmoji = __webpack_require__(30);
|
||||
|
||||
/**
|
||||
* Represents a reaction to a message.
|
||||
|
|
@ -14418,7 +14422,7 @@ module.exports = PermissionOverwrites;
|
|||
/* 55 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Collector = __webpack_require__(33);
|
||||
const Collector = __webpack_require__(32);
|
||||
const Collection = __webpack_require__(3);
|
||||
|
||||
/**
|
||||
|
|
@ -14780,7 +14784,7 @@ module.exports = Array.isArray || function (arr) {
|
|||
module.exports = Readable;
|
||||
|
||||
/*<replacement>*/
|
||||
var processNextTick = __webpack_require__(36);
|
||||
var processNextTick = __webpack_require__(35);
|
||||
/*</replacement>*/
|
||||
|
||||
/*<replacement>*/
|
||||
|
|
@ -14807,7 +14811,7 @@ var Stream = __webpack_require__(61);
|
|||
|
||||
var Buffer = __webpack_require__(5).Buffer;
|
||||
/*<replacement>*/
|
||||
var bufferShim = __webpack_require__(34);
|
||||
var bufferShim = __webpack_require__(33);
|
||||
/*</replacement>*/
|
||||
|
||||
/*<replacement>*/
|
||||
|
|
@ -15710,7 +15714,7 @@ function indexOf(xs, x) {
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
|
||||
|
||||
/***/ }),
|
||||
/* 60 */
|
||||
|
|
@ -16305,7 +16309,7 @@ var protocolPattern = /^([a-z0-9.+-]+:)/i,
|
|||
'gopher:': true,
|
||||
'file:': true
|
||||
},
|
||||
querystring = __webpack_require__(37);
|
||||
querystring = __webpack_require__(36);
|
||||
|
||||
function urlParse(url, parseQueryString, slashesDenoteHost) {
|
||||
if (url && util.isObject(url) && url instanceof Url) return url;
|
||||
|
|
@ -17343,7 +17347,7 @@ module.exports = RequestHandler;
|
|||
/* WEBPACK VAR INJECTION */(function(Buffer) {const browser = __webpack_require__(24).platform() === 'browser';
|
||||
const EventEmitter = __webpack_require__(12);
|
||||
const Constants = __webpack_require__(0);
|
||||
const zlib = __webpack_require__(29);
|
||||
const zlib = __webpack_require__(39);
|
||||
const PacketManager = __webpack_require__(144);
|
||||
const erlpack = (function findErlpack() {
|
||||
try {
|
||||
|
|
@ -18394,13 +18398,13 @@ module.exports = Client;
|
|||
* @param {string} info The debug information
|
||||
*/
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
|
||||
|
||||
/***/ }),
|
||||
/* 72 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const Webhook = __webpack_require__(32);
|
||||
const Webhook = __webpack_require__(31);
|
||||
const RESTManager = __webpack_require__(68);
|
||||
const ClientDataResolver = __webpack_require__(40);
|
||||
const Constants = __webpack_require__(0);
|
||||
|
|
@ -19837,7 +19841,7 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) {
|
|||
|
||||
var Buffer = __webpack_require__(5).Buffer;
|
||||
/*<replacement>*/
|
||||
var bufferShim = __webpack_require__(34);
|
||||
var bufferShim = __webpack_require__(33);
|
||||
/*</replacement>*/
|
||||
|
||||
module.exports = BufferList;
|
||||
|
|
@ -19916,7 +19920,7 @@ module.exports = __webpack_require__(21).Transform
|
|||
/* 89 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(38);
|
||||
module.exports = __webpack_require__(37);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
@ -20110,7 +20114,7 @@ module.exports = __webpack_require__(38);
|
|||
attachTo.clearImmediate = clearImmediate;
|
||||
}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8), __webpack_require__(6)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8), __webpack_require__(7)))
|
||||
|
||||
/***/ }),
|
||||
/* 91 */
|
||||
|
|
@ -20132,19 +20136,19 @@ module.exports = {
|
|||
]
|
||||
],
|
||||
"_from": "snekfetch@>=3.1.0 <4.0.0",
|
||||
"_id": "snekfetch@3.1.2",
|
||||
"_id": "snekfetch@3.1.6",
|
||||
"_inCache": true,
|
||||
"_location": "/snekfetch",
|
||||
"_nodeVersion": "7.9.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-18-east.internal.npmjs.com",
|
||||
"tmp": "tmp/snekfetch-3.1.2.tgz_1492882967312_0.8088863184675574"
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/snekfetch-3.1.6.tgz_1493569353717_0.8596337598282844"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "crawl",
|
||||
"email": "icrawltogo@gmail.com"
|
||||
"name": "snek",
|
||||
"email": "me@gus.host"
|
||||
},
|
||||
"_npmVersion": "4.2.0",
|
||||
"_npmVersion": "4.5.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "snekfetch@^3.1.0",
|
||||
|
|
@ -20158,8 +20162,8 @@ module.exports = {
|
|||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz",
|
||||
"_shasum": "3422a9191c1bb6610867db88e669db0b5adb7f42",
|
||||
"_resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.6.tgz",
|
||||
"_shasum": "3090d5cd3f5bc1e456f8aafa5024f64b7ca5b1e0",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "snekfetch@^3.1.0",
|
||||
"_where": "/home/travis/build/hydrabolt/discord.js",
|
||||
|
|
@ -20175,10 +20179,10 @@ module.exports = {
|
|||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "3422a9191c1bb6610867db88e669db0b5adb7f42",
|
||||
"tarball": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz"
|
||||
"shasum": "3090d5cd3f5bc1e456f8aafa5024f64b7ca5b1e0",
|
||||
"tarball": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.6.tgz"
|
||||
},
|
||||
"gitHead": "a79f6867d21ca58ffe6fc59eb77b06f257f8ad29",
|
||||
"gitHead": "b03a6bb7d3b73ac3a4b27c7cfffcfbaa87d38700",
|
||||
"homepage": "https://github.com/GusCaplan/snekfetch#readme",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
|
|
@ -20187,6 +20191,10 @@ module.exports = {
|
|||
"name": "crawl",
|
||||
"email": "icrawltogo@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "hydrabolt",
|
||||
"email": "amishshah.2k@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "snek",
|
||||
"email": "me@gus.host"
|
||||
|
|
@ -20200,7 +20208,7 @@ module.exports = {
|
|||
"url": "git+https://github.com/GusCaplan/snekfetch.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"version": "3.1.2"
|
||||
"version": "3.1.6"
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
|
@ -20223,7 +20231,7 @@ class FormData {
|
|||
if (filename) {
|
||||
str += `; filename="${filename}"`;
|
||||
mimetype = 'application/octet-stream';
|
||||
const extname = path.extname(filename);
|
||||
const extname = path.extname(filename).slice(1);
|
||||
if (extname) mimetype = mime.lookup(extname);
|
||||
}
|
||||
|
||||
|
|
@ -20262,8 +20270,8 @@ module.exports = FormData;
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
/* WEBPACK VAR INJECTION */(function(Buffer) {__webpack_require__(62);
|
||||
const zlib = __webpack_require__(29);
|
||||
const qs = __webpack_require__(37);
|
||||
const zlib = __webpack_require__(39);
|
||||
const qs = __webpack_require__(36);
|
||||
const http = __webpack_require__(63);
|
||||
const https = __webpack_require__(79);
|
||||
const URL = __webpack_require__(65);
|
||||
|
|
@ -20316,7 +20324,7 @@ class Snekfetch extends Stream.Readable {
|
|||
send(data) {
|
||||
if (this.request.res) throw new Error('Cannot modify data after being sent!');
|
||||
if (data !== null && typeof data === 'object') {
|
||||
const header = this.request.getHeader('content-type');
|
||||
const header = this._getHeader('content-type');
|
||||
let serialize;
|
||||
if (header) {
|
||||
if (header.includes('json')) serialize = JSON.stringify;
|
||||
|
|
@ -20447,7 +20455,7 @@ class Snekfetch extends Stream.Readable {
|
|||
|
||||
_read() {
|
||||
this.resume();
|
||||
if (this.request.res) return;
|
||||
if (this.response) return;
|
||||
this.catch((err) => this.emit('error', err));
|
||||
}
|
||||
|
||||
|
|
@ -20468,11 +20476,24 @@ class Snekfetch extends Stream.Readable {
|
|||
|
||||
_addFinalHeaders() {
|
||||
if (!this.request) return;
|
||||
if (!this.request.getHeader('user-agent')) {
|
||||
if (!this._getHeader('user-agent')) {
|
||||
this.set('User-Agent', `snekfetch/${Snekfetch.version} (${Package.repository.url.replace(/\.?git/, '')})`);
|
||||
}
|
||||
if (this.request.method !== 'HEAD') this.set('Accept-Encoding', 'gzip, deflate');
|
||||
}
|
||||
|
||||
get response() {
|
||||
return this.request.res || this.request._response || null;
|
||||
}
|
||||
|
||||
_getHeader(header) {
|
||||
// https://github.com/jhiesey/stream-http/pull/77
|
||||
try {
|
||||
return this.request.getHeader(header);
|
||||
} catch (err) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Snekfetch.version = Package.version;
|
||||
|
|
@ -22210,8 +22231,10 @@ ClientRequest.prototype.setHeader = function (name, value) {
|
|||
}
|
||||
|
||||
ClientRequest.prototype.getHeader = function (name) {
|
||||
var self = this
|
||||
return self._headers[name.toLowerCase()].value
|
||||
var header = this._headers[name.toLowerCase()]
|
||||
if (header)
|
||||
return header.value
|
||||
return null
|
||||
}
|
||||
|
||||
ClientRequest.prototype.removeHeader = function (name) {
|
||||
|
|
@ -22432,7 +22455,7 @@ var unsafeHeaders = [
|
|||
'via'
|
||||
]
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5).Buffer, __webpack_require__(8), __webpack_require__(6)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5).Buffer, __webpack_require__(8), __webpack_require__(7)))
|
||||
|
||||
/***/ }),
|
||||
/* 98 */
|
||||
|
|
@ -22621,7 +22644,7 @@ IncomingMessage.prototype._onXHRProgress = function () {
|
|||
}
|
||||
}
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(5).Buffer, __webpack_require__(8)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7), __webpack_require__(5).Buffer, __webpack_require__(8)))
|
||||
|
||||
/***/ }),
|
||||
/* 99 */
|
||||
|
|
@ -22918,7 +22941,7 @@ const Emoji = __webpack_require__(17);
|
|||
const TextChannel = __webpack_require__(56);
|
||||
const VoiceChannel = __webpack_require__(57);
|
||||
const GuildChannel = __webpack_require__(26);
|
||||
const GroupDMChannel = __webpack_require__(30);
|
||||
const GroupDMChannel = __webpack_require__(29);
|
||||
|
||||
class ClientDataManager {
|
||||
constructor(client) {
|
||||
|
|
@ -23090,7 +23113,7 @@ class ClientManager {
|
|||
const gateway = `${res.url}/?v=${protocolVersion}&encoding=${WebSocketConnection.ENCODING}`;
|
||||
this.client.emit(Constants.Events.DEBUG, `Using gateway ${gateway}`);
|
||||
this.client.ws.connect(gateway);
|
||||
this.client.ws.once('close', event => {
|
||||
this.client.ws.connection.once('close', event => {
|
||||
if (event.code === 4004) reject(new Error(Constants.Errors.BAD_LOGIN));
|
||||
if (event.code === 4010) reject(new Error(Constants.Errors.INVALID_SHARD));
|
||||
if (event.code === 4011) reject(new Error(Constants.Errors.SHARDING_REQUIRED));
|
||||
|
|
@ -24150,7 +24173,7 @@ module.exports = UserUpdateAction;
|
|||
/* 138 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const snekfetch = __webpack_require__(39);
|
||||
const snekfetch = __webpack_require__(38);
|
||||
const Constants = __webpack_require__(0);
|
||||
|
||||
class APIRequest {
|
||||
|
|
@ -24206,13 +24229,13 @@ module.exports = APIRequest;
|
|||
/* 139 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
const querystring = __webpack_require__(37);
|
||||
const long = __webpack_require__(35);
|
||||
const querystring = __webpack_require__(36);
|
||||
const long = __webpack_require__(34);
|
||||
const Permissions = __webpack_require__(9);
|
||||
const Constants = __webpack_require__(0);
|
||||
const Endpoints = Constants.Endpoints;
|
||||
const Collection = __webpack_require__(3);
|
||||
const Snowflake = __webpack_require__(7);
|
||||
const Snowflake = __webpack_require__(6);
|
||||
const Util = __webpack_require__(4);
|
||||
|
||||
const User = __webpack_require__(16);
|
||||
|
|
@ -24220,11 +24243,11 @@ const GuildMember = __webpack_require__(18);
|
|||
const Message = __webpack_require__(19);
|
||||
const Role = __webpack_require__(15);
|
||||
const Invite = __webpack_require__(46);
|
||||
const Webhook = __webpack_require__(32);
|
||||
const Webhook = __webpack_require__(31);
|
||||
const UserProfile = __webpack_require__(183);
|
||||
const OAuth2Application = __webpack_require__(27);
|
||||
const Channel = __webpack_require__(14);
|
||||
const GroupDMChannel = __webpack_require__(30);
|
||||
const GroupDMChannel = __webpack_require__(29);
|
||||
const Guild = __webpack_require__(25);
|
||||
const VoiceRegion = __webpack_require__(184);
|
||||
const GuildAuditLogs = __webpack_require__(45);
|
||||
|
|
@ -24673,7 +24696,10 @@ class RESTMethods {
|
|||
}
|
||||
|
||||
updateGuildMember(member, data) {
|
||||
if (data.channel) data.channel_id = this.client.resolver.resolveChannel(data.channel).id;
|
||||
if (data.channel) {
|
||||
data.channel_id = this.client.resolver.resolveChannel(data.channel).id;
|
||||
data.channel = null;
|
||||
}
|
||||
if (data.roles) data.roles = data.roles.map(role => role instanceof Role ? role.id : role);
|
||||
|
||||
let endpoint = Endpoints.Member(member);
|
||||
|
|
@ -25313,7 +25339,7 @@ UserAgentManager.DEFAULT = {
|
|||
|
||||
module.exports = UserAgentManager;
|
||||
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
|
||||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
|
||||
|
||||
/***/ }),
|
||||
/* 143 */
|
||||
|
|
@ -26569,8 +26595,8 @@ module.exports = {
|
|||
Constants: __webpack_require__(0),
|
||||
EvaluatedPermissions: __webpack_require__(9),
|
||||
Permissions: __webpack_require__(9),
|
||||
Snowflake: __webpack_require__(7),
|
||||
SnowflakeUtil: __webpack_require__(7),
|
||||
Snowflake: __webpack_require__(6),
|
||||
SnowflakeUtil: __webpack_require__(6),
|
||||
Util: Util,
|
||||
util: Util,
|
||||
version: __webpack_require__(41).version,
|
||||
|
|
@ -26584,11 +26610,11 @@ module.exports = {
|
|||
Channel: __webpack_require__(14),
|
||||
ClientUser: __webpack_require__(42),
|
||||
ClientUserSettings: __webpack_require__(43),
|
||||
Collector: __webpack_require__(33),
|
||||
Collector: __webpack_require__(32),
|
||||
DMChannel: __webpack_require__(44),
|
||||
Emoji: __webpack_require__(17),
|
||||
Game: __webpack_require__(11).Game,
|
||||
GroupDMChannel: __webpack_require__(30),
|
||||
GroupDMChannel: __webpack_require__(29),
|
||||
Guild: __webpack_require__(25),
|
||||
GuildAuditLogs: __webpack_require__(45),
|
||||
GuildChannel: __webpack_require__(26),
|
||||
|
|
@ -26606,14 +26632,14 @@ module.exports = {
|
|||
PartialGuildChannel: __webpack_require__(53),
|
||||
PermissionOverwrites: __webpack_require__(54),
|
||||
Presence: __webpack_require__(11).Presence,
|
||||
ReactionEmoji: __webpack_require__(31),
|
||||
ReactionEmoji: __webpack_require__(30),
|
||||
ReactionCollector: __webpack_require__(55),
|
||||
RichEmbed: __webpack_require__(73),
|
||||
Role: __webpack_require__(15),
|
||||
TextChannel: __webpack_require__(56),
|
||||
User: __webpack_require__(16),
|
||||
VoiceChannel: __webpack_require__(57),
|
||||
Webhook: __webpack_require__(32),
|
||||
Webhook: __webpack_require__(31),
|
||||
};
|
||||
|
||||
if (__webpack_require__(24).platform() === 'browser') window.Discord = module.exports; // eslint-disable-line no-undef
|
||||
|
|
|
|||
16
discord.11.1-dev.min.js
vendored
16
discord.11.1-dev.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue