【发布时间】:2019-10-29 22:08:18
【问题描述】:
我希望机器人在用户使用特定表情符号对消息做出反应后删除它的消息。当我用下面的代码尝试这个时,没有任何反应。没有任何错误。我也不想要时间限制,只要有反应就去做。当前代码:
const filter = (reaction, user) => {
return ['????'].includes(reaction.emoji.name) && user.id === message.author.id;
};
message.awaitReactions(filter, { max: 1})
.then(collected => {
const reaction = collected.first();
if (reaction.emoji.name === '????') {
sentMessage.delete(1000)
} else {
message.reply('you reacted with a thumbs down.');
}
})
.catch(collected => {
console.log(`After a minute, only ${collected.size} out of 4 reacted.`);
message.reply('you reacted with neither a thumbs up, nor a thumbs down.');
【问题讨论】:
标签: javascript discord.js