feat: remove messageCreateEventGuildTimeout & change UA default
This commit is contained in:
@@ -677,9 +677,6 @@ class Client extends BaseClient {
|
||||
if (!Array.isArray(options.partials)) {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'partials', 'an Array');
|
||||
}
|
||||
if (typeof options.messageCreateEventGuildTimeout !== 'number' || isNaN(options.messageCreateEventGuildTimeout)) {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'messageCreateEventGuildTimeout', 'a number');
|
||||
}
|
||||
if (typeof options.DMChannelVoiceStatusSync !== 'number' || isNaN(options.DMChannelVoiceStatusSync)) {
|
||||
throw new TypeError('CLIENT_INVALID_OPTION', 'DMChannelVoiceStatusSync', 'a number');
|
||||
}
|
||||
|
@@ -38,23 +38,27 @@ module.exports = (client, { d: data }, shard) => {
|
||||
// ClientSetting
|
||||
client.settings._patch(data.user_settings);
|
||||
|
||||
if (largeGuilds.length) {
|
||||
client.ws.broadcast({
|
||||
op: Opcodes.GUILD_SUBSCRIPTIONS_BULK,
|
||||
d: {
|
||||
subscriptions: largeGuilds.reduce((accumulator, guild) => {
|
||||
accumulator[guild.id] = {
|
||||
typing: true,
|
||||
threads: true,
|
||||
activities: true,
|
||||
member_updates: true,
|
||||
thread_member_lists: [],
|
||||
members: [],
|
||||
channels: {},
|
||||
};
|
||||
return accumulator;
|
||||
}, {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Promise.all(
|
||||
largeGuilds.map(async (guild, index) => {
|
||||
client.ws.broadcast({
|
||||
op: Opcodes.GUILD_SUBSCRIPTIONS,
|
||||
d: {
|
||||
guild_id: guild.id,
|
||||
typing: true,
|
||||
threads: true,
|
||||
activities: true,
|
||||
thread_member_lists: [],
|
||||
members: [],
|
||||
channels: {},
|
||||
},
|
||||
});
|
||||
client.emit('debug', `[READY] Register guild ${guild.id}`);
|
||||
await client.sleep(client.options.messageCreateEventGuildTimeout * index);
|
||||
}),
|
||||
data.private_channels.map(async (c, index) => {
|
||||
if (client.options.DMChannelVoiceStatusSync < 1) return;
|
||||
client.ws.broadcast({
|
||||
|
Reference in New Issue
Block a user