mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
fix guild fetch members result on large guilds
This commit is contained in:
@@ -2,7 +2,7 @@ name: Discordeno
|
||||
description: >-
|
||||
Discord Deno TypeScript API library wrapper(Officially vetted library by
|
||||
Discord Team) https://discordeno.netlify.app
|
||||
version: 8.4.1
|
||||
version: 8.4.3
|
||||
stable: true
|
||||
files:
|
||||
- ./src/**/*
|
||||
|
||||
@@ -36,8 +36,9 @@ import { identifyPayload } from "../module/client.ts";
|
||||
import { requestAllMembers } from "../module/shardingManager.ts";
|
||||
import { MemberCreatePayload } from "../types/member.ts";
|
||||
import { cache } from "../utils/cache.ts";
|
||||
import { createMember } from "../structures/member.ts";
|
||||
import { createMember, Member } from "../structures/member.ts";
|
||||
import { urlToBase64 } from "../utils/utils.ts";
|
||||
import { Collection } from "../utils/collection.ts";
|
||||
|
||||
/** Gets an array of all the channels ids that are the children of this category. */
|
||||
export function categoryChildrenIDs(guild: Guild, id: string) {
|
||||
@@ -210,7 +211,7 @@ export async function getMembersByQuery(
|
||||
|
||||
return new Promise((resolve) => {
|
||||
requestAllMembers(guild, resolve, { query: name, limit });
|
||||
});
|
||||
}) as Promise<Collection<string, Member>>;
|
||||
}
|
||||
|
||||
/** Create an emoji in the server. Emojis and animated emojis have a maximum file size of 256kb. Attempting to upload an emoji larger than this limit will fail and return 400 Bad Request and an error message, but not a JSON status code. If a URL is provided to the image parameter, Discordeno will automatically convert it to a base64 string internally. */
|
||||
|
||||
@@ -372,11 +372,7 @@ export async function handleDiscordPayload(
|
||||
|
||||
if (options.chunk_index + 1 === options.chunk_count) {
|
||||
fetchAllMembersProcessingRequests.delete(options.nonce);
|
||||
resolve(
|
||||
options.members.map((member) =>
|
||||
guild.members.get(member.user.id)
|
||||
),
|
||||
);
|
||||
resolve(guild.members);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user