Tweak counter reset logic

This commit is contained in:
Dragory 2021-05-03 20:42:43 +03:00
parent 647c2eb85a
commit 7fc86d34e9
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -529,12 +529,9 @@ export class GuildCounters extends BaseGuildRepository {
}
async resetAllCounterValues(counterId: number): Promise<void> {
await this.counterValues.delete({
counter_id: counterId,
});
await this.counterTriggers.delete({
counter_id: counterId,
// Foreign keys will remove any related triggers and counter values
await this.counters.delete({
id: counterId,
});
}
}