GuildPruneManager
GuildPruneManager ⇐ Base
Section titled “GuildPruneManager ⇐ Base”Represents a manager for pruning members in a guild.
Kind: global class
Extends: Base
- GuildPruneManager ⇐
Base- new GuildPruneManager(guildid, client)
- instance
- .prune([options]) ⇒
boolean - .fetchCount([options]) ⇒
Promise.<number>
- .prune([options]) ⇒
- static
- .transformRoles(roles) ⇒
Array - .transformOptions(o) ⇒
Object
- .transformRoles(roles) ⇒
new GuildPruneManager(guildid, client)
Section titled “new GuildPruneManager(guildid, client)”Constructs a new instance of the class.
| Param | Type | Description |
|---|---|---|
| guildid | string | The ID of the guild. |
| client | Client | The client instance. |
guildPruneManager.prune([options]) ⇒ boolean
Section titled “guildPruneManager.prune([options]) ⇒ boolean”Prunes (removes) inactive members from the guild based on the specified options.
Kind: instance method of GuildPruneManager
Returns: boolean - - True if the prune was successful, false otherwise.
Throws:
Error- If an error occurs during the prune process.
| Param | Type | Description |
|---|---|---|
| [options] | Object | The options for pruning. |
| [options.reason] | string | The reason for the prune. |
guildPruneManager.fetchCount([options]) ⇒ Promise.<number>
Section titled “guildPruneManager.fetchCount([options]) ⇒ Promise.<number>”Fetches the count of pruned members in a guild based on the given options.
Kind: instance method of GuildPruneManager
Returns: Promise.<number> - - A promise that resolves to the prune count.
| Param | Type | Description |
|---|---|---|
| [options] | Object | The options for fetching the prune count. |
GuildPruneManager.transformRoles(roles) ⇒ Array
Section titled “GuildPruneManager.transformRoles(roles) ⇒ Array”Transforms the given roles object into an array of role IDs.
Kind: static method of GuildPruneManager
Returns: Array - - An array of role IDs.
| Param | Type | Description |
|---|---|---|
| roles | Object | Array | The roles object to transform. |
GuildPruneManager.transformOptions(o) ⇒ Object
Section titled “GuildPruneManager.transformOptions(o) ⇒ Object”Transforms the options object for server deletion.
Kind: static method of GuildPruneManager
Returns: Object - - The transformed options object.
Throws:
RangeError- If the days value is not between 1 and 30.
| Param | Type | Description |
|---|---|---|
| o | Object | The options object. |
| o.days | number | The number of days for server deletion. Must be between 1 and 30. |
| o.count | boolean | Whether to include the complete prune count. Default is true. |
| o.roles | Array.<string> | The roles to include in the deletion. Default is undefined. |