Skip to content

Commit

Permalink
fix(moderation): purge warnings by correct timestamp (#4161)
Browse files Browse the repository at this point in the history
Fixes #4159
  • Loading branch information
sogehige committed Sep 28, 2020
1 parent 7aee9f6 commit 96f0f15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bot/systems/moderation.ts
Expand Up @@ -121,7 +121,7 @@ class Moderation extends System {
async timeoutUser (sender: CommandOptions['sender'], text: string, warning: string, msg: string, time: number, type: string) {
// cleanup warnings
await getRepository(ModerationWarning).delete({
timestamp: LessThan(1000 * 60 * 60),
timestamp: LessThan(Date.now() - 1000 * 60 * 60),
});
const warnings = await getRepository(ModerationWarning).find({ userId: Number(sender.userId) });
const silent = await this.isSilent(type);
Expand Down

0 comments on commit 96f0f15

Please sign in to comment.