如何使用分片获取所有用户 ID?

时间:2021-01-31 12:54:57

标签: javascript node.js discord.js

如何使用分片获取所有用户 ID? 代码:client.shard.fetchClientValues('users.cache.map(({ id }) => id)')

1 个答案:

答案 0 :(得分:0)

我说你的代码你试过了?我猜:

client.shard.fetchClientValues('users.cache').then(results => results.map(({ id }) => id))

const results = await client.shard.fetchClientValues('users.cache');
const ids = results.map(({ id }) => id);

虽然我从未使用过 discord.js,但我不知道它有什么作用。