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:
@@ -333,7 +333,7 @@ async function fetchTicketMessages(
|
||||
}
|
||||
}
|
||||
|
||||
function buildRatingComponents(ticketId: string, locale: 'de' | 'en'): ActionRowBuilder<ButtonBuilder> {
|
||||
function buildRatingComponents(ticketId: string): ActionRowBuilder<ButtonBuilder> {
|
||||
const row = new ActionRowBuilder<ButtonBuilder>();
|
||||
for (let rating = 1; rating <= 5; rating += 1) {
|
||||
row.addComponents(
|
||||
@@ -704,7 +704,7 @@ export async function closeTicket(
|
||||
try {
|
||||
await opener.send({
|
||||
content: t(locale, 'ticket.ratePrompt'),
|
||||
components: [buildRatingComponents(ticket.id, locale)]
|
||||
components: [buildRatingComponents(ticket.id)]
|
||||
});
|
||||
} catch {
|
||||
// User may have DMs disabled
|
||||
@@ -729,8 +729,7 @@ export async function rateTicket(
|
||||
context: BotContext,
|
||||
ticketId: string,
|
||||
userId: string,
|
||||
rating: number,
|
||||
locale: 'de' | 'en'
|
||||
rating: number
|
||||
): Promise<void> {
|
||||
const ticket = await context.prisma.ticket.findUnique({ where: { id: ticketId } });
|
||||
if (!ticket || ticket.openerId !== userId) {
|
||||
|
||||
Reference in New Issue
Block a user