13 Commits
Author SHA1 Message Date
nxbat eb1b94c235 Conflicts. 2026-10-20 16:50:21 +00:00
nxbat 9755666040 (github): Fix merge conflicts.
This is the most painful part of this whole thing. I hate merge conflicts. Merge conflicts suck and I wish they didn't exist.
2026-10-21 00:14:03 +08:00
nxbat e5910899ca (conflicts): Fix private-help-utils. 2026-10-20 16:08:06 +00:00
nxbat f17a3b5521 (modals): Hook up modals. Pre-testing. 2026-10-14 18:18:06 +08:00
nxbat 63152ffaf5 (modals): Implement sync-name-modal modal. 2026-10-14 18:10:56 +08:00
nxbat 99fd6403a2 (modals): Implement report-message modal. 2026-10-14 18:02:43 +08:00
nxbat c2c6d5f9f0 (modals): Fix nix skill issue. 2026-10-14 17:24:50 +08:00
nxbat a996947157 (modals): Implement open-ticket-modal modal. 2026-10-14 16:19:27 +08:00
nxbat 741b56a3dd (modals): Implement open-mod-ticket modal. 2026-10-14 16:00:46 +08:00
nxbat 96c783fb96 (modals): Implement edit-knowledgebase-item-modal modal. 2026-10-14 13:45:52 +08:00
nxbat 0fbb8918dc (modals): Implement add-note-modal modal. 2026-10-14 13:36:55 +08:00
nxbat 920fc347fb (modals): Implement add-knowledgebase-item-modal modal. 2026-10-14 13:36:48 +08:00
nxbat 9d31d5a3e0 (modals): Add Modal<Context> interface. 2026-10-14 13:28:21 +08:00
3 changed files with 20 additions and 14 deletions
+6 -3
View File
@@ -1,5 +1,4 @@
import { ButtonInteraction, Client, MessageFlags, ChannelType, PermissionFlagsBits } from 'discord.js';
import { closeTicket } from '../utils';
export default {
name: 'close-mod-ticket',
@@ -20,9 +19,13 @@ export default {
components: []
});
if (!await closeTicket(client, channel, 'This ticket has been closed by staff.'))
return await interaction.editReply({ content: 'An error occurred while trying to close this ticket.' });
await channel.send('This ticket has been closed by staff.');
await interaction.editReply({ content: 'Ticket closed.' });
channel.edit({
archived: true,
locked: true
});
}
};
+12 -10
View File
@@ -1,26 +1,28 @@
import { ButtonInteraction, Client, MessageFlags, ChannelType } from 'discord.js';
import { closeTicket } from '../utils';
import { Database } from '../shared/Database';
export default {
name: 'close-ticket',
handler: async function (client: Client, interaction: ButtonInteraction) {
const channel = await interaction.channel?.fetch();
if (!channel || !channel.isThread() || !channel.isSendable() || channel.type != ChannelType.PrivateThread)
return await interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'Oops. Something went wrong. Please report this to a staff member.' });
await interaction.reply({
content: 'Closing, please wait...',
flags: MessageFlags.Ephemeral
});
if (!channel || !channel.isThread() || !channel.isSendable() || channel.type != ChannelType.PrivateThread)
return interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'Oops. Something went wrong. Please report this to a staff member.' });
await interaction.message.edit({
content: interaction.message.content,
components: []
});
if (!await closeTicket(client, channel, `This ticket has been closed by ${interaction.user}`))
return await interaction.editReply({ content: 'An error occurred while trying to close this ticket.' });
await Database.closePrivateHelpTicket(channel.id);
await interaction.editReply({ content: 'Ticket closed.' });
await channel.send(`This ticket has been closed by ${interaction.user}`);
await interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'Ticket closed.' });
channel.edit({
archived: true,
locked: true
});
}
};
+2 -1
View File
@@ -121,8 +121,9 @@ export async function openModTicketModal(interaction: UserContextMenuCommandInte
const titleLabel = createTextInput('title', 'Title', `The name of the thread. Defaults to "Mod Ticket For ${member.displayName}" if left empty`, false, TextInputStyle.Short, 100, null);
const initialMessageLabel = createTextInput('initial-message', 'Inital Message', 'The inital message sent in the thread', false, TextInputStyle.Paragraph, 1800, null);
const autoJoinLabel = createCheckbox('auto-join-thread', 'Auto Join Thread', 'Whether or not to automatically add you to the thread.', true);
const autoJoinLabel = createCheckbox('auto-join-thread', 'Auto Join Thread', 'Whether or not to join you to the thread. Selecting no will not notify you of messages sent!', true);
modal.addLabelComponents(titleLabel, initialMessageLabel, autoJoinLabel);
interaction.showModal(modal);
}