Add anti-raid levels to automod. Large refactor of spam detection. Add member_join and member_join_spam triggers.

Anti-raid levels don't by themselves do anything, but they can be
used in overrides to activate specific automod items.

Spam detection should now be more reliable and also combine further
spam messages after the initial detection into the archive.

Messages deleted by automod no longer create the normal deletion log
entry. Instead, the AUTOMOD_ACTION log entry contains the deleted
message or an archive if there are multiple (i.e. spam).
This commit is contained in:
Dragory 2020-01-26 19:54:32 +02:00
parent dc27821a63
commit 84135b201b
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
14 changed files with 1179 additions and 550 deletions

View file

@ -0,0 +1,28 @@
import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CreateAntiraidLevelsTable1580038836906 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.createTable(
new Table({
name: "antiraid_levels",
columns: [
{
name: "guild_id",
type: "bigint",
unsigned: true,
isPrimary: true,
},
{
name: "level",
type: "varchar",
length: "64",
},
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropTable("antiraid_levels");
}
}