Enhance tag management with cooldown feature and related updates
- Added a `cooldownSeconds` field to the `Tag` model, allowing for customizable cooldown periods between tag responses. - Updated tag command handling to incorporate cooldown logic, preventing spam and improving user experience. - Enhanced the WebUI to support cooldown configuration for tags, including input validation and localization for cooldown messages. - Refactored tag-related service functions to manage cooldowns effectively, ensuring accurate tracking and enforcement. - Improved localization for new cooldown-related messages in both English and German.
This commit is contained in:
@@ -584,21 +584,22 @@ model SelfRolePanel {
|
||||
}
|
||||
|
||||
model Tag {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
name String
|
||||
content String?
|
||||
embed Json?
|
||||
components Json?
|
||||
responseType String @default("TEXT")
|
||||
triggerWord String?
|
||||
allowedRoleIds String[] @default([])
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
name String
|
||||
content String?
|
||||
embed Json?
|
||||
components Json?
|
||||
responseType String @default("TEXT")
|
||||
triggerWord String?
|
||||
cooldownSeconds Int @default(15)
|
||||
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)
|
||||
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])
|
||||
|
||||
Reference in New Issue
Block a user