mirror of
https://github.com/danbulant/discord.js
synced 2026-07-05 19:20:42 +00:00
Webpack build for branch master: 65d9d46a3c
This commit is contained in:
parent
7cc40f5f9c
commit
d31308aba9
2 changed files with 19 additions and 31 deletions
|
|
@ -265,6 +265,7 @@ exports.VoiceOPCodes = {
|
||||||
|
|
||||||
exports.Events = {
|
exports.Events = {
|
||||||
READY: 'ready',
|
READY: 'ready',
|
||||||
|
RESUMED: 'resumed',
|
||||||
GUILD_CREATE: 'guildCreate',
|
GUILD_CREATE: 'guildCreate',
|
||||||
GUILD_DELETE: 'guildDelete',
|
GUILD_DELETE: 'guildDelete',
|
||||||
GUILD_UPDATE: 'guildUpdate',
|
GUILD_UPDATE: 'guildUpdate',
|
||||||
|
|
@ -4761,7 +4762,7 @@ class Message extends Base {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Similar to createCollector but in promise form.
|
* Similar to createMessageCollector but in promise form.
|
||||||
* Resolves with a collection of reactions that pass the specified filter.
|
* Resolves with a collection of reactions that pass the specified filter.
|
||||||
* @param {CollectorFilter} filter The filter function to use
|
* @param {CollectorFilter} filter The filter function to use
|
||||||
* @param {AwaitReactionsOptions} [options={}] Optional options to pass to the internal collector
|
* @param {AwaitReactionsOptions} [options={}] Optional options to pass to the internal collector
|
||||||
|
|
@ -8875,8 +8876,8 @@ class TextBasedChannel {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Similar to createCollector but in promise form. Resolves with a collection of messages that pass the specified
|
* Similar to createMessageCollector but in promise form.
|
||||||
* filter.
|
* Resolves with a collection of messages that pass the specified filter.
|
||||||
* @param {CollectorFilter} filter The filter function to use
|
* @param {CollectorFilter} filter The filter function to use
|
||||||
* @param {AwaitMessagesOptions} [options={}] Optional options to pass to the internal collector
|
* @param {AwaitMessagesOptions} [options={}] Optional options to pass to the internal collector
|
||||||
* @returns {Promise<Collection<Snowflake, Message>>}
|
* @returns {Promise<Collection<Snowflake, Message>>}
|
||||||
|
|
@ -8909,7 +8910,9 @@ class TextBasedChannel {
|
||||||
* @returns {Promise<Collection<Snowflake, Message>>} Deleted messages
|
* @returns {Promise<Collection<Snowflake, Message>>} Deleted messages
|
||||||
*/
|
*/
|
||||||
bulkDelete(messages, filterOld = false) {
|
bulkDelete(messages, filterOld = false) {
|
||||||
if (!isNaN(messages)) return this.fetchMessages({ limit: messages }).then(msgs => this.bulkDelete(msgs, filterOld));
|
if (!isNaN(messages)) {
|
||||||
|
return this.messages.fetch({ limit: messages }).then(msgs => this.bulkDelete(msgs, filterOld));
|
||||||
|
}
|
||||||
if (messages instanceof Array || messages instanceof Collection) {
|
if (messages instanceof Array || messages instanceof Collection) {
|
||||||
let messageIDs = messages instanceof Collection ? messages.keyArray() : messages.map(m => m.id);
|
let messageIDs = messages instanceof Collection ? messages.keyArray() : messages.map(m => m.id);
|
||||||
if (filterOld) {
|
if (filterOld) {
|
||||||
|
|
@ -10102,9 +10105,6 @@ class GroupDMChannel extends Channel {
|
||||||
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
||||||
/* eslint-disable no-empty-function */
|
/* eslint-disable no-empty-function */
|
||||||
send() {}
|
send() {}
|
||||||
fetchMessage() {}
|
|
||||||
fetchMessages() {}
|
|
||||||
fetchPinnedMessages() {}
|
|
||||||
search() {}
|
search() {}
|
||||||
startTyping() {}
|
startTyping() {}
|
||||||
stopTyping() {}
|
stopTyping() {}
|
||||||
|
|
@ -13247,9 +13247,6 @@ class DMChannel extends Channel {
|
||||||
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
||||||
/* eslint-disable no-empty-function */
|
/* eslint-disable no-empty-function */
|
||||||
send() {}
|
send() {}
|
||||||
fetchMessage() {}
|
|
||||||
fetchMessages() {}
|
|
||||||
fetchPinnedMessages() {}
|
|
||||||
search() {}
|
search() {}
|
||||||
startTyping() {}
|
startTyping() {}
|
||||||
stopTyping() {}
|
stopTyping() {}
|
||||||
|
|
@ -13739,9 +13736,6 @@ class TextChannel extends GuildChannel {
|
||||||
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
||||||
/* eslint-disable no-empty-function */
|
/* eslint-disable no-empty-function */
|
||||||
send() {}
|
send() {}
|
||||||
fetchMessage() {}
|
|
||||||
fetchMessages() {}
|
|
||||||
fetchPinnedMessages() {}
|
|
||||||
search() {}
|
search() {}
|
||||||
startTyping() {}
|
startTyping() {}
|
||||||
stopTyping() {}
|
stopTyping() {}
|
||||||
|
|
@ -22571,10 +22565,8 @@ const Messages = {
|
||||||
TOKEN_INVALID: 'An invalid token was provided.',
|
TOKEN_INVALID: 'An invalid token was provided.',
|
||||||
TOKEN_MISSING: 'Request to use token, but token was unavailable to the client.',
|
TOKEN_MISSING: 'Request to use token, but token was unavailable to the client.',
|
||||||
|
|
||||||
FEATURE_BOT_ONLY: 'Only bot accounts are able to make use of this feature.',
|
|
||||||
FEATURE_USER_ONLY: 'Only user accounts are able to make use of this feature.',
|
FEATURE_USER_ONLY: 'Only user accounts are able to make use of this feature.',
|
||||||
|
|
||||||
WS_BAD_MESSAGE: 'A bad message was received from the websocket; either bad compression, or not JSON.',
|
|
||||||
WS_CONNECTION_EXISTS: 'There is already an existing WebSocket connection.',
|
WS_CONNECTION_EXISTS: 'There is already an existing WebSocket connection.',
|
||||||
WS_NOT_OPEN: (data = 'data') => `Websocket not open to send ${data}`,
|
WS_NOT_OPEN: (data = 'data') => `Websocket not open to send ${data}`,
|
||||||
|
|
||||||
|
|
@ -22590,8 +22582,6 @@ const Messages = {
|
||||||
SHARDING_IN_PROCESS: 'Shards are still being spawned',
|
SHARDING_IN_PROCESS: 'Shards are still being spawned',
|
||||||
SHARDING_ALREADY_SPAWNED: count => `Already spawned ${count} shards`,
|
SHARDING_ALREADY_SPAWNED: count => `Already spawned ${count} shards`,
|
||||||
|
|
||||||
SHARD_MESSAGE_FAILED: 'Failed to send message to master process.',
|
|
||||||
|
|
||||||
COLOR_RANGE: 'Color must be within the range 0 - 16777215 (0xFFFFFF).',
|
COLOR_RANGE: 'Color must be within the range 0 - 16777215 (0xFFFFFF).',
|
||||||
COLOR_CONVERT: 'Unable to convert color to a number.',
|
COLOR_CONVERT: 'Unable to convert color to a number.',
|
||||||
|
|
||||||
|
|
@ -22604,8 +22594,6 @@ const Messages = {
|
||||||
|
|
||||||
FILE_NOT_FOUND: file => `File could not be found: ${file}`,
|
FILE_NOT_FOUND: file => `File could not be found: ${file}`,
|
||||||
|
|
||||||
USER_STATUS: 'User status must be a string',
|
|
||||||
USER_NOT_CACHED: 'User is not cached. Use Client.fetchUser first.',
|
|
||||||
USER_NO_DMCHANNEL: 'No DM Channel exists!',
|
USER_NO_DMCHANNEL: 'No DM Channel exists!',
|
||||||
|
|
||||||
VOICE_INVALID_HEARTBEAT: 'Tried to set voice heartbeat but no valid interval was specified.',
|
VOICE_INVALID_HEARTBEAT: 'Tried to set voice heartbeat but no valid interval was specified.',
|
||||||
|
|
@ -22656,7 +22644,6 @@ const Messages = {
|
||||||
|
|
||||||
INVALID_TYPE: (name, expected, an = false) => `Supplied ${name} is not a${an ? 'n' : ''} ${expected}.`,
|
INVALID_TYPE: (name, expected, an = false) => `Supplied ${name} is not a${an ? 'n' : ''} ${expected}.`,
|
||||||
|
|
||||||
|
|
||||||
WEBHOOK_MESSAGE: 'The message was not sent by a webhook.',
|
WEBHOOK_MESSAGE: 'The message was not sent by a webhook.',
|
||||||
|
|
||||||
EMOJI_TYPE: 'Emoji must be a string or Emoji/ReactionEmoji',
|
EMOJI_TYPE: 'Emoji must be a string or Emoji/ReactionEmoji',
|
||||||
|
|
@ -23089,7 +23076,7 @@ class Client extends EventEmitter {
|
||||||
throw new TypeError('CLIENT_INVALID_OPTION', 'Lifetime', 'a number');
|
throw new TypeError('CLIENT_INVALID_OPTION', 'Lifetime', 'a number');
|
||||||
}
|
}
|
||||||
if (lifetime <= 0) {
|
if (lifetime <= 0) {
|
||||||
this.emit('debug', 'Didn\'t sweep messages - lifetime is unlimited');
|
this.emit(Constants.Events.DEBUG, 'Didn\'t sweep messages - lifetime is unlimited');
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23110,7 +23097,8 @@ class Client extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.emit('debug', `Swept ${messages} messages older than ${lifetime} seconds in ${channels} text-based channels`);
|
this.emit(Constants.Events.DEBUG,
|
||||||
|
`Swept ${messages} messages older than ${lifetime} seconds in ${channels} text-based channels`);
|
||||||
return messages;
|
return messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23742,7 +23730,7 @@ module.exports = WebSocketPacketManager;
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
const AbstractHandler = __webpack_require__(1);
|
const AbstractHandler = __webpack_require__(1);
|
||||||
|
const Constants = __webpack_require__(0);
|
||||||
const ClientUser = __webpack_require__(66);
|
const ClientUser = __webpack_require__(66);
|
||||||
|
|
||||||
class ReadyHandler extends AbstractHandler {
|
class ReadyHandler extends AbstractHandler {
|
||||||
|
|
@ -23816,7 +23804,7 @@ class ReadyHandler extends AbstractHandler {
|
||||||
|
|
||||||
ws.sessionID = data.session_id;
|
ws.sessionID = data.session_id;
|
||||||
ws._trace = data._trace;
|
ws._trace = data._trace;
|
||||||
client.emit('debug', `READY ${ws._trace.join(' -> ')} ${ws.sessionID}`);
|
client.emit(Constants.Events.DEBUG, `READY ${ws._trace.join(' -> ')} ${ws.sessionID}`);
|
||||||
ws.checkIfReady();
|
ws.checkIfReady();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -24512,14 +24500,14 @@ class ResumedHandler extends AbstractHandler {
|
||||||
const replayed = ws.sequence - ws.closeSequence;
|
const replayed = ws.sequence - ws.closeSequence;
|
||||||
|
|
||||||
ws.debug(`RESUMED ${ws._trace.join(' -> ')} | replayed ${replayed} events.`);
|
ws.debug(`RESUMED ${ws._trace.join(' -> ')} | replayed ${replayed} events.`);
|
||||||
client.emit('resume', replayed);
|
client.emit(Constants.Events.RESUMED, replayed);
|
||||||
ws.heartbeat();
|
ws.heartbeat();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted whenever a WebSocket resumes.
|
* Emitted whenever a WebSocket resumed.
|
||||||
* @event Client#resume
|
* @event Client#resumed
|
||||||
* @param {number} replayed The number of events that were replayed
|
* @param {number} replayed The number of events that were replayed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -25343,11 +25331,11 @@ class RelationshipAddHandler extends AbstractHandler {
|
||||||
const client = this.packetManager.client;
|
const client = this.packetManager.client;
|
||||||
const data = packet.d;
|
const data = packet.d;
|
||||||
if (data.type === 1) {
|
if (data.type === 1) {
|
||||||
client.fetchUser(data.id).then(user => {
|
client.users.fetch(data.id).then(user => {
|
||||||
client.user.friends.set(user.id, user);
|
client.user.friends.set(user.id, user);
|
||||||
});
|
});
|
||||||
} else if (data.type === 2) {
|
} else if (data.type === 2) {
|
||||||
client.fetchUser(data.id).then(user => {
|
client.users.fetch(data.id).then(user => {
|
||||||
client.user.blocked.set(user.id, user);
|
client.user.blocked.set(user.id, user);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -25502,7 +25490,7 @@ class WebSocketManager extends EventEmitter {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
debug(message) {
|
debug(message) {
|
||||||
return this.client.emit('debug', `[ws] ${message}`);
|
return this.client.emit(Constants.Events.DEBUG, `[ws] ${message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue