Change private help ticket cooldown

This commit is contained in:
Tarrgon
2025-09-14 08:00:51 -04:00
parent 0175eb8d96
commit 672a508d9d
14 changed files with 70 additions and 38 deletions
+3 -5
View File
@@ -1,13 +1,11 @@
import { ActionRowBuilder, ButtonInteraction, Client, ModalBuilder, TextInputBuilder, TextInputStyle, MessageFlags } from 'discord.js';
import { ticketCooldownMap } from '../shared/ticket-cooldown';
import { canOpenPrivateHelpTicket } from '../utils';
export default {
name: 'private-help',
handler: async function (client: Client, interaction: ButtonInteraction) {
const allowedAt = ticketCooldownMap.get(interaction.user.id);
if (allowedAt && Date.now() < allowedAt)
return interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'You can only create one ticket per day.' });
if (!(await canOpenPrivateHelpTicket(interaction.user.id)))
return interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'You can only have one open ticket at a time that is less than a day old.' });
const modal = new ModalBuilder()
.setCustomId('open-ticket-modal')