[英]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.