[英]Discord.js - How do I convert user ID to Member
我想知道如何将 ID 转换为会员。 我要转换的 ID 在 a.JSON 文件中。 我有这个脚本:
if(message.content == "!fl leaderboard") {
embed = new Discord.MessageEmbed()
const c = Object.entries(db).sort((a, b)=> b[1].level - a[1].level)
for(const [key, value] of c) {
embed.addField(db[message.author.id].tag, `Level: ${value.level} | XP: ${value.xp}`)
}
message.channel.send(embed)
}
关卡系统脚本为: https://hastebin.com/epucihenin.js
const User = client.users.cache.get("userid");
if (!User) return console.error("Couldn't find the user"); // Note that the user must be in a Guild with your bot for this to work.
console.log(`I found the user ${User.username}.`);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.