From fb67aecca1a6b4c2d8adee5c4a9ea8401b246689 Mon Sep 17 00:00:00 2001 From: NekoCyan Date: Wed, 23 Nov 2022 23:45:10 +0700 Subject: [PATCH] fix & docs: description. - fix(GuildMemberManager): remove "reytring". - docs(FetchGuildMember): delay to client.sleep. --- Document/FetchGuildMember.md | 5 ++--- src/managers/GuildMemberManager.js | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Document/FetchGuildMember.md b/Document/FetchGuildMember.md index e94cb91..25b5558 100644 --- a/Document/FetchGuildMember.md +++ b/Document/FetchGuildMember.md @@ -68,16 +68,15 @@ all examples shown use the "overlap" method ```js const guild = client.guilds.cache.get('id'); const channel = guild.channels.cache.get('id'); -const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); // Overlap (slow) for (let index = 0; index <= guild.memberCount; index += 100) { await guild.members.fetchMemberList(channel, index, index !== 100).catch(() => {}); - await delay(500); + await client.sleep(500); } // Non-overlap (fast) for (let index = 0; index <= guild.memberCount; index += 200) { await guild.members.fetchMemberList(channel, index == 0 ? 100 : index, index !== 100).catch(() => {}); - await delay(500); + await client.sleep(500); } console.log(guild.members.cache.size); // will print the number of members in the guild ``` diff --git a/src/managers/GuildMemberManager.js b/src/managers/GuildMemberManager.js index d37b345..52dfb26 100644 --- a/src/managers/GuildMemberManager.js +++ b/src/managers/GuildMemberManager.js @@ -532,7 +532,6 @@ class GuildMemberManager extends CachedManager { if (guild.id !== this.guild.id) return; if (type == 'INVALIDATE' && offset > 100) { if (retry < retryMax) { - console.log('Retrying...'); this.guild.shard.send({ op: Opcodes.LAZY_REQUEST, d: {