Will
Will
Explore posts from servers
willuhmjs - ```jsValidationError s.string Exp...
const modal = new ModalBuilder()
.setTitle(`Editing ${user.username}'s profile`)
.setCustomId("edit_profile_modal");
const DapScoreInput = new TextInputBuilder()
.setCustomId("dap_score_input")
.setPlaceholder("DapScore")
.setValue(""+UserGuildData.userDap || "0")
.setMinLength(1)
.setStyle(TextInputStyle.Short);

const DapsGivenInput = new TextInputBuilder()
.setCustomId("daps_given_input")
.setPlaceholder("Daps Given")
.setValue(""+UserGuildData.dapsGiven || "0")
.setMinLength(1)
.setStyle(TextInputStyle.Short);

const DapsRecievedInput = new TextInputBuilder()
.setCustomId("daps_recieved_input")
.setPlaceholder("Daps Recieved")
.setValue(""+UserGuildData.dapsRecieved || "0")
.setMinLength(1)
.setStyle(TextInputStyle.Short);

const firstActionRow = new ActionRowBuilder().addComponents(
DapScoreInput
);

const secondActionRow = new ActionRowBuilder().addComponents(
DapsGivenInput
);

const thirdActionRow = new ActionRowBuilder().addComponents(
DapsRecievedInput
);

// @ts-ignore:code
modal.addComponents(firstActionRow, secondActionRow, thirdActionRow);
await interaction.showModal(modal);
const modal = new ModalBuilder()
.setTitle(`Editing ${user.username}'s profile`)
.setCustomId("edit_profile_modal");
const DapScoreInput = new TextInputBuilder()
.setCustomId("dap_score_input")
.setPlaceholder("DapScore")
.setValue(""+UserGuildData.userDap || "0")
.setMinLength(1)
.setStyle(TextInputStyle.Short);

const DapsGivenInput = new TextInputBuilder()
.setCustomId("daps_given_input")
.setPlaceholder("Daps Given")
.setValue(""+UserGuildData.dapsGiven || "0")
.setMinLength(1)
.setStyle(TextInputStyle.Short);

const DapsRecievedInput = new TextInputBuilder()
.setCustomId("daps_recieved_input")
.setPlaceholder("Daps Recieved")
.setValue(""+UserGuildData.dapsRecieved || "0")
.setMinLength(1)
.setStyle(TextInputStyle.Short);

const firstActionRow = new ActionRowBuilder().addComponents(
DapScoreInput
);

const secondActionRow = new ActionRowBuilder().addComponents(
DapsGivenInput
);

const thirdActionRow = new ActionRowBuilder().addComponents(
DapsRecievedInput
);

// @ts-ignore:code
modal.addComponents(firstActionRow, secondActionRow, thirdActionRow);
await interaction.showModal(modal);
6 replies