GuildMemberManager
Manages guild members with a Collection-like API. Extends LimitedCollection so you can use .get(), .set(), .filter(), etc.
Extends LimitedCollection
Constructor
(guild: Guild)| Param | Type | Description |
|---|---|---|
| guild | Guild |
Properties
: GuildMember | null (readonly)The current bot user as a GuildMember in this guild. Returns null if the bot's member is not cached or client.user is null. Use fetchMe() to load the bot's member when not cached.
Methods
(options?: { limit?: number; after?: string; }): Promise<GuildMember[]>Fetch guild members with pagination. GET /guilds/{id}/members.
| Param | Type | Description |
|---|---|---|
| options? | { limit?: number; after?: string; } | limit (1-1000), after (user ID for pagination) |
(): Promise<GuildMember>Fetch the current bot user as a GuildMember in this guild. Caches the result in guild.members.
(userId: string): Promise<GuildMember>Get a guild member from cache or fetch from the API if not present. Convenience helper to avoid repeating `guild.members.get(userId) ?? (await guild.fetchMember(userId))`.
| Param | Type | Description |
|---|---|---|
| userId | string | Snowflake of the user |
(options: GuildMemberSearchOptions): Promise<GuildMemberSearchPayload>Search guild members. POST /guilds/{id}/members-search.
| Param | Type | Description |
|---|---|---|
| options | GuildMemberSearchOptions | CamelCase search query, filters, and pagination |