Add backup functionality with escalation rules for moderation commands
- Updated .env.example to include backup configuration options. - Modified docker-compose.yml to mount backup volume. - Enhanced Dockerfile to install PostgreSQL client. - Added EscalationRule model to Prisma schema for managing warning escalation. - Updated environment validation in env.ts to include backup settings. - Refactored job handling in jobs.ts to implement backup jobs and cleanup. - Introduced escalation commands in moderation service for managing user warnings. - Updated moderation commands to apply escalation rules based on warning count.
This commit is contained in:
@@ -13,6 +13,7 @@ model Guild {
|
||||
updatedAt DateTime @updatedAt
|
||||
settings GuildSettings?
|
||||
cases Case[]
|
||||
escalationRules EscalationRule[]
|
||||
}
|
||||
|
||||
model GuildSettings {
|
||||
@@ -79,3 +80,19 @@ model ModNote {
|
||||
|
||||
@@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])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user