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 toolkit14mo 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.
Turboman3000
Turboman300014mo ago
discord.js@14.11.0 nodejs@18.15.0
d.js docs
d.js docs14mo 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
Turboman300014mo 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
monbrey14mo ago
What's the error that it's crashing on?
Turboman3000
Turboman300014mo ago
I dont have any error
monbrey
monbrey14mo ago
How do you not have logs?
Turboman3000
Turboman300014mo ago
idk That strange^10
Syjalo
Syjalo14mo ago
Max length should be lower or equal 4000
Turboman3000
Turboman300014mo ago
uhm
monbrey
monbrey14mo ago
Might also have an issue with min and max being both 16
Turboman3000
Turboman300014mo ago
😅 Alright I've fixed it. And i also know why their is no error. And fixed it too