在Sharding中使用他的ID获取用户标签?Discord.js



嗨!我需要在Sharding中使用他的Id获得用户标签我试过这个代码,但不起作用:

let tag = await client.shard.broadcastEval(`this.users.get("id").tag`)

任何人都可以帮助我

试试这个:

const user = (await client.shard.broadcastEval('this.users.cache.get("id")')).find(u => u)
if (user) {
let tag = user.tag
// do something with the tag
} else {
// the user wasn't found
}

最新更新