all repos — stealth-developers @ 34fff8fca6a601fab0b1f9be079c90524eefcd67

feat(tickets): limit thanking
vi v@vt3e.cat
Tue, 07 Apr 2026 21:59:14 +0100
commit

34fff8fca6a601fab0b1f9be079c90524eefcd67

parent

2561d06f290357dfe09b9b0958e2aeb881ecbafa

2 files changed, 16 insertions(+), 0 deletions(-)

jump to
M src/database/schema/tickets.tssrc/database/schema/tickets.ts

@@ -29,6 +29,9 @@

closeReason: text("close_reason"), privateReason: text("private_reason"), + thankedAt: integer("thanked_at", { + mode: "timestamp", + }).$type<Date | null>(), warnedAt: integer("warned_at", { mode: "timestamp" }).$type<Date | null>(), }, (t) => [
M src/interactions/commands/tickets/actions.tssrc/interactions/commands/tickets/actions.ts

@@ -394,6 +394,12 @@ "⚠️ Ticket or guild data not found, cannot send thank you message.",

); } + if (ticket.thankedAt) { + return interaction.editReply( + "⚠️ You have already thanked the moderator for this ticket.", + ); + } + const { data: guild, exists: guildExists } = await getGuild(ticket.guildId); if (!guildExists || !guild || !guild.ticket_channel_id) { logger.error(`Ticket ${ticket.id} missing guild/channel data`);

@@ -416,6 +422,13 @@

await channel.send( `The reporter says thank you for handling ticket #${ticket.ticketNumber}! 💖`, ); + + const thankedAt = new Date(); + await db + .update(tickets) + .set({ thankedAt }) + .where(eq(tickets.id, ticket.id)); + return interaction.editReply("A thank you message sent to the moderators!"); } catch (error) { logger.error(