Webpack build for branch master: b0d4b53d6b

This commit is contained in:
Travis CI 2017-05-13 16:20:08 +00:00
parent dfbe7761ad
commit a31ebae536
2 changed files with 1103 additions and 1086 deletions

View file

@ -277,6 +277,7 @@ const Endpoints = exports.Endpoints = {
return { return {
Emoji: emojiID => `${root}/emojis/${emojiID}.png`, Emoji: emojiID => `${root}/emojis/${emojiID}.png`,
Asset: name => `${root}/assets/${name}`, Asset: name => `${root}/assets/${name}`,
DefaultAvatar: number => `${root}/embed/avatars/${number}.png`,
Avatar: (userID, hash, format = 'default', size) => { Avatar: (userID, hash, format = 'default', size) => {
if (format === 'default') format = hash.startsWith('a_') ? 'gif' : 'webp'; if (format === 'default') format = hash.startsWith('a_') ? 'gif' : 'webp';
if (!AllowedImageFormats.includes(format)) throw new Error(`Invalid image format: ${format}`); if (!AllowedImageFormats.includes(format)) throw new Error(`Invalid image format: ${format}`);
@ -523,14 +524,6 @@ exports.MessageTypes = [
'GUILD_MEMBER_JOIN', 'GUILD_MEMBER_JOIN',
]; ];
exports.DefaultAvatars = {
BLURPLE: '6debd47ed13483642cf09e832ed0bc1b',
GREY: '322c936a8c8be1b803cd94861bdfa868',
GREEN: 'dd4dbc0016779df1378e7812eabaa04d',
ORANGE: '0e291f67c9274a1abdddeb3fd919cbaa',
RED: '1cbd08c76f8af6dddce02c5138971129',
};
exports.ExplicitContentFilterTypes = [ exports.ExplicitContentFilterTypes = [
'DISABLED', 'DISABLED',
'NON_FRIENDS', 'NON_FRIENDS',
@ -698,7 +691,7 @@ exports.Colors = {
NOT_QUITE_BLACK: 0x23272A, NOT_QUITE_BLACK: 0x23272A,
}; };
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
/***/ }), /***/ }),
/* 1 */ /* 1 */
@ -1142,7 +1135,7 @@ module.exports = Collection;
/* 4 */ /* 4 */
/***/ (function(module, exports, __webpack_require__) { /***/ (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 Constants = __webpack_require__(0);
const ConstantsHttp = Constants.DefaultOptions.http; const ConstantsHttp = Constants.DefaultOptions.http;
@ -3156,6 +3149,87 @@ function isnan (val) {
/***/ }), /***/ }),
/* 6 */ /* 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) { /***/ (function(module, exports) {
// shim for using process in browser // shim for using process in browser
@ -3328,6 +3402,10 @@ process.off = noop;
process.removeListener = noop; process.removeListener = noop;
process.removeAllListeners = noop; process.removeAllListeners = noop;
process.emit = noop; process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) { process.binding = function (name) {
throw new Error('process.binding is not supported'); throw new Error('process.binding is not supported');
@ -3340,87 +3418,6 @@ process.chdir = function (dir) {
process.umask = function() { return 0; }; 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 */ /* 8 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
@ -4189,7 +4186,7 @@ var objectKeys = Object.keys || function (obj) {
module.exports = Duplex; module.exports = Duplex;
/*<replacement>*/ /*<replacement>*/
var processNextTick = __webpack_require__(36); var processNextTick = __webpack_require__(35);
/*</replacement>*/ /*</replacement>*/
/*<replacement>*/ /*<replacement>*/
@ -4198,7 +4195,7 @@ util.inherits = __webpack_require__(10);
/*</replacement>*/ /*</replacement>*/
var Readable = __webpack_require__(59); var Readable = __webpack_require__(59);
var Writable = __webpack_require__(38); var Writable = __webpack_require__(37);
util.inherits(Duplex, Readable); util.inherits(Duplex, Readable);
@ -4249,7 +4246,7 @@ function forEach(xs, f) {
/* 14 */ /* 14 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Snowflake = __webpack_require__(7); const Snowflake = __webpack_require__(6);
/** /**
* Represents any channel on Discord. * Represents any channel on Discord.
@ -4324,7 +4321,7 @@ module.exports = Channel;
/* 15 */ /* 15 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Snowflake = __webpack_require__(7); const Snowflake = __webpack_require__(6);
const Permissions = __webpack_require__(9); const Permissions = __webpack_require__(9);
const util = __webpack_require__(22); const util = __webpack_require__(22);
@ -4691,7 +4688,7 @@ module.exports = Role;
const TextBasedChannel = __webpack_require__(23); const TextBasedChannel = __webpack_require__(23);
const Constants = __webpack_require__(0); const Constants = __webpack_require__(0);
const Presence = __webpack_require__(11).Presence; const Presence = __webpack_require__(11).Presence;
const Snowflake = __webpack_require__(7); const Snowflake = __webpack_require__(6);
/** /**
* Represents a user on Discord. * Represents a user on Discord.
@ -4814,9 +4811,7 @@ class User {
* @readonly * @readonly
*/ */
get defaultAvatarURL() { get defaultAvatarURL() {
const avatars = Object.keys(Constants.DefaultAvatars); return Constants.Endpoints.CDN(this.client.options.http.host).DefaultAvatar(this.discriminator % 5);
const avatar = avatars[this.discriminator % avatars.length];
return Constants.Endpoints.CDN(this.client.options.http.host).Asset(`${Constants.DefaultAvatars[avatar]}.png`);
} }
/** /**
@ -5005,7 +5000,7 @@ module.exports = User;
const Constants = __webpack_require__(0); const Constants = __webpack_require__(0);
const Collection = __webpack_require__(3); const Collection = __webpack_require__(3);
const Snowflake = __webpack_require__(7); const Snowflake = __webpack_require__(6);
/** /**
* Represents a custom emoji. * Represents a custom emoji.
@ -5618,7 +5613,7 @@ class GuildMember {
*/ */
addRole(role) { addRole(role) {
if (!(role instanceof Role)) role = this.guild.roles.get(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); return this.client.rest.methods.addMemberRole(this, role);
} }
@ -5645,7 +5640,7 @@ class GuildMember {
*/ */
removeRole(role) { removeRole(role) {
if (!(role instanceof Role)) role = this.guild.roles.get(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); return this.client.rest.methods.removeMemberRole(this, role);
} }
@ -6445,7 +6440,7 @@ function objectToString(o) {
exports = module.exports = __webpack_require__(59); exports = module.exports = __webpack_require__(59);
exports.Stream = exports; exports.Stream = exports;
exports.Readable = exports; exports.Readable = exports;
exports.Writable = __webpack_require__(38); exports.Writable = __webpack_require__(37);
exports.Duplex = __webpack_require__(13); exports.Duplex = __webpack_require__(13);
exports.Transform = __webpack_require__(60); exports.Transform = __webpack_require__(60);
exports.PassThrough = __webpack_require__(85); exports.PassThrough = __webpack_require__(85);
@ -7042,7 +7037,7 @@ function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(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 */ /* 23 */
@ -7608,7 +7603,7 @@ exports.EOL = '\n';
/* 25 */ /* 25 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Long = __webpack_require__(35); const Long = __webpack_require__(34);
const User = __webpack_require__(16); const User = __webpack_require__(16);
const Role = __webpack_require__(15); const Role = __webpack_require__(15);
const Emoji = __webpack_require__(17); const Emoji = __webpack_require__(17);
@ -7617,7 +7612,7 @@ const GuildMember = __webpack_require__(18);
const Constants = __webpack_require__(0); const Constants = __webpack_require__(0);
const Collection = __webpack_require__(3); const Collection = __webpack_require__(3);
const Util = __webpack_require__(4); const Util = __webpack_require__(4);
const Snowflake = __webpack_require__(7); const Snowflake = __webpack_require__(6);
/** /**
* Represents a guild (or a server) on Discord. * Represents a guild (or a server) on Discord.
@ -9046,7 +9041,7 @@ module.exports = GuildChannel;
/* 27 */ /* 27 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Snowflake = __webpack_require__(7); const Snowflake = __webpack_require__(6);
const Constants = __webpack_require__(0); const Constants = __webpack_require__(0);
/** /**
@ -9429,16 +9424,10 @@ var substr = 'ab'.substr(-1) === 'b'
} }
; ;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
/***/ }), /***/ }),
/* 29 */ /* 29 */
/***/ (function(module, exports) {
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Channel = __webpack_require__(14); const Channel = __webpack_require__(14);
@ -9624,7 +9613,7 @@ module.exports = GroupDMChannel;
/***/ }), /***/ }),
/* 31 */ /* 30 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
/** /**
@ -9679,7 +9668,7 @@ module.exports = ReactionEmoji;
/***/ }), /***/ }),
/* 32 */ /* 31 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const path = __webpack_require__(28); const path = __webpack_require__(28);
@ -9916,7 +9905,7 @@ module.exports = Webhook;
/***/ }), /***/ }),
/* 33 */ /* 32 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Collection = __webpack_require__(3); const Collection = __webpack_require__(3);
@ -10100,7 +10089,7 @@ module.exports = Collector;
/***/ }), /***/ }),
/* 34 */ /* 33 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
@ -10216,7 +10205,7 @@ exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
/***/ }), /***/ }),
/* 35 */ /* 34 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@ -11434,7 +11423,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
/***/ }), /***/ }),
/* 36 */ /* 35 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
@ -11482,10 +11471,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__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
@ -11496,7 +11485,7 @@ exports.encode = exports.stringify = __webpack_require__(83);
/***/ }), /***/ }),
/* 38 */ /* 37 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
@ -11509,7 +11498,7 @@ exports.encode = exports.stringify = __webpack_require__(83);
module.exports = Writable; module.exports = Writable;
/*<replacement>*/ /*<replacement>*/
var processNextTick = __webpack_require__(36); var processNextTick = __webpack_require__(35);
/*</replacement>*/ /*</replacement>*/
/*<replacement>*/ /*<replacement>*/
@ -11539,7 +11528,7 @@ var Stream = __webpack_require__(61);
var Buffer = __webpack_require__(5).Buffer; var Buffer = __webpack_require__(5).Buffer;
/*<replacement>*/ /*<replacement>*/
var bufferShim = __webpack_require__(34); var bufferShim = __webpack_require__(33);
/*</replacement>*/ /*</replacement>*/
util.inherits(Writable, Stream); util.inherits(Writable, Stream);
@ -12044,82 +12033,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__) { /***/ (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'; // const ENV_VAR = '__SNEKFETCH_SYNC_REQUEST';
let first = true; // let first = true;
//
for (let method of Snekfetch.METHODS) { // for (let method of Snekfetch.METHODS) {
method = method === 'M-SEARCH' ? 'msearch' : method.toLowerCase(); // method = method === 'M-SEARCH' ? 'msearch' : method.toLowerCase();
Snekfetch[`${method}Sync`] = (url, options = {}) => { // Snekfetch[`${method}Sync`] = (url, options = {}) => {
if (first) { // if (first) {
first = false; // first = false;
console.error( // console.error(
'Performing sync requests is a really stupid thing to do. ' + // 'Performing sync requests is a really stupid thing to do. ' +
'https://www.google.com/search?q=why+sync+requests+are+bad+nodejs' // 'https://www.google.com/search?q=why+sync+requests+are+bad+nodejs'
); // );
} // }
options.url = url; // options.url = url;
options.method = method; // options.method = method;
const cp = __webpack_require__(29); // const cp = require('child_process');
const result = JSON.parse( // const result = JSON.parse(
cp.execSync(`node ${__dirname}/index.js`, { // cp.execSync(`node ${__dirname}/index.js`, {
env: { [ENV_VAR]: JSON.stringify(options) }, // env: { [ENV_VAR]: JSON.stringify(options) },
}).toString(), // }).toString(),
(k, v) => { // (k, v) => {
if (v === null) return v; // if (v === null) return v;
if (v.type === 'Buffer' && Array.isArray(v.data)) return new Buffer(v.data); // if (v.type === 'Buffer' && Array.isArray(v.data)) return new Buffer(v.data);
if (v.__CONVERT_TO_ERROR) { // if (v.__CONVERT_TO_ERROR) {
const e = new Error(); // const e = new Error();
for (const key of Object.keys(v)) { // for (const key of Object.keys(v)) {
if (key === '__CONVERT_TO_ERROR') continue; // if (key === '__CONVERT_TO_ERROR') continue;
e[key] = v[key]; // e[key] = v[key];
} // }
return e; // return e;
} // }
return v; // return v;
} // }
); // );
if (result.error) throw result.error; // if (result.error) throw result.error;
return result; // return result;
}; // };
} // }
//
if (process.env[ENV_VAR]) { // if (process.env[ENV_VAR]) {
const options = JSON.parse(process.env[ENV_VAR]); // const options = JSON.parse(process.env[ENV_VAR]);
const request = Snekfetch[options.method](options.url); // const request = Snekfetch[options.method](options.url);
if (options.headers) request.set(options.headers); // if (options.headers) request.set(options.headers);
if (options.body) request.send(options.body); // if (options.body) request.send(options.body);
request.end((err, res = {}) => { // request.end((err, res = {}) => {
if (err) { // if (err) {
const alt = {}; // const alt = {};
for (const name of Object.getOwnPropertyNames(err)) alt[name] = err[name]; // for (const name of Object.getOwnPropertyNames(err)) alt[name] = err[name];
res.error = alt; // res.error = alt;
res.error.__CONVERT_TO_ERROR = true; // res.error.__CONVERT_TO_ERROR = true;
} // }
// circulars // // circulars
res.request = null; // res.request = null;
process.stdout.write(JSON.stringify(res)); // process.stdout.write(JSON.stringify(res));
}); // });
} // }
module.exports = Snekfetch; module.exports = Snekfetch;
/* WEBPACK VAR INJECTION */}.call(exports, "node_modules/snekfetch", __webpack_require__(5).Buffer, __webpack_require__(6)))
/***/ }),
/* 39 */
/***/ (function(module, exports) {
/***/ }), /***/ }),
/* 40 */ /* 40 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {const path = __webpack_require__(28); /* WEBPACK VAR INJECTION */(function(Buffer) {const path = __webpack_require__(28);
const fs = __webpack_require__(29); const fs = __webpack_require__(39);
const snekfetch = __webpack_require__(39); const snekfetch = __webpack_require__(38);
const Constants = __webpack_require__(0); const Constants = __webpack_require__(0);
const convertToBuffer = __webpack_require__(4).convertToBuffer; const convertToBuffer = __webpack_require__(4).convertToBuffer;
@ -12129,7 +12123,7 @@ const Guild = __webpack_require__(25);
const Channel = __webpack_require__(14); const Channel = __webpack_require__(14);
const GuildMember = __webpack_require__(18); const GuildMember = __webpack_require__(18);
const Emoji = __webpack_require__(17); 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. * The DataResolver identifies different objects and tries to resolve a specific piece of information from them, e.g.
@ -12506,7 +12500,8 @@ module.exports = {
"discord.js-docgen": "hydrabolt/discord.js-docgen", "discord.js-docgen": "hydrabolt/discord.js-docgen",
"eslint": "^3.19.0", "eslint": "^3.19.0",
"parallel-webpack": "^1.6.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" "webpack": "^2.2.0"
}, },
"engines": { "engines": {
@ -13057,7 +13052,7 @@ module.exports = DMChannel;
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Collection = __webpack_require__(3); const Collection = __webpack_require__(3);
const Snowflake = __webpack_require__(7); const Snowflake = __webpack_require__(6);
const Targets = { const Targets = {
GUILD: 'GUILD', GUILD: 'GUILD',
@ -13584,7 +13579,7 @@ module.exports = MessageAttachment;
/* 48 */ /* 48 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Collector = __webpack_require__(33); const Collector = __webpack_require__(32);
const util = __webpack_require__(22); const util = __webpack_require__(22);
/** /**
@ -14231,7 +14226,7 @@ module.exports = MessageMentions;
const Collection = __webpack_require__(3); const Collection = __webpack_require__(3);
const Emoji = __webpack_require__(17); const Emoji = __webpack_require__(17);
const ReactionEmoji = __webpack_require__(31); const ReactionEmoji = __webpack_require__(30);
/** /**
* Represents a reaction to a message. * Represents a reaction to a message.
@ -14484,7 +14479,7 @@ module.exports = PermissionOverwrites;
/* 55 */ /* 55 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Collector = __webpack_require__(33); const Collector = __webpack_require__(32);
const Collection = __webpack_require__(3); const Collection = __webpack_require__(3);
/** /**
@ -14846,7 +14841,7 @@ module.exports = Array.isArray || function (arr) {
module.exports = Readable; module.exports = Readable;
/*<replacement>*/ /*<replacement>*/
var processNextTick = __webpack_require__(36); var processNextTick = __webpack_require__(35);
/*</replacement>*/ /*</replacement>*/
/*<replacement>*/ /*<replacement>*/
@ -14873,7 +14868,7 @@ var Stream = __webpack_require__(61);
var Buffer = __webpack_require__(5).Buffer; var Buffer = __webpack_require__(5).Buffer;
/*<replacement>*/ /*<replacement>*/
var bufferShim = __webpack_require__(34); var bufferShim = __webpack_require__(33);
/*</replacement>*/ /*</replacement>*/
/*<replacement>*/ /*<replacement>*/
@ -15776,7 +15771,7 @@ function indexOf(xs, x) {
} }
return -1; return -1;
} }
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
/***/ }), /***/ }),
/* 60 */ /* 60 */
@ -16371,7 +16366,7 @@ var protocolPattern = /^([a-z0-9.+-]+:)/i,
'gopher:': true, 'gopher:': true,
'file:': true 'file:': true
}, },
querystring = __webpack_require__(37); querystring = __webpack_require__(36);
function urlParse(url, parseQueryString, slashesDenoteHost) { function urlParse(url, parseQueryString, slashesDenoteHost) {
if (url && util.isObject(url) && url instanceof Url) return url; if (url && util.isObject(url) && url instanceof Url) return url;
@ -17409,7 +17404,7 @@ module.exports = RequestHandler;
/* WEBPACK VAR INJECTION */(function(Buffer) {const browser = __webpack_require__(24).platform() === 'browser'; /* WEBPACK VAR INJECTION */(function(Buffer) {const browser = __webpack_require__(24).platform() === 'browser';
const EventEmitter = __webpack_require__(12); const EventEmitter = __webpack_require__(12);
const Constants = __webpack_require__(0); const Constants = __webpack_require__(0);
const zlib = __webpack_require__(29); const zlib = __webpack_require__(39);
const PacketManager = __webpack_require__(144); const PacketManager = __webpack_require__(144);
const erlpack = (function findErlpack() { const erlpack = (function findErlpack() {
try { try {
@ -18460,13 +18455,13 @@ module.exports = Client;
* @param {string} info The debug information * @param {string} info The debug information
*/ */
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
/***/ }), /***/ }),
/* 72 */ /* 72 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const Webhook = __webpack_require__(32); const Webhook = __webpack_require__(31);
const RESTManager = __webpack_require__(68); const RESTManager = __webpack_require__(68);
const ClientDataResolver = __webpack_require__(40); const ClientDataResolver = __webpack_require__(40);
const Constants = __webpack_require__(0); const Constants = __webpack_require__(0);
@ -19903,7 +19898,7 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) {
var Buffer = __webpack_require__(5).Buffer; var Buffer = __webpack_require__(5).Buffer;
/*<replacement>*/ /*<replacement>*/
var bufferShim = __webpack_require__(34); var bufferShim = __webpack_require__(33);
/*</replacement>*/ /*</replacement>*/
module.exports = BufferList; module.exports = BufferList;
@ -19982,7 +19977,7 @@ module.exports = __webpack_require__(21).Transform
/* 89 */ /* 89 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(38); module.exports = __webpack_require__(37);
/***/ }), /***/ }),
@ -20176,7 +20171,7 @@ module.exports = __webpack_require__(38);
attachTo.clearImmediate = clearImmediate; attachTo.clearImmediate = clearImmediate;
}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); }(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 */ /* 91 */
@ -20198,19 +20193,19 @@ module.exports = {
] ]
], ],
"_from": "snekfetch@>=3.1.0 <4.0.0", "_from": "snekfetch@>=3.1.0 <4.0.0",
"_id": "snekfetch@3.1.2", "_id": "snekfetch@3.1.6",
"_inCache": true, "_inCache": true,
"_location": "/snekfetch", "_location": "/snekfetch",
"_nodeVersion": "7.9.0", "_nodeVersion": "7.9.0",
"_npmOperationalInternal": { "_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com", "host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/snekfetch-3.1.2.tgz_1492882967312_0.8088863184675574" "tmp": "tmp/snekfetch-3.1.6.tgz_1493569353717_0.8596337598282844"
}, },
"_npmUser": { "_npmUser": {
"name": "crawl", "name": "snek",
"email": "icrawltogo@gmail.com" "email": "me@gus.host"
}, },
"_npmVersion": "4.2.0", "_npmVersion": "4.5.0",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"raw": "snekfetch@^3.1.0", "raw": "snekfetch@^3.1.0",
@ -20224,8 +20219,8 @@ module.exports = {
"_requiredBy": [ "_requiredBy": [
"/" "/"
], ],
"_resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz", "_resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.6.tgz",
"_shasum": "3422a9191c1bb6610867db88e669db0b5adb7f42", "_shasum": "3090d5cd3f5bc1e456f8aafa5024f64b7ca5b1e0",
"_shrinkwrap": null, "_shrinkwrap": null,
"_spec": "snekfetch@^3.1.0", "_spec": "snekfetch@^3.1.0",
"_where": "/home/travis/build/hydrabolt/discord.js", "_where": "/home/travis/build/hydrabolt/discord.js",
@ -20241,10 +20236,10 @@ module.exports = {
"devDependencies": {}, "devDependencies": {},
"directories": {}, "directories": {},
"dist": { "dist": {
"shasum": "3422a9191c1bb6610867db88e669db0b5adb7f42", "shasum": "3090d5cd3f5bc1e456f8aafa5024f64b7ca5b1e0",
"tarball": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.2.tgz" "tarball": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.1.6.tgz"
}, },
"gitHead": "a79f6867d21ca58ffe6fc59eb77b06f257f8ad29", "gitHead": "b03a6bb7d3b73ac3a4b27c7cfffcfbaa87d38700",
"homepage": "https://github.com/GusCaplan/snekfetch#readme", "homepage": "https://github.com/GusCaplan/snekfetch#readme",
"license": "MIT", "license": "MIT",
"main": "index.js", "main": "index.js",
@ -20253,6 +20248,10 @@ module.exports = {
"name": "crawl", "name": "crawl",
"email": "icrawltogo@gmail.com" "email": "icrawltogo@gmail.com"
}, },
{
"name": "hydrabolt",
"email": "amishshah.2k@gmail.com"
},
{ {
"name": "snek", "name": "snek",
"email": "me@gus.host" "email": "me@gus.host"
@ -20266,7 +20265,7 @@ module.exports = {
"url": "git+https://github.com/GusCaplan/snekfetch.git" "url": "git+https://github.com/GusCaplan/snekfetch.git"
}, },
"scripts": {}, "scripts": {},
"version": "3.1.2" "version": "3.1.6"
}; };
/***/ }), /***/ }),
@ -20289,7 +20288,7 @@ class FormData {
if (filename) { if (filename) {
str += `; filename="${filename}"`; str += `; filename="${filename}"`;
mimetype = 'application/octet-stream'; mimetype = 'application/octet-stream';
const extname = path.extname(filename); const extname = path.extname(filename).slice(1);
if (extname) mimetype = mime.lookup(extname); if (extname) mimetype = mime.lookup(extname);
} }
@ -20328,8 +20327,8 @@ module.exports = FormData;
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {__webpack_require__(62); /* WEBPACK VAR INJECTION */(function(Buffer) {__webpack_require__(62);
const zlib = __webpack_require__(29); const zlib = __webpack_require__(39);
const qs = __webpack_require__(37); const qs = __webpack_require__(36);
const http = __webpack_require__(63); const http = __webpack_require__(63);
const https = __webpack_require__(79); const https = __webpack_require__(79);
const URL = __webpack_require__(65); const URL = __webpack_require__(65);
@ -20382,7 +20381,7 @@ class Snekfetch extends Stream.Readable {
send(data) { send(data) {
if (this.request.res) throw new Error('Cannot modify data after being sent!'); if (this.request.res) throw new Error('Cannot modify data after being sent!');
if (data !== null && typeof data === 'object') { if (data !== null && typeof data === 'object') {
const header = this.request.getHeader('content-type'); const header = this._getHeader('content-type');
let serialize; let serialize;
if (header) { if (header) {
if (header.includes('json')) serialize = JSON.stringify; if (header.includes('json')) serialize = JSON.stringify;
@ -20513,7 +20512,7 @@ class Snekfetch extends Stream.Readable {
_read() { _read() {
this.resume(); this.resume();
if (this.request.res) return; if (this.response) return;
this.catch((err) => this.emit('error', err)); this.catch((err) => this.emit('error', err));
} }
@ -20534,11 +20533,24 @@ class Snekfetch extends Stream.Readable {
_addFinalHeaders() { _addFinalHeaders() {
if (!this.request) return; 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/, '')})`); this.set('User-Agent', `snekfetch/${Snekfetch.version} (${Package.repository.url.replace(/\.?git/, '')})`);
} }
if (this.request.method !== 'HEAD') this.set('Accept-Encoding', 'gzip, deflate'); 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; Snekfetch.version = Package.version;
@ -22276,8 +22288,10 @@ ClientRequest.prototype.setHeader = function (name, value) {
} }
ClientRequest.prototype.getHeader = function (name) { ClientRequest.prototype.getHeader = function (name) {
var self = this var header = this._headers[name.toLowerCase()]
return self._headers[name.toLowerCase()].value if (header)
return header.value
return null
} }
ClientRequest.prototype.removeHeader = function (name) { ClientRequest.prototype.removeHeader = function (name) {
@ -22498,7 +22512,7 @@ var unsafeHeaders = [
'via' '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 */ /* 98 */
@ -22687,7 +22701,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 */ /* 99 */
@ -22984,7 +22998,7 @@ const Emoji = __webpack_require__(17);
const TextChannel = __webpack_require__(56); const TextChannel = __webpack_require__(56);
const VoiceChannel = __webpack_require__(57); const VoiceChannel = __webpack_require__(57);
const GuildChannel = __webpack_require__(26); const GuildChannel = __webpack_require__(26);
const GroupDMChannel = __webpack_require__(30); const GroupDMChannel = __webpack_require__(29);
class ClientDataManager { class ClientDataManager {
constructor(client) { constructor(client) {
@ -23156,7 +23170,7 @@ class ClientManager {
const gateway = `${res.url}/?v=${protocolVersion}&encoding=${WebSocketConnection.ENCODING}`; const gateway = `${res.url}/?v=${protocolVersion}&encoding=${WebSocketConnection.ENCODING}`;
this.client.emit(Constants.Events.DEBUG, `Using gateway ${gateway}`); this.client.emit(Constants.Events.DEBUG, `Using gateway ${gateway}`);
this.client.ws.connect(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 === 4004) reject(new Error(Constants.Errors.BAD_LOGIN));
if (event.code === 4010) reject(new Error(Constants.Errors.INVALID_SHARD)); if (event.code === 4010) reject(new Error(Constants.Errors.INVALID_SHARD));
if (event.code === 4011) reject(new Error(Constants.Errors.SHARDING_REQUIRED)); if (event.code === 4011) reject(new Error(Constants.Errors.SHARDING_REQUIRED));
@ -24216,7 +24230,7 @@ module.exports = UserUpdateAction;
/* 138 */ /* 138 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const snekfetch = __webpack_require__(39); const snekfetch = __webpack_require__(38);
const Constants = __webpack_require__(0); const Constants = __webpack_require__(0);
class APIRequest { class APIRequest {
@ -24272,13 +24286,13 @@ module.exports = APIRequest;
/* 139 */ /* 139 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
const querystring = __webpack_require__(37); const querystring = __webpack_require__(36);
const long = __webpack_require__(35); const long = __webpack_require__(34);
const Permissions = __webpack_require__(9); const Permissions = __webpack_require__(9);
const Constants = __webpack_require__(0); const Constants = __webpack_require__(0);
const Endpoints = Constants.Endpoints; const Endpoints = Constants.Endpoints;
const Collection = __webpack_require__(3); const Collection = __webpack_require__(3);
const Snowflake = __webpack_require__(7); const Snowflake = __webpack_require__(6);
const Util = __webpack_require__(4); const Util = __webpack_require__(4);
const User = __webpack_require__(16); const User = __webpack_require__(16);
@ -24286,11 +24300,11 @@ const GuildMember = __webpack_require__(18);
const Message = __webpack_require__(19); const Message = __webpack_require__(19);
const Role = __webpack_require__(15); const Role = __webpack_require__(15);
const Invite = __webpack_require__(46); const Invite = __webpack_require__(46);
const Webhook = __webpack_require__(32); const Webhook = __webpack_require__(31);
const UserProfile = __webpack_require__(183); const UserProfile = __webpack_require__(183);
const OAuth2Application = __webpack_require__(27); const OAuth2Application = __webpack_require__(27);
const Channel = __webpack_require__(14); const Channel = __webpack_require__(14);
const GroupDMChannel = __webpack_require__(30); const GroupDMChannel = __webpack_require__(29);
const Guild = __webpack_require__(25); const Guild = __webpack_require__(25);
const VoiceRegion = __webpack_require__(184); const VoiceRegion = __webpack_require__(184);
const GuildAuditLogs = __webpack_require__(45); const GuildAuditLogs = __webpack_require__(45);
@ -24739,7 +24753,10 @@ class RESTMethods {
} }
updateGuildMember(member, data) { 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); if (data.roles) data.roles = data.roles.map(role => role instanceof Role ? role.id : role);
let endpoint = Endpoints.Member(member); let endpoint = Endpoints.Member(member);
@ -25379,7 +25396,7 @@ UserAgentManager.DEFAULT = {
module.exports = UserAgentManager; module.exports = UserAgentManager;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7)))
/***/ }), /***/ }),
/* 143 */ /* 143 */
@ -26635,8 +26652,8 @@ module.exports = {
Constants: __webpack_require__(0), Constants: __webpack_require__(0),
EvaluatedPermissions: __webpack_require__(9), EvaluatedPermissions: __webpack_require__(9),
Permissions: __webpack_require__(9), Permissions: __webpack_require__(9),
Snowflake: __webpack_require__(7), Snowflake: __webpack_require__(6),
SnowflakeUtil: __webpack_require__(7), SnowflakeUtil: __webpack_require__(6),
Util: Util, Util: Util,
util: Util, util: Util,
version: __webpack_require__(41).version, version: __webpack_require__(41).version,
@ -26650,11 +26667,11 @@ module.exports = {
Channel: __webpack_require__(14), Channel: __webpack_require__(14),
ClientUser: __webpack_require__(42), ClientUser: __webpack_require__(42),
ClientUserSettings: __webpack_require__(43), ClientUserSettings: __webpack_require__(43),
Collector: __webpack_require__(33), Collector: __webpack_require__(32),
DMChannel: __webpack_require__(44), DMChannel: __webpack_require__(44),
Emoji: __webpack_require__(17), Emoji: __webpack_require__(17),
Game: __webpack_require__(11).Game, Game: __webpack_require__(11).Game,
GroupDMChannel: __webpack_require__(30), GroupDMChannel: __webpack_require__(29),
Guild: __webpack_require__(25), Guild: __webpack_require__(25),
GuildAuditLogs: __webpack_require__(45), GuildAuditLogs: __webpack_require__(45),
GuildChannel: __webpack_require__(26), GuildChannel: __webpack_require__(26),
@ -26672,14 +26689,14 @@ module.exports = {
PartialGuildChannel: __webpack_require__(53), PartialGuildChannel: __webpack_require__(53),
PermissionOverwrites: __webpack_require__(54), PermissionOverwrites: __webpack_require__(54),
Presence: __webpack_require__(11).Presence, Presence: __webpack_require__(11).Presence,
ReactionEmoji: __webpack_require__(31), ReactionEmoji: __webpack_require__(30),
ReactionCollector: __webpack_require__(55), ReactionCollector: __webpack_require__(55),
RichEmbed: __webpack_require__(73), RichEmbed: __webpack_require__(73),
Role: __webpack_require__(15), Role: __webpack_require__(15),
TextChannel: __webpack_require__(56), TextChannel: __webpack_require__(56),
User: __webpack_require__(16), User: __webpack_require__(16),
VoiceChannel: __webpack_require__(57), 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 if (__webpack_require__(24).platform() === 'browser') window.Discord = module.exports; // eslint-disable-line no-undef

16
discord.master.min.js vendored

File diff suppressed because one or more lines are too long