diff options
Diffstat (limited to 'src/commands/admin/roleAll.ts')
-rw-r--r-- | src/commands/admin/roleAll.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/commands/admin/roleAll.ts b/src/commands/admin/roleAll.ts index ec18060..2382a4b 100644 --- a/src/commands/admin/roleAll.ts +++ b/src/commands/admin/roleAll.ts @@ -45,7 +45,11 @@ export default class RoleAllCommand extends BushCommand { ); } + console.time('roleAll1'); let members = await message.guild.members.fetch(); + console.timeEnd('roleAll1'); + + console.time('roleAll2'); members = members.filter((member: GuildMember) => { try { if (member.user.bot && !args.bot) return false; @@ -55,14 +59,21 @@ export default class RoleAllCommand extends BushCommand { } return true; }); + console.timeEnd('roleAll2'); + console.time('roleAll3'); await message.util.reply(`${this.client.util.emojis.loading} adding roles to ${members.size} members`); + console.timeEnd('roleAll3'); + console.time('roleAll4'); const promises = members.map((member: GuildMember) => { return member.roles.add(args.role, `RoleAll Command - triggered by ${message.author.tag} (${message.author.id})`); }); + console.timeEnd('roleAll4'); + console.time('roleAll5'); const failed = (await Promise.allSettled(promises)).filter((val) => val.status === 'rejected'); + console.timeEnd('roleAll5'); if (!failed.length) { await message.util.reply({ |