【发布时间】:2022-11-25 13:58:18
【问题描述】:
所以我正在尝试使用 .addOptionInteger 选项,但它不起作用
.setName('add')
.setDescription('Add coins to your current balance')
.addIntegerOption(option =>
option.setName("amount")
.setDescription("amount of coins")
.setMinValue(0)
.setMaxValue(22)
),
这是为了获取它
const AddCoins = options.getInteger('amount');
但它一直给我这个错误:
Error: TypeError [CommandInteractionOptionType]: Option "amount" is of type: 3; expected 4.
我试图查看 discordjs 文档,但只有关于 String 等选项的内容。
【问题讨论】:
标签: javascript node.js discord.js