【发布时间】:2022-08-17 17:57:32
【问题描述】:
我目前正在制作一个基于模式的排序系统并提取 TextInput 工作正常,但是我似乎无法弄清楚如何提取 SelectMenu 数据,因为当前代码只返回一个错误
TypeError: interaction.fields.getSelectMenuValue is not a function
client.on(\'interactionCreate\', async interaction => {
if (!interaction.isModalSubmit() || !interaction.customId === \'tankform\') return;
await interaction.reply({ content: \'Your order was received successfully!\', ephemeral: true });
const IGN = interaction.fields.getTextInputValue(\'minecraft_ign\');
const Weapon = interaction.fields.getSelectMenuValue(\'weapon_type\');
const ownedWeapon = interaction.fields.getSelectMenuValue(\'owned_weapon\');
const ownedTanks = interaction.fields.getSelectMenuValue(\'owned_tanks\');
const wantedTanks = interaction.fields.getSelectMenuValue(\'wanted_tanks\');
console.log({IGN, Weapon, ownedWeapon, ownedTanks, wantedTanks})
});
标签: discord.js modal-dialog bots