- Implemented AutoMod capabilities including spam filtering, anti-raid, and anti-nuke actions. - Added Logging module to track moderation actions and events across the bot. - Introduced Welcome module for customizable welcome messages and autoroles. - Developed Verification system with captcha and role assignment features. - Updated Prisma schema to include new models for AutoMod, Logging, Welcome, and Verification. - Enhanced command localization for new features in both German and English. - Improved health server to handle captcha verification requests. - Added new environment variable for public base URL to support captcha links.
206 lines
6.2 KiB
Plaintext
206 lines
6.2 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Guild {
|
|
id String @id
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
settings GuildSettings?
|
|
cases Case[]
|
|
escalationRules EscalationRule[]
|
|
autoModConfig AutoModConfig?
|
|
autoModRules AutoModRule[]
|
|
loggingConfig LoggingConfig?
|
|
logChannels LogChannel[]
|
|
welcomeConfig WelcomeConfig?
|
|
verificationConfig VerificationConfig?
|
|
}
|
|
|
|
model GuildSettings {
|
|
id String @id @default(cuid())
|
|
guildId String @unique
|
|
locale String @default("de")
|
|
moderationEnabled Boolean @default(true)
|
|
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model User {
|
|
id String @id
|
|
createdAt DateTime @default(now())
|
|
warnings Warning[]
|
|
notes ModNote[]
|
|
}
|
|
|
|
model Case {
|
|
id String @id @default(cuid())
|
|
caseNumber Int
|
|
guildId String
|
|
targetUserId String
|
|
moderatorId String
|
|
action String
|
|
reason String?
|
|
metadata Json?
|
|
deletedAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
|
warnings Warning[]
|
|
moderationNote ModNote[]
|
|
|
|
@@unique([guildId, caseNumber])
|
|
@@index([guildId, targetUserId])
|
|
}
|
|
|
|
model Warning {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
userId String
|
|
moderatorId String
|
|
reason String?
|
|
caseId String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
case Case? @relation(fields: [caseId], references: [id], onDelete: SetNull)
|
|
|
|
@@index([guildId, userId])
|
|
}
|
|
|
|
model ModNote {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
userId String
|
|
moderatorId String
|
|
note String
|
|
caseId String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
case Case? @relation(fields: [caseId], references: [id], onDelete: SetNull)
|
|
|
|
@@index([guildId, userId])
|
|
}
|
|
|
|
model EscalationRule {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
warnCount Int
|
|
action String
|
|
durationMs Int?
|
|
reason String?
|
|
enabled Boolean @default(true)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([guildId, warnCount])
|
|
@@index([guildId, enabled])
|
|
}
|
|
|
|
model AutoModConfig {
|
|
id String @id @default(cuid())
|
|
guildId String @unique
|
|
enabled Boolean @default(true)
|
|
antiRaidEnabled Boolean @default(false)
|
|
antiRaidJoinThreshold Int @default(10)
|
|
antiRaidWindowSeconds Int @default(10)
|
|
antiRaidAction String @default("LOCKDOWN")
|
|
antiNukeEnabled Boolean @default(false)
|
|
antiNukeBanThreshold Int @default(5)
|
|
antiNukeChannelThreshold Int @default(3)
|
|
antiNukeWindowSeconds Int @default(60)
|
|
lockdownActive Boolean @default(false)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model AutoModRule {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
ruleType String
|
|
enabled Boolean @default(true)
|
|
action String @default("DELETE")
|
|
threshold Json?
|
|
exceptions Json?
|
|
wordList Json?
|
|
durationMs Int?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([guildId, ruleType])
|
|
@@index([guildId, enabled])
|
|
}
|
|
|
|
model LoggingConfig {
|
|
id String @id @default(cuid())
|
|
guildId String @unique
|
|
enabled Boolean @default(true)
|
|
ignoreBots Boolean @default(true)
|
|
ignoredChannelIds String[] @default([])
|
|
ignoredRoleIds String[] @default([])
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model LogChannel {
|
|
id String @id @default(cuid())
|
|
guildId String
|
|
eventType String
|
|
channelId String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([guildId, eventType])
|
|
@@index([guildId])
|
|
}
|
|
|
|
model WelcomeConfig {
|
|
id String @id @default(cuid())
|
|
guildId String @unique
|
|
welcomeEnabled Boolean @default(false)
|
|
leaveEnabled Boolean @default(false)
|
|
welcomeChannelId String?
|
|
leaveChannelId String?
|
|
welcomeType String @default("TEXT")
|
|
welcomeContent String?
|
|
welcomeEmbed Json?
|
|
leaveContent String?
|
|
leaveEmbed Json?
|
|
welcomeDmEnabled Boolean @default(false)
|
|
welcomeDmContent String?
|
|
userAutoroleIds String[] @default([])
|
|
botAutoroleIds String[] @default([])
|
|
imageTitle String?
|
|
imageSubtitle String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model VerificationConfig {
|
|
id String @id @default(cuid())
|
|
guildId String @unique
|
|
enabled Boolean @default(false)
|
|
channelId String?
|
|
verifiedRoleId String?
|
|
unverifiedRoleId String?
|
|
mode String @default("BUTTON")
|
|
minAccountAgeDays Int @default(0)
|
|
failAction String @default("KICK")
|
|
panelChannelId String?
|
|
panelMessageId String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
|
}
|