willuhmjs - ```jsValidationError s.string Exp...

ValidationError > s.string
Expected a string primitive

Received:
| undefined

at StringValidator.handle (/workspaces/Dapper/node_modules/@sapphire/shapeshift/src/validators/StringValidator.ts:77:64)
at StringValidator.parse (/workspaces/Dapper/node_modules/@sapphire/shapeshift/src/validators/BaseValidator.ts:102:48)
at validateRequiredParameters (/workspaces/Dapper/node_modules/@discordjs/builders/src/components/textInput/Assertions.ts:26:17)
at TextInputBuilder.toJSON (/workspaces/Dapper/node_modules/@discordjs/builders/src/components/textInput/TextInput.ts:132:3)
at <anonymous> (/workspaces/Dapper/node_modules/@discordjs/builders/src/components/ActionRow.ts:103:61)
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (/workspaces/Dapper/node_modules/@discordjs/builders/src/components/ActionRow.ts:103:32)
at <anonymous> (/workspaces/Dapper/node_modules/@discordjs/builders/src/interactions/modals/Modal.ts:82:61)
at Array.map (<anonymous>)
at ModalBuilder.toJSON (/workspaces/Dapper/node_modules/@discordjs/builders/src/interactions/modals/Modal.ts:82:32)
ValidationError > s.string
Expected a string primitive

Received:
| undefined

at StringValidator.handle (/workspaces/Dapper/node_modules/@sapphire/shapeshift/src/validators/StringValidator.ts:77:64)
at StringValidator.parse (/workspaces/Dapper/node_modules/@sapphire/shapeshift/src/validators/BaseValidator.ts:102:48)
at validateRequiredParameters (/workspaces/Dapper/node_modules/@discordjs/builders/src/components/textInput/Assertions.ts:26:17)
at TextInputBuilder.toJSON (/workspaces/Dapper/node_modules/@discordjs/builders/src/components/textInput/TextInput.ts:132:3)
at <anonymous> (/workspaces/Dapper/node_modules/@discordjs/builders/src/components/ActionRow.ts:103:61)
at Array.map (<anonymous>)
at ActionRowBuilder.toJSON (/workspaces/Dapper/node_modules/@discordjs/builders/src/components/ActionRow.ts:103:32)
at <anonymous> (/workspaces/Dapper/node_modules/@discordjs/builders/src/interactions/modals/Modal.ts:82:61)
at Array.map (<anonymous>)
at ModalBuilder.toJSON (/workspaces/Dapper/node_modules/@discordjs/builders/src/interactions/modals/Modal.ts:82:32)
what is the common user error associated with modals? I am trying to create a simple one but I get this error.
M
Mark522d ago
code for the modal?
W
will522d ago
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);
M
Mark522d ago
maybe someone else who knows more can answer, i haven't actually used v13/14/modals meguFace but having the code will help. if you catch your error and log it, you can also post that when it pops up again, it should point to the line.
S
Sawako522d ago
TextInputBuilders missing .setLabel
Want results from more Discord servers?
Add your server
More Posts
sam - ```srcconfig.ts737 - error TS2345 Argum...``` src/config.ts:7:37 - error TS2345: Argument of type 'string' is not assignable to parameter of tRhys - ^Sort of related to above, does inheritance...^Sort of related to above, does inheritance work with commands? I've got a few commands for openinThatGuyJamal - Is it possible to make a default va...Is it possible to make a default value for registering command meta data. Like: ``` guildIds: isCanaUser - ```javascriptconst { Client, Events, Gate...```javascript const { Client, Events, GatewayIntentBits } = require('discord.js'); const client Ben855 - For autocomplete arguments in slash comma...For autocomplete arguments in slash commands, if the user enters something that wasn't available in Rhys - Is there a way to use preconditions to remo...Is there a way to use preconditions to remove redundant if checks? For example: ```typescript @AppTobyy - how do i fixhow do i fixTobyy -Jesse - How would one go about adding user permiss...How would one go about adding user permissions to a slash command? This is my first time working wiJesse - why am i getting this error?why am i getting this error?secondubly - Not sure if my googling is just insuf...Not sure if my googling is just insufficient but is there a way to add multiple users as a parameterbomi - That's what I did with that, but this can b...That's what I did with that, but this can be usefulNoxillio - sapphiretype is impossible to install...@sapphire/type is impossible to install on Apple Silicon systems.Noxillio - Is there any purpose to sapphireplugi...Is there any purpose to @sapphire/plugin-editable-commands anymore now that application commands are