Channel Select Menu doesn't seem to function?

Why is this erroring:
const addChannelSelectMenu = new ChannelSelectMenuBuilder({
custom_id: `add_team_channels`,
})
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildVoice)
.setMinValues(1)
.setPlaceholder(`Select team channels!`);
const addChannelSelectMenu = new ChannelSelectMenuBuilder({
custom_id: `add_team_channels`,
})
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildVoice)
.setMinValues(1)
.setPlaceholder(`Select team channels!`);
Erroring with:
Error: DiscordAPIError[50035]: Invalid Form Body
data.components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,).
Error: DiscordAPIError[50035]: Invalid Form Body
data.components[0][UNION_TYPE_CHOICES]: Value of field "type" must be one of (1,).
?
7 Replies
d.js toolkit
d.js toolkit11mo ago
- 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!
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
SuitSnap
SuitSnap11mo ago
async execute(interaction) {
const subcommand = interaction.options.getSubcommand();

switch (subcommand) {
case "add_channels":
let addChannelSelectMenu = await addChannels();
await interaction.reply({
content: `Test`,
components: [addChannelSelectMenu],
});
break;

case "create_channels":
createChannels();
break;
}
},
};

async function addChannels() {
const addChannelSelectMenu = new ChannelSelectMenuBuilder({
custom_id: `add_team_channels`,
})
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildVoice)
.setPlaceholder(`Select team channels!`);
console.log(addChannelSelectMenu);
return addChannelSelectMenu;
}
async execute(interaction) {
const subcommand = interaction.options.getSubcommand();

switch (subcommand) {
case "add_channels":
let addChannelSelectMenu = await addChannels();
await interaction.reply({
content: `Test`,
components: [addChannelSelectMenu],
});
break;

case "create_channels":
createChannels();
break;
}
},
};

async function addChannels() {
const addChannelSelectMenu = new ChannelSelectMenuBuilder({
custom_id: `add_team_channels`,
})
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildVoice)
.setPlaceholder(`Select team channels!`);
console.log(addChannelSelectMenu);
return addChannelSelectMenu;
}
Oh, sorry for the ping reply, meant to just silent reply
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
SuitSnap
SuitSnap11mo ago
oh im so dumb lol mb
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
SuitSnap
SuitSnap11mo ago
i looked right at the docs and just went nahh and that was perchance an error