Manages API methods for roles and stores their cache.
Extends
CachedManager<Snowflake, Role, RoleResolvable>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 DataManagerGets the managed role a user created when joining the guild, if any Only ever available for bots
Returns
Name | Type | Optional | Description |
---|---|---|---|
user | UserResolvable | No | The user to access the bot role for |
Compares the positions of two roles.
Returns
Negative number if the first role's position is lower (second role's is higher), positive number if the first's is higher (second's is lower), 0 if equalName | Type | Optional | Description |
---|---|---|---|
role1 | RoleResolvable | No | First role to compare |
role2 | RoleResolvable | No | Second role to compare |
Creates a new role in the guild with given information. The position will silently reset to 1 if an invalid one is provided, or none.
Name | Type | Optional | Description |
---|---|---|---|
options | RoleCreateOptions | Yes | Options for creating the new role |
Deletes a role.
Name | Type | Optional | Description |
---|---|---|---|
role | RoleResolvable | No | The role to delete |
reason | string | Yes | Reason for deleting the role |
Edits a role of the guild.
Name | Type | Optional | Description |
---|---|---|---|
role | RoleResolvable | No | The role to edit |
options | RoleEditOptions | No | The options to provide |
Obtains a role from Discord, or the role cache if they're already available.
Name | Type | Optional | Description |
---|---|---|---|
id | Snowflake | No | The role's id |
options | BaseFetchOptions | Yes | Additional options for this fetch |
Resolves a data entry to a data Object.
Returns
An instance from this ManagerName | Type | Optional | Description |
---|---|---|---|
idOrInstance | Holds | No | The id or instance of something in this Manager |
Resolves a data entry to an instance id.
Returns
Name | Type | Optional | Description |
---|---|---|---|
idOrInstance | K | Holds | No | The id or instance of something in this Manager |
Sets the new position of the role.
Name | Type | Optional | Description |
---|---|---|---|
role | RoleResolvable | No | The role to change the position of |
position | number | No | The new position for the role |
options | SetRolePositionOptions | Yes | Options for setting the position |
Batch-updates the guild's role positions
Name | Type | Optional | Description |
---|---|---|---|
rolePositions | readonly RolePosition[] | No | Role positions to update |