Fix !counters reset_all not also removing triggers
This commit is contained in:
parent
ddaf3c98ee
commit
647c2eb85a
2 changed files with 7 additions and 0 deletions
|
@ -532,5 +532,9 @@ export class GuildCounters extends BaseGuildRepository {
|
|||
await this.counterValues.delete({
|
||||
counter_id: counterId,
|
||||
});
|
||||
|
||||
await this.counterTriggers.delete({
|
||||
counter_id: counterId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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`);
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue