Discord.js反应不收集awaitReactions



我在让我的反应收集器收集反应时遇到了问题,它只是超时,任何想法都将不胜感激。

message.awaitReactions((reaction, user) => user.id == message.author.id && (reaction.emoji.name == '1️⃣' || reaction.emoji.name == '2️⃣'),
{ max: 1, time: 30000 }).then(collected => {

if (collected.first().emoji.name == '1️⃣') {
let roll1 = util.randomroll(1, 101)
if(roll1 > 50){

bot.db.add(`${message.author.id}.balance`, amount);
message.channel.send(bot.embed(`**${quidteam1t}** WON!!! YOU GAINED **${amount}**`));
}else{
bot.db.add(`${message.author.id}.balance`) -= amount;
message.channel.send(bot.embed(`**${quidteam2t}** Won and you lost **$${amount}** better luck next time!`))
}

}
}).catch(collected => {
message.reply('you didnt react');
});
console.log(`${message.author.username} used QuidditchBet to start a betting event!`)



}}

你有没有试着先要求表情符号,然后在你的代码中使用它?我的意思是:const reaction1Emoji = '1️⃣'const reaction2Emoji = '2️⃣',然后将emoji.name替换为reaction1Emojireaction2Emoji!

最新更新