【问题标题】:discord.js getting the name of the user that used the bot commanddiscord.js 获取使用 bot 命令的用户名
【发布时间】:2020-08-06 07:23:28
【问题描述】:

我需要获取发布内容的用户的姓名。我尝试过的所有东西都会返回 ID。我已经尝试过 msg.author 等。

编辑:可怕的标题名称 smh

【问题讨论】:

    标签: javascript node.js discord.js


    【解决方案1】:

    您可以使用message.author.tag 来返回用户名,如username#1234message.author.username 以获取不带标识符的用户名username

    Source

    【讨论】:

    • 没问题!
    【解决方案2】:

    你试过msg.author.username吗?

    【讨论】:

      猜你喜欢
      • 2020-04-07
      • 2020-01-22
      • 2021-06-03
      • 2022-11-29
      • 2021-11-19
      • 2018-07-28
      • 2020-09-13
      • 2020-11-13
      • 2021-06-25
      相关资源
      最近更新 更多