Skip to content

GuildPruneManager

GuildPruneManager ⇐ Base

Represents a manager for pruning members in a guild.

Kind: global class
Extends: Base

new GuildPruneManager(guildid, client)

Constructs a new instance of the class.

ParamTypeDescription
guildidstringThe ID of the guild.
clientClientThe client instance.

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.
ParamTypeDescription
[options]ObjectThe options for pruning.
[options.reason]stringThe reason for the prune.

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.

ParamTypeDescription
[options]ObjectThe options for fetching the prune count.

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.

ParamTypeDescription
rolesObject | ArrayThe roles object to transform.

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.
ParamTypeDescription
oObjectThe options object.
o.daysnumberThe number of days for server deletion. Must be between 1 and 30.
o.countbooleanWhether to include the complete prune count. Default is true.
o.rolesArray.<string>The roles to include in the deletion. Default is undefined.