mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
refactor: ES2021 features (#6540)
Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Voltrex <mohammadkeyvanzade94@gmail.com>
This commit is contained in:
@@ -380,9 +380,7 @@ class ApplicationCommandPermissionsManager extends BaseManager {
|
||||
if (!commandId && this.guild) {
|
||||
commandId = this.guild.commands.resolveId(command);
|
||||
}
|
||||
if (!commandId) {
|
||||
commandId = this.client.application?.commands.resolveId(command);
|
||||
}
|
||||
commandId ??= this.client.application?.commands.resolveId(command);
|
||||
if (!commandId) {
|
||||
throw new TypeError('INVALID_TYPE', 'command', 'ApplicationCommandResolvable', true);
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ class GuildManager extends CachedManager {
|
||||
this.client.removeListener(Events.GUILD_CREATE, handleGuild);
|
||||
this.client.decrementMaxListeners();
|
||||
resolve(this.client.guilds._add(data));
|
||||
}, 10000).unref();
|
||||
}, 10_000).unref();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ class GuildMemberManager extends CachedManager {
|
||||
for (const member of members.values()) {
|
||||
fetchedMembers.set(member.id, member);
|
||||
}
|
||||
if (members.size < 1000 || (limit && fetchedMembers.size >= limit) || i === chunk.count) {
|
||||
if (members.size < 1_000 || (limit && fetchedMembers.size >= limit) || i === chunk.count) {
|
||||
clearTimeout(timeout);
|
||||
this.client.removeListener(Events.GUILD_MEMBERS_CHUNK, handler);
|
||||
this.client.decrementMaxListeners();
|
||||
|
||||
Reference in New Issue
Block a user