Manages API methods for GuildMembers and stores their cache.
The cache of items for this manager.
Inherited from DataManagerThe client that instantiated this Manager
Inherited from BaseManagerThe data structure belonging to this manager.
Inherited from DataManagerAdds a user to the guild using OAuth2. This method requires the PermissionFlagsBits.CreateInstantInvite permission.
Name | Type | Optional | Description |
---|---|---|---|
user | UserResolvable | No | The user to add to the guild |
options | AddGuildMemberOptions & { fetchWhenExisting: false } | No | Options for adding the user to the guild |
Adds a role to a member.
Name | Type | Optional | Description |
---|---|---|---|
options | AddOrRemoveGuildMemberRoleOptions | No | Options for adding the role |
Bans a user from the guild.
Returns
Result object will be resolved as specifically as possible. If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot be resolved, the user id will be the result. Internally calls the GuildBanManager#create method.Example
Name | Type | Optional | Description |
---|---|---|---|
user | UserResolvable | No | The user to ban |
options | BanOptions | Yes | Options for the ban |
Bulk ban users from a guild, and optionally delete previous messages sent by them.
Returns
Returns an object withbannedUsers
key containing the IDs of the banned users and the key failedUsers
with the IDs that could not be banned or were already banned. Internally calls the GuildBanManager#bulkCreate method.Example
Name | Type | Optional | Description |
---|---|---|---|
users | ReadonlyCollection<Snowflake, UserResolvable> | readonly UserResolvable[] | No | The users to ban |
options | BanOptions | Yes | The options for bulk banning users |
Edits a member of the guild. The user must be a member of the guild
Name | Type | Optional | Description |
---|---|---|---|
user | UserResolvable | No | The member to edit |
options | GuildMemberEditOptions | No | The options to provide |
Fetches member(s) from a guild.
Example
Example
Example
Example
Example
Example
Name | Type | Optional | Description |
---|---|---|---|
options | UserResolvable | FetchMemberOptions | (FetchMembersOptions & { user: UserResolvable }) | No | Options for fetching member(s). Omitting the parameter or providing undefined will fetch all members. |
Fetches the client user as a GuildMember of the guild.
Name | Type | Optional | Description |
---|---|---|---|
options | BaseFetchOptions | Yes | The options for fetching the member |
Kicks a user from the guild. The user must be a member of the guild
Returns
Result object will be resolved as specifically as possible. If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot be resolved, the user's id will be the result.Example
Name | Type | Optional | Description |
---|---|---|---|
user | UserResolvable | No | The member to kick |
reason | string | Yes | Reason for kicking |
Lists up to 1000 members of the guild.
Name | Type | Optional | Description |
---|---|---|---|
options | GuildListMembersOptions | Yes | Options for listing members |
Prunes members from the guild based on how long they have been inactive.
Returns
The number of members that were/will be kickedExample
Example
Example
Name | Type | Optional | Description |
---|---|---|---|
options | GuildPruneMembersOptions & { dry?: false; count: false } | No | Options for pruning |
Removes a role from a member.
Name | Type | Optional | Description |
---|---|---|---|
options | AddOrRemoveGuildMemberRoleOptions | No | Options for removing the role |
Resolves a GuildMemberResolvable to a object.
Name | Type | Optional | Description |
---|---|---|---|
member | GuildMemberResolvable | No | The user that is part of the guild |
Resolves a GuildMemberResolvable to a member id.
Name | Type | Optional | Description |
---|---|---|---|
member | GuildMemberResolvable | No | The user that is part of the guild |
Searches for members in the guild based on a query.
Name | Type | Optional | Description |
---|---|---|---|
options | GuildSearchMembersOptions | No | Options for searching members |
Unbans a user from the guild. Internally calls the remove method.
Returns
The user that was unbannedExample
Name | Type | Optional | Description |
---|---|---|---|
user | UserResolvable | No | The user to unban |
reason | string | Yes | Reason for unbanning user |