chore(release): v2.3.8
This commit is contained in:
@@ -814,6 +814,24 @@ class Client extends BaseClient {
|
||||
} else {
|
||||
options.intents = Intents.resolve(options.intents);
|
||||
}
|
||||
if (options && typeof options.checkUpdate !== 'boolean') {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'checkUpdate', 'a boolean');
|
||||
}
|
||||
if (options && typeof options.readyStatus !== 'boolean') {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'readyStatus', 'a boolean');
|
||||
}
|
||||
if (options && typeof options.autoCookie !== 'boolean') {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'autoCookie', 'a boolean');
|
||||
}
|
||||
if (options && typeof options.autoRedeemNitro !== 'boolean') {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'autoRedeemNitro', 'a boolean');
|
||||
}
|
||||
if (options && typeof options.DMSync !== 'boolean') {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'DMSync', 'a boolean');
|
||||
}
|
||||
if (options && typeof options.patchVoice !== 'boolean') {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'patchVoice', 'a boolean');
|
||||
}
|
||||
if (typeof options.shardCount !== 'number' || isNaN(options.shardCount) || options.shardCount < 1) {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'shardCount', 'a number greater than or equal to 1');
|
||||
}
|
||||
|
@@ -117,14 +117,23 @@ module.exports = (client, { d: data }, shard) => {
|
||||
|
||||
client.user._patchNote(data.notes);
|
||||
|
||||
const syncTime = Date.now();
|
||||
for (const private_channel of data.private_channels) {
|
||||
const PrivateChannel = client.channels._add(private_channel);
|
||||
client.ws.broadcast({
|
||||
op: Opcodes.DM_UPDATE,
|
||||
d: {
|
||||
channel_id: PrivateChannel.id,
|
||||
},
|
||||
});
|
||||
const channel = client.channels._add(private_channel);
|
||||
// Rate limit warning
|
||||
if (client.options.DMSync) {
|
||||
client.ws.broadcast({
|
||||
op: Opcodes.DM_UPDATE,
|
||||
d: {
|
||||
channel_id: channel.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
if (client.options.DMSync) {
|
||||
console.warn(
|
||||
`Gateway Rate Limit Warning: Sending ${data.private_channels.length} Requests / ${Date.now() - syncTime || 1} ms`,
|
||||
);
|
||||
}
|
||||
// Remove event because memory leak
|
||||
|
||||
|
Reference in New Issue
Block a user