Skip to content

GuildMemberRoleManager

GuildMemberRoleManager ⇐ RoleManager

Represents a manager for handling roles of a guild member.

Kind: global class
Extends: RoleManager

new GuildMemberRoleManager(guildId, member, client)

Constructs a new instance of the class.

ParamTypeDescription
guildIdstringThe ID of the guild.
memberGuildMemberThe guild member object.
clientClientThe 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.
ParamTypeDescription
rolesArray.<string> | RaidenColThe roles to add. Can be an array of role IDs or a RaidenCol object.
reasonstringThe 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.

ParamTypeDescription
rolesArray.<string> | RaidenColThe roles to remove. Can be an array of role IDs or a RaidenCol object.
reasonstringThe 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.

ParamTypeDescription
rolesArray.<string>The roles to set for the guild member.
reasonstringThe 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.

ParamTypeDescription
roleRaidenCol | stringThe role to transform.