fix(arabot): move interaction updates out of the loop

This commit is contained in:
Anthony 2022-07-30 02:56:52 +01:00
parent bb794ccf7c
commit 63611566bc

View File

@ -98,6 +98,8 @@ export class purgeVerifyingCommand extends Command {
return `${minutes}:${(seconds < 10 ? '0' : '') + seconds}`;
}
await interaction.editReply(`Processing ${verVeganLength} users...\nEstimated time to completion: ${calcETA(apiTimeout, 0, verVeganLength)}`);
// Goes through every member with the verify-as-vegan role
for (let i = 0; i < verVeganLength; i++) {
const member = verVegan[i];
@ -109,7 +111,6 @@ export class purgeVerifyingCommand extends Command {
await member.roles.remove(IDs.roles.verifyingAsVegan);
await member.roles.add(IDs.roles.nonvegan.nonvegan);
}
await interaction.editReply(`Processed ${i + 1}/${verVeganLength} users\nEstimated time to completion: ${calcETA(apiTimeout, i, verVeganLength)}`);
}, apiTimeout * i);
}