Manages API methods for guild bans and stores their cache.
Extends
CachedManager<Snowflake, GuildBan, GuildBanResolvable>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 DataManagerBulk 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.Example
| Name | Type | Optional | Description |
|---|---|---|---|
| users | ReadonlyCollection<Snowflake, UserResolvable> | readonly UserResolvable[] | No | The users to ban |
| options | BulkBanOptions | Yes | The options for bulk banning users |
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.Example
| Name | Type | Optional | Description |
|---|---|---|---|
| user | UserResolvable | No | The user to ban |
| options | BanOptions | Yes | Options for the ban |
Fetches ban(s) from Discord.
Example
Example
Example
Example
Example
| Name | Type | Optional | Description |
|---|---|---|---|
| options | UserResolvable | FetchBanOptions | No | Options for fetching guild ban(s) |
Unbans a user from the guild.
Example
| Name | Type | Optional | Description |
|---|---|---|---|
| user | UserResolvable | No | The user to unban |
| reason | string | Yes | Reason for unbanning user |
Resolves a GuildBanResolvable to a GuildBan object.
| Name | Type | Optional | Description |
|---|---|---|---|
| ban | GuildBanResolvable | No | The ban that is in the guild |
Resolves a data entry to an instance id.
Returns
| Name | Type | Optional | Description |
|---|---|---|---|
| idOrInstance | Key | Holds | No | The id or instance of something in this Manager |