3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-11 04:57:19 +00:00

Improve spam detection in laggy circumstances

This commit is contained in:
Dragory 2018-08-18 19:21:39 +03:00
parent b2b9e93f8f
commit ff99c1a84e
4 changed files with 138 additions and 107 deletions

View file

@ -25,6 +25,10 @@ export class GuildSpamLogs {
this.guildId = guildId;
}
generateNewLogId() {
return uuid();
}
async find(id: string): Promise<SpamLog> {
const result = await knex("spam_logs")
.where("id", id)
@ -42,9 +46,7 @@ export class GuildSpamLogs {
user: stripObjectToScalars(msg.author),
message: stripObjectToScalars(msg),
timestamp: moment(msg.timestamp).format("YYYY-MM-DD HH:mm:ss zz"),
attachments: msg.attachments.length
? ` (message contained ${msg.attachments.length} attachment(s))`
: ""
attachments: msg.attachments.length ? ` (message contained ${msg.attachments.length} attachment(s))` : ""
});
});