admin管理员组文章数量:1333175
I am trying to fetch the ids of all members of a large guild. This guild has around 2000 people in it. I am using this:
const list = client.guilds.get("id");
list.fetchMembers().then(r => {
r.members.array().forEach(r => {
let userid = r.id
msg.channel.send(userid)
})
});
It works for my test guild of 3 people but once I try it with the large guild, I get this error
(node:8632) UnhandledPromiseRejectionWarning: Error: Members didn't arrive in time.
at Timeout._onTimeout (c:\Users\Han75\Documents\bot\node_modules\discord.js\src\client\Client.js:436:7)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)
I know its because of a timeout. How do I stop this?
I am trying to fetch the ids of all members of a large guild. This guild has around 2000 people in it. I am using this:
const list = client.guilds.get("id");
list.fetchMembers().then(r => {
r.members.array().forEach(r => {
let userid = r.id
msg.channel.send(userid)
})
});
It works for my test guild of 3 people but once I try it with the large guild, I get this error
(node:8632) UnhandledPromiseRejectionWarning: Error: Members didn't arrive in time.
at Timeout._onTimeout (c:\Users\Han75\Documents\bot\node_modules\discord.js\src\client\Client.js:436:7)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)
I know its because of a timeout. How do I stop this?
Share Improve this question asked May 1, 2020 at 12:36 Han75Han75 31 gold badge1 silver badge3 bronze badges1 Answer
Reset to default 1Assuming you're on the latest stable version (v12), you can use GuildMemberManager#fetch with no arguments to fetch all members of a guild.
本文标签: javascriptHow to fetch all members of a large guild discordjsStack Overflow
版权声明:本文标题:javascript - How to fetch all members of a large guild discord.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742348481a2458007.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论