我的民意调查命令在discord.js v12中不起作用

时间:2020-10-05 05:02:00

标签: javascript discord discord.js

我的代码没有给我任何错误。但是,它不起作用:

client.on('message', async (msg) => {
 if (msg.content.startsWith('>poll')) {
  if (msg.member.hasPermission('ADMINISTRATOR')) return;
  const args = message.content
   .slice(prefix.length)
   .trim()
   .split(/ +/g);
  const embed = new Discord.MessageEmbed()
   .setTitle('Poll!')
   .setColor('#0099ff')
   .setDescription(args[0]);
  await msg.channel.send(embed);
  await botMSG.react('?');
  await botMSG.react('?');
 }
});

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您尚未定义botMSG更改await msg.channel.send(embed) let botMSG = await msg.channel.send(embed)