mirror of
https://github.com/discordjs/discord.js.git
synced 2026-05-21 02:40:07 +00:00
feat(core)!: rename getAllMembers to getMembers with query support
BREAKING CHANGE: getAllMembers has been removed. Use getMembers instead, which accepts an optional query parameter.
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
|||||||
Routes,
|
Routes,
|
||||||
type RESTGetAPIChannelThreadMemberQuery,
|
type RESTGetAPIChannelThreadMemberQuery,
|
||||||
type RESTGetAPIChannelThreadMemberResult,
|
type RESTGetAPIChannelThreadMemberResult,
|
||||||
|
type RESTGetAPIChannelThreadMembersQuery,
|
||||||
type RESTGetAPIChannelThreadMembersResult,
|
type RESTGetAPIChannelThreadMembersResult,
|
||||||
type Snowflake,
|
type Snowflake,
|
||||||
} from 'discord-api-types/v10';
|
} from 'discord-api-types/v10';
|
||||||
@@ -112,16 +113,22 @@ export class ThreadsAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches all members of a thread
|
* Fetches members of a thread
|
||||||
*
|
*
|
||||||
* @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
|
* @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
|
||||||
* @param threadId - The id of the thread to fetch the members from
|
* @param threadId - The id of the thread to fetch the members from
|
||||||
|
* @param query - The query for fetching the members
|
||||||
* @param options - The options for fetching the members
|
* @param options - The options for fetching the members
|
||||||
*/
|
*/
|
||||||
public async getAllMembers(threadId: Snowflake, { auth, signal }: Pick<RequestData, 'auth' | 'signal'> = {}) {
|
public async getMembers(
|
||||||
|
threadId: Snowflake,
|
||||||
|
query: RESTGetAPIChannelThreadMembersQuery = {},
|
||||||
|
{ auth, signal }: Pick<RequestData, 'auth' | 'signal'> = {},
|
||||||
|
) {
|
||||||
return this.rest.get(Routes.threadMembers(threadId), {
|
return this.rest.get(Routes.threadMembers(threadId), {
|
||||||
auth,
|
auth,
|
||||||
signal,
|
signal,
|
||||||
|
query: makeURLSearchParams(query),
|
||||||
}) as Promise<RESTGetAPIChannelThreadMembersResult>;
|
}) as Promise<RESTGetAPIChannelThreadMembersResult>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user