我尝试创建一个不和谐的建议命令,但它失败了,点击这里是代码
// Add event listeners for the collector
collector.on('collect', async buttonInteraction => {
if (buttonInteraction.customId === 'upvote_button') {
upvotes++;
upvoteButton.setLabel(`👍 ${upvotes}`)
} else if (buttonInteraction.customId === 'downvote_button') {
downvotes++;
downvoteButton.setLabel(`👎 ${downvotes}`)
}
// Edit the original message to update the vote counts and disable the button that was clicked
embed.fields[0].value = `👍 ${upvotes}`;
embed.fields[1].value = `👎 ${downvotes}`;
await buttonInteraction.edit({ embeds: [embed], components: [actionRow] });
});