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
-1
View File
@@ -1,5 +1,4 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChannelType, Client, GuildTextBasedChannel, MessageFlags, ModalSubmitInteraction, TextChannel, ThreadAutoArchiveDuration } from 'discord.js';
import { ticketCooldownMap } from '../shared/ticket-cooldown';
import { Database } from '../shared/Database';
import { logCustomEvent } from '../utils';
+6 -3
View File
@@ -1,5 +1,4 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChannelType, Client, GuildTextBasedChannel, MessageFlags, ModalSubmitInteraction, TextChannel, ThreadAutoArchiveDuration } from 'discord.js';
import { ticketCooldownMap } from '../shared/ticket-cooldown';
import { Database } from '../shared/Database';
export default {
@@ -13,8 +12,6 @@ export default {
if (!guildSettings || !guildSettings.private_help_role_id)
return interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'Failed to create ticket. Please report this to a staff member.' });
ticketCooldownMap.set(interaction.user.id, Date.now() + 8.64e+7);
const reason = interaction.fields.getTextInputValue('ticket-message');
const channel = (await interaction.channel?.fetch()) as TextChannel;
@@ -26,6 +23,12 @@ export default {
type: ChannelType.PrivateThread
});
console.log(1);
await Database.createPrivateHelpTicket(interaction.user.id, thread.id);
console.log(2);
const closeButton = new ButtonBuilder()
.setCustomId('close-ticket')
.setLabel('Click here if you no longer need help')
-1
View File
@@ -1,5 +1,4 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChannelType, Client, GuildTextBasedChannel, MessageFlags, ModalSubmitInteraction, TextChannel, ThreadAutoArchiveDuration } from 'discord.js';
import { ticketCooldownMap } from '../shared/ticket-cooldown';
import { Database } from '../shared/Database';
import { deferInteraction, logCustomEvent, syncName } from '../utils';
import { config } from '../config';