Discord-Modals Error
Error - data.components[0].components[BASE_TYPE_BAD_LENGTH]: Must be between 1 and 5 in length.
case 'permit':
const permitModal = new ModalBuilder()
.setCustomId('permitModal')
.setTitle('Permit User or Role')
.addComponents(
new TextInputBuilder()
.setCustomId('permitInput')
.setLabel('User or Role Name')
.setStyle(TextInputStyle.Short)
.setMinLength(1)
.setMaxLength(5)
);
await interaction.showModal(permitModal);
break;
case 'restrict':
const restrictModal = new ModalBuilder()
.setCustomId('restrictModal')
.setTitle('Restrict User or Role')
.addComponents(
new TextInputBuilder()
.setCustomId('restrictInput')
.setLabel('User or Role Name')
.setStyle(TextInputStyle.Short)
.setMinLength(1)
.setMaxLength(5)
);
await interaction.showModal(restrictModal);
break;
4 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by staffdiscord.js v14.15.3, node version - 20
you have to put the textinputbuilder inside an action row
oh yea i am dumb thanks