【问题标题】:Discord.js How do I get the bot to react to the message it just sent in discord by id?Discord.js 如何让机器人对它刚刚通过 id 以不和谐方式发送的消息做出反应?
【发布时间】:2020-01-29 06:50:12
【问题描述】:

如何让机器人对它刚刚通过 id 不和谐发送的消息做出反应?

在这种情况下,我已经得到了消息 id:

        if(inf.t !== "MESSAGE_UPDATE") return
        let here = inf.d.id;
         if(inf.d.id === `${here}`){
        message.channel.send(`${here}`);
        message.react("✅"); //this react is just to this reaction is only in 
                            //the message that I sent the command
         }
        });

【问题讨论】:

    标签: javascript node.js discord discord.js


    【解决方案1】:

    使用.then(),像这样:

    message.channel.send(here).then(m => m..react("✅"))
    

    more on .then() here

    【讨论】:

    • 谢谢。如果我想对此添加另一种反应,我该怎么办?
    • 我会把你重定向到this answer
    猜你喜欢
    • 1970-01-01
    • 2020-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-28
    • 2021-10-31
    • 2020-11-20
    • 2021-05-26
    相关资源
    最近更新 更多