Modal Components Maxmimum

The guide says that a modal can handle up to 5 ActionRowBuildes. When i add a 4rd, the bot crashes every time when i open it. Is 3 the limit?
12 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
d.js docs
d.js docs2y ago
To help you we need more information: • What are you trying to do? • What is your code? • What errors and debug logs do you have?
Turboman3000
Turboman3000OP2y ago
Logs: I dont have any error, the bot just crashes.
const title = new TextInputBuilder()
.setCustomId("announce_cmd_title")
.setLabel("Title")
.setPlaceholder("Title")
.setRequired(true)
.setStyle(TextInputStyle.Short);

const image = new TextInputBuilder()
.setCustomId("announce_cmd_image")
.setLabel("Image URL")
.setPlaceholder("https://")
.setRequired(false)
.setStyle(TextInputStyle.Short);

const msg = new TextInputBuilder()
.setCustomId("announce_cmd_message")
.setLabel("Message")
.setPlaceholder("Message to announce")
.setRequired(true)
.setStyle(TextInputStyle.Paragraph)
.setMaxLength(8000);

const date = new TextInputBuilder()
.setCustomId("announce_cmd_date")
.setLabel("Date (dd.MM.yyyy hh:mm)")
.setRequired(true)
.setMaxLength(16)
.setMinLength(16)
.setPlaceholder("dd.MM.yyyy hh:mm")
.setStyle(TextInputStyle.Short);

const firstActionRow =
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(title);
const secondActionRow =
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(image);
const thirdActionRow =
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(msg);
const fourActionRow =
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(date);

modal.addComponents(
firstActionRow,
secondActionRow,
thirdActionRow,
fourActionRow
);
const title = new TextInputBuilder()
.setCustomId("announce_cmd_title")
.setLabel("Title")
.setPlaceholder("Title")
.setRequired(true)
.setStyle(TextInputStyle.Short);

const image = new TextInputBuilder()
.setCustomId("announce_cmd_image")
.setLabel("Image URL")
.setPlaceholder("https://")
.setRequired(false)
.setStyle(TextInputStyle.Short);

const msg = new TextInputBuilder()
.setCustomId("announce_cmd_message")
.setLabel("Message")
.setPlaceholder("Message to announce")
.setRequired(true)
.setStyle(TextInputStyle.Paragraph)
.setMaxLength(8000);

const date = new TextInputBuilder()
.setCustomId("announce_cmd_date")
.setLabel("Date (dd.MM.yyyy hh:mm)")
.setRequired(true)
.setMaxLength(16)
.setMinLength(16)
.setPlaceholder("dd.MM.yyyy hh:mm")
.setStyle(TextInputStyle.Short);

const firstActionRow =
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(title);
const secondActionRow =
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(image);
const thirdActionRow =
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(msg);
const fourActionRow =
new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(date);

modal.addComponents(
firstActionRow,
secondActionRow,
thirdActionRow,
fourActionRow
);
monbrey
monbrey2y ago
What's the error that it's crashing on?
Turboman3000
Turboman3000OP2y ago
I dont have any error
monbrey
monbrey2y ago
How do you not have logs?
Turboman3000
Turboman3000OP2y ago
idk That strange^10
Syjalo
Syjalo2y ago
Max length should be lower or equal 4000
Turboman3000
Turboman3000OP2y ago
uhm
monbrey
monbrey2y ago
Might also have an issue with min and max being both 16
Turboman3000
Turboman3000OP2y ago
😅 Alright I've fixed it. And i also know why their is no error. And fixed it too
Want results from more Discord servers?
Add your server