3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fixed fatal error for massbans

This commit is contained in:
Lily Bergonzat 2024-02-24 20:52:41 +01:00
parent e879a15aa4
commit ee861bb5e9

View file

@ -57,9 +57,13 @@ export async function actualMassBanCmd(
const waitTimeStart = performance.now();
const waitingInterval = setInterval(() => {
const waitTime = humanizeDurationShort(performance.now() - waitTimeStart, { round: true });
loadingMsg
.edit(`Massban queued. Still waiting for previous massban to finish (waited ${waitTime}).`)
.catch(() => clearInterval(waitingInterval));
const waitMessageContent = `Massban queued. Still waiting for previous massban to finish (waited ${waitTime}).`;
if (isContextInteraction(context)) {
context.editReply(waitMessageContent).catch(() => clearInterval(waitingInterval));
} else {
loadingMsg.edit(waitMessageContent).catch(() => clearInterval(waitingInterval));
}
}, 1 * MINUTES);
pluginData.state.massbanQueue.add(async () => {