我有一个创建新 MessageEmbed 的 poll 命令,然后我希望机器人用 4 个表情对投票作出反应,以便能够在投票中投票。问题是,当我reply()在交互中使用该函数时,机器人崩溃并给出此错误:DiscordAPIError: Interaction has already been acknowledged.我尝试获取回复,但它似乎不起作用。这是代码:
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('poll')
.setDescription('Make a poll, (and you get to choose the options) ;)')
.addStringOption((option) =>
option
.setName('title')
.setDescription('The title of the poll embed.')
.setRequired(true)
)
.addStringOption((option) =>
option
.setName('option1')
.setDescription('1st option for the poll.')
.setRequired(true)
)
.addStringOption((option) =>
option
.setName('option2')
.setDescription('2nd option for the poll.')
.setRequired(true)
)
.addStringOption((option) =>
option
.setName('option3')
.setDescription('3rd option …Run Code Online (Sandbox Code Playgroud)