mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
feat: Add not_found to guild member chunk data (#8975)
* feat: add `not_found` to chunk data * docs: consistency * types: export `JSONValue` * refactor: move into typedef area * refactor: prefer unknown * docs: fix parsing Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -18,6 +18,8 @@ module.exports = (client, { d: data }) => {
|
||||
* @typedef {Object} GuildMembersChunk
|
||||
* @property {number} index Index of the received chunk
|
||||
* @property {number} count Number of chunks the client should receive
|
||||
* @property {Array<*>} notFound An array of whatever could not be found
|
||||
* when using {@link GatewayOpcodes.RequestGuildMembers}
|
||||
* @property {?string} nonce Nonce for this chunk
|
||||
*/
|
||||
|
||||
@@ -29,8 +31,9 @@ module.exports = (client, { d: data }) => {
|
||||
* @param {GuildMembersChunk} chunk Properties of the received chunk
|
||||
*/
|
||||
client.emit(Events.GuildMembersChunk, members, guild, {
|
||||
count: data.chunk_count,
|
||||
index: data.chunk_index,
|
||||
count: data.chunk_count,
|
||||
notFound: data.not_found,
|
||||
nonce: data.nonce,
|
||||
});
|
||||
};
|
||||
|
||||
2
packages/discord.js/typings/index.d.ts
vendored
2
packages/discord.js/typings/index.d.ts
vendored
@@ -4711,7 +4711,7 @@ export interface ClientEvents {
|
||||
guildMembersChunk: [
|
||||
members: Collection<Snowflake, GuildMember>,
|
||||
guild: Guild,
|
||||
data: { count: number; index: number; nonce: string | undefined },
|
||||
data: { index: number; count: number; notFound: unknown[]; nonce: string | undefined },
|
||||
];
|
||||
guildMemberUpdate: [oldMember: GuildMember | PartialGuildMember, newMember: GuildMember];
|
||||
guildUpdate: [oldGuild: Guild, newGuild: Guild];
|
||||
|
||||
Reference in New Issue
Block a user