我试图通过向左或向右反应来使页面正常工作。那行得通,但我似乎无法撤消用户的反应。它告诉我删除未定义
.then(sentEmbed => {
sentEmbed.react("⬅️"),
sentEmbed.react("➡️")
const filterLeft = (reaction, user) => reaction.emoji.name === '⬅️' && user.id === author;
const filterRight = (reaction, user) => reaction.emoji.name === '➡️' && user.id === author;
const collectorLeft = sentEmbed.createReactionCollector(filterLeft, { time: 15000 });
const collectorRight = sentEmbed.createReactionCollector(filterRight, { time: 15000 });
collectorRight.on('collect', r => {
currentMessage = sentEmbed.id,
client.channels.cache.get(channel).send(currentMessage),
sentEmbed.reaction.remove(author),
答案 0 :(得分:0)
我认为您正在使用discord.js v12。如果是,则收集的反应现在正在使用缓存。因此,您需要替换:
sentEmbed.reaction.remove(author);
由sentEmbed.reaction.users.remove(author);