【问题标题】:Can a discord bot go back and react to all old messages不和谐机器人可以返回并对所有旧消息做出反应吗
【发布时间】:2021-06-25 18:03:16
【问题描述】:

这将用于图像投票系统。我在想: 10 秒后,我的机器人拒绝向 @everyone 发送消息,但同时对已发送的所有消息做出反应,因此人们可以为每张图片投票。 (ADD_REACTIONS 一直处于关闭状态)

setTimeout(() => {
      var channel = client.channels.cache.get(`823225045231992892`) 
      
        channel.send('You cant send more messages, but you can vote now!');
        channel.overwritePermissions(
          [
            {
              id: channel.guild.id,
              allow: ["SEND_MESSAGES"],
            },
          ],
          "Deny access to send messages"
        );
    }, 0);

【问题讨论】:

  • 在发送消息之前是 dey,最后 0 实际上是 10000 我知道...

标签: javascript node.js json discord discord.js


【解决方案1】:

猜猜这就是你想做的事

//Guessing the channel is catched as Channel
Channel.send("The reactable message").then(msg => {
    msg.react("100000000001").then( () => { //Put the available Emoji ID
        setTimeout( () => {
            msg.reactions.cache.get("100000000001").remove().cache(console.log);
            msg.react("❌"); //the unavailable Emoji
        },1000);
    })
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-03
    • 2020-09-03
    • 1970-01-01
    • 2020-12-06
    • 2020-11-20
    • 1970-01-01
    • 2021-05-19
    • 1970-01-01
    相关资源
    最近更新 更多