const { ModalBuilder, TextInputBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, PermissionsBitField, TextInputStyle } = require("discord.js");
const Fighter = require(`../../schemas/users`);
const mongoose = require('mongoose');
module.exports = {
data: {
name: 'randomOne'
},
async execute(interaction, client) {
const modal = new ModalBuilder()
.setCustomId("registerOne")
.setTitle("Register Yourself");
const textInput = new TextInputBuilder()
.setCustomId("in-game-name")
.setLabel("In-Game Name")
.setPlaceholder("Enter your in-game name")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const one = new ActionRowBuilder().addComponents(textInput);
modal.addComponents(one, two, three);
await interaction.showModal(modal);
interaction.client.on("modalResponse", async (modalInteraction) => {
if (modalInteraction.customId === "registerOne") {
const inGameName = modalInteraction.fields.getTextInputValue("in-game-name");
await interaction.followUp({
content: `Your In-Game Name: ${inGameName}`,
ephemeral: true
});
}
});
},
};
when i fill my details in the modal, it says something went wrong...