Add giveaway, ticket, self-role, starboard, and suggestion features to the bot
- Introduced new models in the Prisma schema for giveaways, tickets, self-role panels, starboard configurations, and suggestions, enhancing the bot's functionality. - Implemented job handling for self-role expiration and ticket management, improving user experience. - Updated command localization to support new features in both German and English. - Enhanced the job processing system to include dedicated workers for managing tickets and self-role expirations. - Documented the new features and their setup processes in PHASE-TRACKING.md for clarity on implementation steps.
This commit is contained in:
@@ -30,6 +30,20 @@ model Guild {
|
||||
polls Poll[]
|
||||
reminders Reminder[]
|
||||
afkStatuses AfkStatus[]
|
||||
giveaways Giveaway[]
|
||||
ticketConfig TicketConfig?
|
||||
ticketCategories TicketCategory[]
|
||||
tickets Ticket[]
|
||||
selfRolePanels SelfRolePanel[]
|
||||
tags Tag[]
|
||||
starboardConfig StarboardConfig?
|
||||
starboardEntries StarboardEntry[]
|
||||
suggestionConfig SuggestionConfig?
|
||||
suggestions Suggestion[]
|
||||
birthdays Birthday[]
|
||||
birthdayConfig BirthdayConfig?
|
||||
tempVoiceConfig TempVoiceConfig?
|
||||
tempVoiceChannels TempVoiceChannel[]
|
||||
}
|
||||
|
||||
model GuildSettings {
|
||||
@@ -389,3 +403,239 @@ model AfkStatus {
|
||||
|
||||
@@unique([guildId, userId])
|
||||
}
|
||||
|
||||
model Giveaway {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
channelId String
|
||||
messageId String?
|
||||
prize String
|
||||
winnerCount Int @default(1)
|
||||
endsAt DateTime
|
||||
requiredRoleId String?
|
||||
requiredLevel Int?
|
||||
requiredMemberDays Int?
|
||||
paused Boolean @default(false)
|
||||
endedAt DateTime?
|
||||
winners String[] @default([])
|
||||
entrants String[] @default([])
|
||||
hostId String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([guildId, endsAt])
|
||||
}
|
||||
|
||||
model TicketConfig {
|
||||
id String @id @default(cuid())
|
||||
guildId String @unique
|
||||
enabled Boolean @default(true)
|
||||
mode String @default("CHANNEL")
|
||||
categoryId String?
|
||||
logChannelId String?
|
||||
transcriptDm Boolean @default(false)
|
||||
inactivityHours Int @default(72)
|
||||
ratingEnabled Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model TicketCategory {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
name String
|
||||
description String?
|
||||
emoji String?
|
||||
supportRoleIds String[] @default([])
|
||||
formFields Json?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
tickets Ticket[]
|
||||
|
||||
@@unique([guildId, name])
|
||||
@@index([guildId])
|
||||
}
|
||||
|
||||
model Ticket {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
categoryId String?
|
||||
openerId String
|
||||
claimedById String?
|
||||
channelId String?
|
||||
threadId String?
|
||||
status String @default("OPEN")
|
||||
priority String @default("NORMAL")
|
||||
subject String?
|
||||
formAnswers Json?
|
||||
transcriptHtml String?
|
||||
rating Int?
|
||||
closedAt DateTime?
|
||||
lastActivityAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
category TicketCategory? @relation(fields: [categoryId], references: [id], onDelete: SetNull)
|
||||
|
||||
@@index([guildId, status])
|
||||
@@index([channelId])
|
||||
}
|
||||
|
||||
model SelfRolePanel {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
channelId String
|
||||
messageId String?
|
||||
title String
|
||||
description String?
|
||||
mode String @default("BUTTONS")
|
||||
behavior String @default("NORMAL")
|
||||
roles Json
|
||||
expiresAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([guildId])
|
||||
}
|
||||
|
||||
model Tag {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
name String
|
||||
content String?
|
||||
embed Json?
|
||||
responseType String @default("TEXT")
|
||||
triggerWord String?
|
||||
allowedRoleIds String[] @default([])
|
||||
allowedChannelIds String[] @default([])
|
||||
createdById String
|
||||
useCount Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([guildId, name])
|
||||
@@index([guildId])
|
||||
}
|
||||
|
||||
model StarboardConfig {
|
||||
id String @id @default(cuid())
|
||||
guildId String @unique
|
||||
enabled Boolean @default(false)
|
||||
channelId String?
|
||||
emoji String @default("⭐")
|
||||
threshold Int @default(3)
|
||||
allowSelfStar Boolean @default(false)
|
||||
ignoredChannelIds String[] @default([])
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model StarboardEntry {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
sourceChannelId String
|
||||
sourceMessageId String
|
||||
starboardMessageId String
|
||||
starCount Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([guildId, sourceMessageId])
|
||||
@@index([guildId])
|
||||
}
|
||||
|
||||
model SuggestionConfig {
|
||||
id String @id @default(cuid())
|
||||
guildId String @unique
|
||||
enabled Boolean @default(true)
|
||||
openChannelId String?
|
||||
approvedChannelId String?
|
||||
deniedChannelId String?
|
||||
createThread Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model Suggestion {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
authorId String
|
||||
content String
|
||||
status String @default("OPEN")
|
||||
messageId String?
|
||||
channelId String?
|
||||
threadId String?
|
||||
upvotes Int @default(0)
|
||||
downvotes Int @default(0)
|
||||
voterUpIds String[] @default([])
|
||||
voterDownIds String[] @default([])
|
||||
staffReason String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([guildId, status])
|
||||
}
|
||||
|
||||
model BirthdayConfig {
|
||||
id String @id @default(cuid())
|
||||
guildId String @unique
|
||||
enabled Boolean @default(true)
|
||||
channelId String?
|
||||
roleId String?
|
||||
message String?
|
||||
timezone String @default("Europe/Berlin")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model Birthday {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
userId String
|
||||
month Int
|
||||
day Int
|
||||
year Int?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([guildId, userId])
|
||||
@@index([guildId, month, day])
|
||||
}
|
||||
|
||||
model TempVoiceConfig {
|
||||
id String @id @default(cuid())
|
||||
guildId String @unique
|
||||
enabled Boolean @default(false)
|
||||
hubChannelId String?
|
||||
categoryId String?
|
||||
defaultName String @default("{user}'s Channel")
|
||||
defaultLimit Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model TempVoiceChannel {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
channelId String @unique
|
||||
ownerId String
|
||||
controlMessageId String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([guildId, ownerId])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user