class GuildMemberRoleManager
extends
DataManager<Snowflake, Role, RoleResolvable>export class GuildMemberRoleManager extends DataManager<Snowflake, Role, RoleResolvable>
Manages API methods for roles of a GuildMember and stores their cache.
The managed role this member created when joining the guild, if any Only ever available on bots
readonlyCollection<Snowflake, Role> cache :
The roles of this member
readonlyClient client :
The client that instantiated this Manager
Guild guild :
The Guild this manager belongs to
readonlyRole highest :
The role of the member with the highest position
The role of the member used to hoist them in a separate category in the users list
readonlyConstructable<Role> holds :
The data structure belonging to this manager.
Inherited from: DataManager
GuildMember member :
The GuildMember this manager belongs to
addroleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection<Snowflake, Role>reason?: string) : Promise<GuildMember> (
roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection<Snowflake, Role>
reason?: string
Adds a role (or multiple roles) to the member.
removeroleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection<Snowflake, Role>reason?: string) : Promise<GuildMember> (
roleOrRoles: RoleResolvable | readonly RoleResolvable[] | Collection<Snowflake, Role>
reason?: string
Removes a role (or multiple roles) from the member.
Overload 1
Overload 2
Overload 1
Overload 2
setroles: readonly RoleResolvable[] | Collection<Snowflake, Role>reason?: string) : Promise<GuildMember> (
roles: readonly RoleResolvable[] | Collection<Snowflake, Role>
reason?: string
Sets the roles applied to the member.
Examples:
// Set the member's roles to a single role
guildMember.roles.set(['391156570408615936'])
.then(console.log)
.catch(console.error);
// Remove all the roles from a member
guildMember.roles.set([])
.then(member => console.log(`Member roles is now of ${member.roles.cache.size} size`))
.catch(console.error);
valueOfCollection<Snowflake, Role> () :
Inherited from: DataManager