为什么它说: UnhandledPromiseRejectionWarning: TypeError: message.react不是一个函数,也许它必须这样做,因为这件等待反应的事情已经在等待消息的反应->中了,如果( reaction emoji = C),但是要做什么我必须改变。
} else if (mainEmbedEmoji == "") {
// call the lord EmojiMessageMan1 to handle reactions
async function emojiMessageMan1(message, validReactions) {
// validReactions = ["one", "two"]
for (const reaction1 of validReactions) await message.react(reaction1);
// filter
const filter1 = (reaction, user) => validReactions.includes(reaction.emoji.name) && (!user.bot)
// returns emoji the user reacted with
return message
.awaitReactions(filter1, {
max: 1,
})
.then(collected => collected.first() && collected.first().emoji.name);
}
const bigC = new MessageEmbed()
.setColor('0x0099ff')
.setTitle("Premium Minecraft Servers")
.setDescription(`*Link:* https://cloudx.host/cart.php?gid=1\n\nYou want to host a Minecraft Java Edition Server? No problem, with our High-End specifications will your Server be online 24/7 and you can enjoy Minecraft with your friends without having to worry about connection!\n\n**Options/Prices:**`)
.addField(`**RAM Options:**`, "*Please choose how much RAM your Server should have:*\n:one:: 1 GB RAM\n:two:: 2 GB RAM\n:three:: 3 GB RAM\n:four:: 4 GB RAM\n:six:: 6 GB RAM\n:eight:: 8 GB RAM\n:keycap_ten:: 10 GB RAM\n\nPlease react to this message with :one:, :two:, :three:, :four:, :six:, :eight: or :keycap_ten:")
// sends bigC and await for reactions
let mainEmbedMsg1 = "";
await message.channel.send(bigC).then((message) => {
mainEmbedMsg1 = message
})
let mainEmbedEmoji1 = await emojiMessageMan1(bigC, ['1⃣', '2⃣', '3⃣', '4⃣', '6⃣', '8⃣', ''])发布于 2020-05-18 14:08:28
在emojiMessageMan1函数调用中,您将作为第一个参数bigC传递,这是一个MessageEmbed。
但实际上,您需要在反应处理程序中等待一个消息。
因此,您必须传递mainEmbedMsg1而不是bigC:
let mainEmbedEmoji1 = await emojiMessageMan1(mainEmbedMsg1, ['1⃣', '2⃣', '3⃣', '4⃣', '6⃣', '8⃣', ''])https://stackoverflow.com/questions/61815473
复制相似问题