1 回答

TA貢獻1801條經驗 獲得超8個贊
您正在使用 編輯消息。由于消息只有嵌入,這將刪除嵌入,因此沒有要編輯消息的內容。{embed: null}
如果我正確解釋代碼,您希望更新嵌入,因此請使用以下內容:
// Using let here so that embed can be reassigned later
let embed = new Discord.MessageEmbed()
.setTitle("??? Time is ticking! You have 15 seconds to answer | WHO'S THAT POKEMON?!")
.setColor(colored[~~(Math.random() * colored.length)])
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
.setImage(pokem.imageURL)
// rest of code...
if (answer === pokem.name.toLowerCase()) {
let embed = new Discord.MessageEmbed()
.setTitle("<a:done:707045670661652481> Correct")
.setColor(colored[~~(Math.random() * colored.length)])
.setDescription(`Yatta! Well done, \`${pokem.name}\` was correct.`);
// {embed} is shorthand for {embed: embed}
await msg.edit({embed});
return message.channel.send(embed);
}
// Instead of reassigning to embed, you could also create a new variable
embed = new Discord.MessageEmbed()
.setTitle("<a:error:707045703003668521> Incorrect")
.setColor(colored[~~(Math.random() * colored.length)])
.setDescription(`Ba-Baka! You answered incorrectly, It was \`${pokem.name}\`.**`);
await msg.edit({embed});
添加回答
舉報