【问题标题】:discord.js user id to usernamediscord.js 用户名到用户名
【发布时间】:2021-06-27 05:07:36
【问题描述】:

我正在制作一个机器人,并且我正在努力实现每次有人使用命令时都会将其记录在控制台中,这就是我的代码。

            console.log(message.author ++ ,`used the command 'come'`);

(命令来了) 每次我这样做时,它都会记录用户的 id,我希望它发送用户名(user#6969)

【问题讨论】:

  • ++ 有什么用?您要连接吗?

标签: javascript node.js discord discord.js


【解决方案1】:
console.log(message.author.tag, " used the command 'come'");
// prints: username#1234 used the command 'come'

【讨论】:

    猜你喜欢
    • 2021-06-03
    • 2021-08-15
    • 2021-12-08
    • 2023-04-11
    • 2021-12-19
    • 2020-07-05
    • 2019-02-07
    • 1970-01-01
    • 2020-09-28
    相关资源
    最近更新 更多