const { SlashCommandBuilder, ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, Events } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('callibrate') .setDescription('set the vp amount.'), async execute(interaction, client) { if (interaction.user.id === '384498886812631042') { const modal = new ModalBuilder() .setCustomId('vpQuery') .setTitle('Input Number'); const given_number = new TextInputBuilder() .setCustomId('numb') .setPlaceholder('Only integers are accepted!') .setLabel('Current VP when checking minecraft') .setStyle(TextInputStyle.Short) .setMinLength(1) .setMaxLength(3) .setRequired(true); const query = new ActionRowBuilder().addComponents(given_number); modal.addComponents(query); await interaction.showModal(modal) var unvalidated_response = '0' client.on(Events.InteractionCreate, async interaction => { if (!interaction.isModalSubmit()) return; if (interaction.customId === 'vpQuery') { unvalidated_response = interaction.fields.getTextInputValue('numb'); } console.log(unvalidated_response) await interaction.reply({ content: 'Your submission was received successfully!' }); }); } else { interaction.reply('You don\'t have permission for this command!'); } }, };