【问题标题】:How to mention the author of the message in discord.js?如何在 discord.js 中提及消息的作者?
【发布时间】:2021-09-14 02:22:53
【问题描述】:

我似乎找不到任何关于如何在 Discord.js 上进行作者提及的确切指南。有人知道怎么做吗?

【问题讨论】:

    标签: discord.js bots


    【解决方案1】:

    提及用户有多种方式

    // With ID
    message.channel.send(`mention with id <@${message.author.id}>`);
    // With user object
    message.channel.send(`mention with user ${message.member.user}`);
    //With builtin reply
    message.reply(`mention with reply`);
    

    【讨论】:

    • 你为什么用message.member.user而不是message.author
    • .author获取用户ID的捷径
    【解决方案2】:

    其实有很多方法,但是:&lt;@${message.author.id}&gt; 将是一个简单的答案。

    【讨论】:

      猜你喜欢
      • 2021-05-12
      • 1970-01-01
      • 2020-09-06
      • 1970-01-01
      • 1970-01-01
      • 2020-10-13
      • 2020-08-06
      • 1970-01-01
      • 2021-06-17
      相关资源
      最近更新 更多