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

Fix !counters reset_all not also removing triggers

This commit is contained in:
Dragory 2021-05-03 20:41:39 +03:00
parent ddaf3c98ee
commit 647c2eb85a
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 7 additions and 0 deletions

View file

@ -532,5 +532,9 @@ export class GuildCounters extends BaseGuildRepository {
await this.counterValues.delete({
counter_id: counterId,
});
await this.counterTriggers.delete({
counter_id: counterId,
});
}
}

View file

@ -8,6 +8,7 @@ import { confirm, resolveUser, trimMultilineString, UnknownUser } from "../../..
import { changeCounterValue } from "../functions/changeCounterValue";
import { setCounterValue } from "../functions/setCounterValue";
import { resetAllCounterValues } from "../functions/resetAllCounterValues";
import { counterIdLock } from "../../../utils/lockNameHelpers";
export const ResetAllCounterValuesCmd = guildCommand<CountersPluginType>()({
trigger: ["counters reset_all"],
@ -47,7 +48,9 @@ export const ResetAllCounterValuesCmd = guildCommand<CountersPluginType>()({
return;
}
const lock = await pluginData.locks.acquire(counterIdLock(counterId));
await resetAllCounterValues(pluginData, args.counterName);
lock.unlock();
sendSuccessMessage(pluginData, message.channel, `All counter values for **${counterName}** have been reset`);
},