Skip to content

Commit

Permalink
feat: Add not_found to guild member chunk data (#8975)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Jiralite and kodiakhq[bot] committed Jan 2, 2023
1 parent 876b181 commit be294ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand All @@ -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 changes: 1 addition & 1 deletion packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit be294ea

Please sign in to comment.