mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
Improve spam detection in laggy circumstances
This commit is contained in:
parent
86f7d268db
commit
c9db802638
4 changed files with 138 additions and 107 deletions
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"MEMBER_WARN": "⚠️ **{member.user.username}#{member.user.discriminator}** (`{member.id}`) was warned by {mod.username}#{mod.discriminator}",
|
||||
"MEMBER_MUTE": "🔇 **{member.user.username}#{member.user.discriminator}** (`{member.id}`) was muted by {mod.username}#{mod.discriminator}",
|
||||
"MEMBER_MUTE_SPAM": "🔇 **{member.user.username}#{member.user.discriminator}** (`{member.id}`) was muted for spam in **#{channel.name}**: {description} (more than {limit} in {interval}s)",
|
||||
"MEMBER_UNMUTE": "🔉 **{member.user.username}#{member.user.discriminator}** (`{member.id}`) was unmuted by {mod.username}#{mod.discriminator}",
|
||||
"MEMBER_MUTE_EXPIRED": "🔉 **{member.user.username}#{member.user.discriminator}**'s mute expired",
|
||||
"MEMBER_KICK": "👢 **{user.username}#{user.discriminator}** (`{user.id}`) was kicked by {mod.username}#{mod.discriminator}",
|
||||
|
@ -36,7 +35,7 @@
|
|||
|
||||
"COMMAND": "🤖 **{member.user.username}#{member.user.discriminator}** (`{member.id}`) used command in **#{channel.name}**:\n`{command}`",
|
||||
|
||||
"SPAM_DELETE": "🛑 **{member.user.username}#{member.user.discriminator}** (`{member.id}`) spam deleted in **#{channel.name}**: {description} (more than {limit} in {interval}s)\n{logUrl}",
|
||||
"SPAM_DETECTED": "🛑 **{member.user.username}#{member.user.discriminator}** (`{member.id}`) spam detected in **#{channel.name}**: {description} (more than {limit} in {interval}s)\n{logUrl}",
|
||||
"CENSOR": "🛑 **{member.user.username}#{member.user.discriminator}** (`{member.id}`) censored message in **#{channel.name}** (`{channel.id}`) {reason}:\n```{messageText}```",
|
||||
"CLEAN": "🚿 **{mod.username}#{mod.discriminator}** (`{mod.id}`) cleaned **{count}** message(s) in **#{channel.name}**",
|
||||
|
||||
|
|
|
@ -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))` : ""
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
export enum LogType {
|
||||
MEMBER_WARN = 1,
|
||||
MEMBER_MUTE,
|
||||
MEMBER_MUTE_SPAM,
|
||||
MEMBER_UNMUTE,
|
||||
MEMBER_MUTE_EXPIRED,
|
||||
MEMBER_KICK,
|
||||
|
@ -34,7 +33,7 @@ export enum LogType {
|
|||
|
||||
COMMAND,
|
||||
|
||||
SPAM_DELETE,
|
||||
SPAM_DETECTED,
|
||||
CENSOR,
|
||||
CLEAN,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue