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:
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({
|
await this.counterValues.delete({
|
||||||
counter_id: counterId,
|
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 { changeCounterValue } from "../functions/changeCounterValue";
|
||||||
import { setCounterValue } from "../functions/setCounterValue";
|
import { setCounterValue } from "../functions/setCounterValue";
|
||||||
import { resetAllCounterValues } from "../functions/resetAllCounterValues";
|
import { resetAllCounterValues } from "../functions/resetAllCounterValues";
|
||||||
|
import { counterIdLock } from "../../../utils/lockNameHelpers";
|
||||||
|
|
||||||
export const ResetAllCounterValuesCmd = guildCommand<CountersPluginType>()({
|
export const ResetAllCounterValuesCmd = guildCommand<CountersPluginType>()({
|
||||||
trigger: ["counters reset_all"],
|
trigger: ["counters reset_all"],
|
||||||
|
@ -47,7 +48,9 @@ export const ResetAllCounterValuesCmd = guildCommand<CountersPluginType>()({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const lock = await pluginData.locks.acquire(counterIdLock(counterId));
|
||||||
await resetAllCounterValues(pluginData, args.counterName);
|
await resetAllCounterValues(pluginData, args.counterName);
|
||||||
|
lock.unlock();
|
||||||
|
|
||||||
sendSuccessMessage(pluginData, message.channel, `All counter values for **${counterName}** have been reset`);
|
sendSuccessMessage(pluginData, message.channel, `All counter values for **${counterName}** have been reset`);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue