Add new features for giveaways, tickets, self-roles, tags, starboard, suggestions, and birthdays

- Integrated new command modules for managing giveaways, tickets, self-roles, tags, starboard, suggestions, and birthdays, enhancing the bot's capabilities.
- Implemented job handling for giveaway endings, ticket management, and birthday role expirations, improving automation and user experience.
- Updated command definitions and interaction handling to support new features, ensuring smooth user interactions.
- Enhanced the job processing system with dedicated workers for managing various tasks, including auto-closing tickets and running birthday checks.
- Documented the new features and their setup processes in PHASE-TRACKING.md for clarity on implementation steps.
This commit is contained in:
smueller
2026-07-22 13:21:28 +02:00
parent 1ceb8c3574
commit 52b10c9536
11 changed files with 271 additions and 90 deletions

View File

@@ -0,0 +1,20 @@
import { describe, expect, it } from 'vitest';
import { applyTagPlaceholders, escapeHtml, pickRandomWinners } from './phase4.js';
describe('phase4 helpers', () => {
it('picks unique random winners', () => {
const winners = pickRandomWinners([1, 2, 3, 4, 5], 3);
expect(winners).toHaveLength(3);
expect(new Set(winners).size).toBe(3);
});
it('applies tag placeholders', () => {
expect(applyTagPlaceholders('Hi {user} on {server}', { user: '<@1>', server: 'Nexumi' })).toBe(
'Hi <@1> on Nexumi'
);
});
it('escapes html', () => {
expect(escapeHtml('<b>&"')).toBe('&lt;b&gt;&amp;&quot;');
});
});