mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
Fixed fatal error for massbans
This commit is contained in:
parent
e879a15aa4
commit
ee861bb5e9
1 changed files with 7 additions and 3 deletions
|
@ -57,9 +57,13 @@ export async function actualMassBanCmd(
|
||||||
const waitTimeStart = performance.now();
|
const waitTimeStart = performance.now();
|
||||||
const waitingInterval = setInterval(() => {
|
const waitingInterval = setInterval(() => {
|
||||||
const waitTime = humanizeDurationShort(performance.now() - waitTimeStart, { round: true });
|
const waitTime = humanizeDurationShort(performance.now() - waitTimeStart, { round: true });
|
||||||
loadingMsg
|
const waitMessageContent = `Massban queued. Still waiting for previous massban to finish (waited ${waitTime}).`;
|
||||||
.edit(`Massban queued. Still waiting for previous massban to finish (waited ${waitTime}).`)
|
|
||||||
.catch(() => clearInterval(waitingInterval));
|
if (isContextInteraction(context)) {
|
||||||
|
context.editReply(waitMessageContent).catch(() => clearInterval(waitingInterval));
|
||||||
|
} else {
|
||||||
|
loadingMsg.edit(waitMessageContent).catch(() => clearInterval(waitingInterval));
|
||||||
|
}
|
||||||
}, 1 * MINUTES);
|
}, 1 * MINUTES);
|
||||||
|
|
||||||
pluginData.state.massbanQueue.add(async () => {
|
pluginData.state.massbanQueue.add(async () => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue