mirror of
https://github.com/nx-bat/discordbot-ng.git
synced 2026-09-22 10:29:10 -04:00
Update modals
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user