I'm trying to add a select menu inside a modal (I pretty sure it's possible) but I ended up in this situation and getting this error in the console:
const modal = new client.discord.ModalBuilder()
.setCustomId('verification-modal')
.setTitle('Verify yourself')
.addComponents([
new client.discord.ActionRowBuilder().addComponents(
new client.discord.SelectMenuBuilder()
.setCustomId('t')
.setPlaceholder('Nothing selected')
.addOptions(
{
label: 'Select me',
description: 'This is a description',
value: 'first_option',
},
{
label: 'You can select me too',
description: 'This is also a description',
value: 'second_option',
},
),
new client.discord.TextInputBuilder()
.setCustomId('verification-input')
.setLabel('Answer')
.setStyle(client.discord.TextInputStyle.Short)
.setMinLength(4)
.setMaxLength(12)
.setPlaceholder('ABCDEF')
.setRequired(true),
),
]);
await interaction.showModal(modal);
ode:events:490
throw er; // Unhandled 'error' event
^
DiscordAPIError[50035]: Invalid Form Body
dataponents[0]ponents[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (4,).
if you have any solution '^^
I'm trying to add a select menu inside a modal (I pretty sure it's possible) but I ended up in this situation and getting this error in the console:
const modal = new client.discord.ModalBuilder()
.setCustomId('verification-modal')
.setTitle('Verify yourself')
.addComponents([
new client.discord.ActionRowBuilder().addComponents(
new client.discord.SelectMenuBuilder()
.setCustomId('t')
.setPlaceholder('Nothing selected')
.addOptions(
{
label: 'Select me',
description: 'This is a description',
value: 'first_option',
},
{
label: 'You can select me too',
description: 'This is also a description',
value: 'second_option',
},
),
new client.discord.TextInputBuilder()
.setCustomId('verification-input')
.setLabel('Answer')
.setStyle(client.discord.TextInputStyle.Short)
.setMinLength(4)
.setMaxLength(12)
.setPlaceholder('ABCDEF')
.setRequired(true),
),
]);
await interaction.showModal(modal);
ode:events:490
throw er; // Unhandled 'error' event
^
DiscordAPIError[50035]: Invalid Form Body
data.ponents[0].ponents[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (4,).
if you have any solution '^^
Share Improve this question asked Feb 7, 2023 at 23:48 JohannCJohannC 611 gold badge1 silver badge6 bronze badges 1- 1 No, it's not possible. – MrMythical Commented Feb 8, 2023 at 0:29
1 Answer
Reset to default 7Only text inputs are supported on modals.
Documentation Reference