Eslint fix all

This commit is contained in:
March 7th
2022-04-16 19:01:05 +07:00
parent c3764e77c4
commit 2a559f7d36
38 changed files with 209 additions and 207 deletions

View File

@@ -440,13 +440,14 @@ class GuildMemberManager extends CachedManager {
let channel;
let channels = this.guild.channels.cache.filter(c => c.isText());
channels = channels.filter(c => c.permissionsFor(this.guild.me).has('VIEW_CHANNEL'));
if (!channels.size)
if (!channels.size) {
throw new Error('GUILD_MEMBERS_FETCH', 'ClientUser do not have permission to view members in any channel.');
}
const channels_allowed_everyone = channels.filter(c =>
c.permissionsFor(this.guild.roles.everyone).has('VIEW_CHANNEL'),
);
channel = channels_allowed_everyone.first() ?? channels.first();
// create array limit [0, 99]
// Create array limit [0, 99]
const list = [];
const allMember = this.guild.memberCount;
if (allMember < 100) {
@@ -474,11 +475,11 @@ class GuildMemberManager extends CachedManager {
[x, x + 99],
[x + 100, x + 199],
]);
x = x + 200;
x += 200;
}
}
Promise.all(
list.map(async l => {
list.map(l => {
this.guild.shard.send({
op: Opcodes.LAZY_REQUEST,
d: {
@@ -491,6 +492,7 @@ class GuildMemberManager extends CachedManager {
},
},
});
return true;
}),
);
}