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:
@@ -157,6 +157,19 @@ describe('dashboard schemas', () => {
|
||||
allowedChannelIds: []
|
||||
});
|
||||
expect(parsed.name).toBe('rules');
|
||||
expect(parsed.cooldownSeconds).toBe(15);
|
||||
});
|
||||
|
||||
it('accepts custom tag cooldown', () => {
|
||||
const parsed = TagDashboardCreateSchema.parse({
|
||||
name: 'rules',
|
||||
content: 'Please read the rules',
|
||||
responseType: 'TEXT',
|
||||
cooldownSeconds: 30,
|
||||
allowedRoleIds: [],
|
||||
allowedChannelIds: []
|
||||
});
|
||||
expect(parsed.cooldownSeconds).toBe(30);
|
||||
});
|
||||
|
||||
it('validates starboard patches', () => {
|
||||
|
||||
Reference in New Issue
Block a user