Update modals

This commit is contained in:
Tarrgon
2026-05-19 12:14:19 -04:00
parent 7e5ec68f7e
commit 13251468b1
7 changed files with 68 additions and 96 deletions
+4 -9
View File
@@ -1,4 +1,5 @@
import { ActionRowBuilder, ApplicationCommandType, ApplicationIntegrationType, Client, ContextMenuCommandBuilder, InteractionContextType, ModalBuilder, PermissionFlagsBits, TextInputBuilder, TextInputStyle, UserContextMenuCommandInteraction } from 'discord.js';
import { ApplicationCommandType, ApplicationIntegrationType, Client, ContextMenuCommandBuilder, InteractionContextType, ModalBuilder, PermissionFlagsBits, TextInputStyle, UserContextMenuCommandInteraction } from 'discord.js';
import { createTextInput } from '../utils';
export default {
name: 'Add Note',
@@ -17,15 +18,9 @@ export default {
.setCustomId(`add-note-modal_${idToUse}`)
.setTitle(`Adding note to ${member ? member.displayName : idToUse}`);
const input = new TextInputBuilder()
.setCustomId('note-message')
.setLabel('Note message')
.setStyle(TextInputStyle.Paragraph)
.setRequired(true)
.setMinLength(2)
.setMaxLength(1500);
const inputLabel = createTextInput('note-message', 'Note Message', null, true, TextInputStyle.Paragraph, 1500, 2);
modal.addComponents(new ActionRowBuilder<TextInputBuilder>().addComponents(input));
modal.addLabelComponents(inputLabel);
await interaction.showModal(modal);
}
+3 -7
View File
@@ -1,7 +1,7 @@
import { ActionRowBuilder, ApplicationCommandType, ApplicationIntegrationType, Client, ContextMenuCommandBuilder, InteractionContextType, ModalBuilder, PermissionFlagsBits, TextInputBuilder, TextInputStyle, UserContextMenuCommandInteraction } from 'discord.js';
import { config } from '../config';
import { Database } from '../shared/Database';
import { deferInteraction, syncName } from '../utils';
import { createTextInput, deferInteraction, syncName } from '../utils';
export default {
name: 'Sync Name',
@@ -39,13 +39,9 @@ export default {
.setCustomId(`sync-name-modal_${idToUse}`)
.setTitle(`Syncing ${member ? member.displayName : idToUse}'s name`);
const input = new TextInputBuilder()
.setCustomId('id')
.setLabel('User has multiple linked accounts. Provide ID')
.setStyle(TextInputStyle.Short)
.setRequired(false);
const inputLabel = createTextInput('id', 'User has multiple linked accounts. Provide ID', null, false, TextInputStyle.Short, null, null);
modal.addComponents(new ActionRowBuilder<TextInputBuilder>().addComponents(input));
modal.addLabelComponents(inputLabel);
return await interaction.showModal(modal);
}