3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

fix(ModActions): don't create duplicate logs/cases for massbans; add more code comments

This commit is contained in:
Dragory 2018-08-18 13:34:57 +03:00
parent aac3ac7dd8
commit 86f7d268db
2 changed files with 46 additions and 105 deletions

View file

@ -36,13 +36,13 @@ export class GuildLogs extends EventEmitter {
this.emit("log", { type, data });
}
ignoreLog(type: LogType, ignoreId: any, expiryTime: number = null) {
ignoreLog(type: LogType, ignoreId: any, timeout: number = null) {
this.ignoredLogs.push({ type, ignoreId });
// Clear after expiry (15sec by default)
setTimeout(() => {
this.clearIgnoredLog(type, ignoreId);
}, expiryTime || 1000 * 15);
}, timeout || 1000 * 15);
}
isLogIgnored(type: LogType, ignoreId: any) {
@ -50,9 +50,6 @@ export class GuildLogs extends EventEmitter {
}
clearIgnoredLog(type: LogType, ignoreId: any) {
this.ignoredLogs.splice(
this.ignoredLogs.findIndex(info => type === info.type && ignoreId === info.ignoreId),
1
);
this.ignoredLogs.splice(this.ignoredLogs.findIndex(info => type === info.type && ignoreId === info.ignoreId), 1);
}
}