GuildMemberRoleManager
GuildMemberRoleManager ⇐ RoleManager
Represents a manager for handling roles of a guild member.
Kind: global class
Extends: RoleManager
- GuildMemberRoleManager ⇐
RoleManager
- new GuildMemberRoleManager(guildId, member, client)
- instance
- .highest ⇒
- .cache ⇒
Array
- .add(roles, reason) ⇒
Promise.<void>
- .remove(roles, reason) ⇒
Promise.<null>
- .set(roles, reason) ⇒
Promise.<void>
- static
- .transformRole(role) ⇒
Array.<string>
- .transformRole(role) ⇒
new GuildMemberRoleManager(guildId, member, client)
Constructs a new instance of the class.
Param | Type | Description |
---|---|---|
guildId | string | The ID of the guild. |
member | GuildMember | The guild member object. |
client | Client | The client object. |
guildMemberRoleManager.highest ⇒
Get the highest positioned item from the cache collection.
Kind: instance property of GuildMemberRoleManager
Returns: The highest positioned item from the cache collection.
guildMemberRoleManager.cache ⇒ Array
Retrieves the cache of objects, filtered based on the guild ID and member roles.
Kind: instance property of GuildMemberRoleManager
Returns: Array
- An array of objects from the cache that match the guild ID or are included in the member roles.
guildMemberRoleManager.add(roles, reason) ⇒ Promise.<void>
Adds roles to a member in a guild.
Kind: instance method of GuildMemberRoleManager
Returns: Promise.<void>
- A promise that resolves when the roles have been added.
Throws:
RangeError
If an invalid role is specified or if the role cache is empty.
Param | Type | Description |
---|---|---|
roles | Array.<string> | RaidenCol | The roles to add. Can be an array of role IDs or a RaidenCol object. |
reason | string | The reason for adding the roles. |
guildMemberRoleManager.remove(roles, reason) ⇒ Promise.<null>
Removes the specified roles from the member.
Kind: instance method of GuildMemberRoleManager
Returns: Promise.<null>
- A promise that resolves to null when the roles have been removed.
Param | Type | Description |
---|---|---|
roles | Array.<string> | RaidenCol | The roles to remove. Can be an array of role IDs or a RaidenCol object. |
reason | string | The reason for removing the roles. |
guildMemberRoleManager.set(roles, reason) ⇒ Promise.<void>
Sets the roles for a guild member.
Kind: instance method of GuildMemberRoleManager
Returns: Promise.<void>
- - A promise that resolves when the roles are set.
Param | Type | Description |
---|---|---|
roles | Array.<string> | The roles to set for the guild member. |
reason | string | The reason for setting the roles. |
GuildMemberRoleManager.transformRole(role) ⇒ Array.<string>
Transforms the given role into an array of role IDs.
Kind: static method of GuildMemberRoleManager
Returns: Array.<string>
- - An array of role IDs.
Param | Type | Description |
---|---|---|
role | RaidenCol | string | The role to transform. |