【问题标题】:How to use remove event with ReactionCollector?如何在 ReactionCollector 中使用 remove 事件?
【发布时间】:2020-08-14 03:03:49
【问题描述】:

How can I make a reactionCollector on a remove event work? 与此问题类似,但列出的解决方案不是我的解决方案。

msg.channel.send("Hello World")
    .then(async function (message) {
         await message.react('✅')
         const filter = (reaction, user) => {
            return reaction.emoji.name === '✅'
         };
   
         const collector = message.createReactionCollector(filter, {time: time, dispose: true});

         collector.on('remove', (reaction, reactionCollector) => {
          console.log("React removed")
         });
   
         collector.on('collect', (reaction, reactionCollector) => {
              console.log("React added")
         });

    });

链接问题的解决方案是将dispose: true 添加到collectorOptions,这对我不起作用。 “React 已移除”从未被记录。

【问题讨论】:

    标签: discord.js


    【解决方案1】:

    仅 v12+ 支持删除。我使用的是 v11。

    【讨论】:

      猜你喜欢
      • 2020-09-03
      • 2014-06-11
      • 1970-01-01
      • 1970-01-01
      • 2021-11-09
      • 2022-07-09
      • 2020-11-17
      • 1970-01-01
      • 2015-04-18
      相关资源
      最近更新 更多