我的代码没有给我任何错误。但是,它不起作用:
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('?');
}
});
有什么想法吗?
答案 0 :(得分:0)
您尚未定义botMSG
更改await msg.channel.send(embed)
到 let botMSG = await msg.channel.send(embed)