不明白为什么会报错: option.choices?.map is not a function
我在使用 slash v14,我的代码:
const { JsonDatabase } = require("wio.db");
const dbProducts = new JsonDatabase({ databasePath: "./databases/myJsonBotProducts.json" });
module.exports = {
name: "set",
description: "[🛠/OWNER'S] Sete um Produto!",
options: [
{
name: "product",
type: Discord.ApplicationCommandOptionType.String,
description: "Selecione um Produto",
required: true,
async choices(interaction) {
return dbProducts.all().map((product) => {
return {
name: `ID: ${product.ID} - Nome: ${product.data.nome}`,
value: product.ID.toString(),
};
});
},
},
],
type: Discord.ApplicationCommand.ChatInput,
我想把这个系统做在一个交互里面,因为我打算在这个选择中做更多的系统!