Modal Invalid Body

const modal = new ModalBuilder().setCustomId("hiring").setTitle("Hiring Prompt");

const something = new TextInputBuilder()
.setCustomId("title")
.setLabel("What is the title of your post?")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const something2 = new TextInputBuilder()
.setCustomId("description")
.setRequired(true)
.setLabel("Set a description for your post.")
.setStyle(TextInputStyle.Paragraph);
const something8 = new TextInputBuilder()
.setCustomId("link")
.setLabel("How does a user apply? Put a link or text.")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const something3 = new TextInputBuilder()
.setCustomId("image")
.setRequired(false)
.setLabel("Include all image links here.")
.setStyle(TextInputStyle.Paragraph);
const something4 = new TextInputBuilder()
.setCustomId("payment")
.setLabel("Include all payment details here.")
.setPlaceholder("Payment Method(s), Payment Amount, Payment Frequency, etc.")
.setRequired(false)
.setStyle(TextInputStyle.Short);

const ActionRow = new ActionRowBuilder().addComponents([something, something2, something8, something3, something4]);

modal.addComponents(ActionRow);

await interaction.showModal(modal);
},
const modal = new ModalBuilder().setCustomId("hiring").setTitle("Hiring Prompt");

const something = new TextInputBuilder()
.setCustomId("title")
.setLabel("What is the title of your post?")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const something2 = new TextInputBuilder()
.setCustomId("description")
.setRequired(true)
.setLabel("Set a description for your post.")
.setStyle(TextInputStyle.Paragraph);
const something8 = new TextInputBuilder()
.setCustomId("link")
.setLabel("How does a user apply? Put a link or text.")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const something3 = new TextInputBuilder()
.setCustomId("image")
.setRequired(false)
.setLabel("Include all image links here.")
.setStyle(TextInputStyle.Paragraph);
const something4 = new TextInputBuilder()
.setCustomId("payment")
.setLabel("Include all payment details here.")
.setPlaceholder("Payment Method(s), Payment Amount, Payment Frequency, etc.")
.setRequired(false)
.setStyle(TextInputStyle.Short);

const ActionRow = new ActionRowBuilder().addComponents([something, something2, something8, something3, something4]);

modal.addComponents(ActionRow);

await interaction.showModal(modal);
},
Promise {
<rejected> DiscordAPIError[50035]: Invalid Form Body
data.components[0].components[1][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[2][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[3][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[4][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
Promise {
<rejected> DiscordAPIError[50035]: Invalid Form Body
data.components[0].components[1][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[2][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[3][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[4][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
2 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Squid
Squid3y ago
You need one separate row per each text input components, and then add all of those rows to the modal

Did you find this page helpful?