@theholocron/discord-client 1.46.0 → 1.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +2 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -239,11 +239,12 @@ function createDiscordBotClient(opts) {
239
239
  const wanted = id(roleId);
240
240
  const found = [];
241
241
  let after;
242
- for (let page = 0; page < MAX_MEMBER_PAGES; page++) {
242
+ for (let page = 0; page <= MAX_MEMBER_PAGES; page++) {
243
243
  const batch = await rest.request(`/guilds/${id(guildId)}/members`, { query: {
244
244
  limit: "1000",
245
245
  ...after === void 0 ? {} : { after }
246
246
  } });
247
+ if (page === MAX_MEMBER_PAGES && batch.length > 0) break;
247
248
  for (const m of batch) if (m.roles.includes(wanted)) found.push(m);
248
249
  const last = batch[batch.length - 1]?.user?.id;
249
250
  if (batch.length < 1e3 || last === void 0) return found;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/discord-client",
3
- "version": "1.46.0",
3
+ "version": "1.47.1",
4
4
  "description": "A TypeScript client for the Discord webhooks API",
5
5
  "keywords": [
6
6
  "discord",
@@ -32,7 +32,7 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@theholocron/http-client": "^1.46.0"
35
+ "@theholocron/http-client": "^1.47.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@theholocron/cli": "5.0.0-alpha.79",