Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GuildMemberRoleManager

Manages API methods for {@link GuildMember#roles}

Hierarchy

  • GuildMemberRoleManager

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

client: Client

The client that instantiated this Manager

guild: Guild

The Guild belonging to this manager

member: GuildMember

The GuildMember belonging to this manager

Accessors

  • The roles of this member

    Returns Collection<string, Role>

Methods

  • add(roles?: string | string[], reason?: string): Promise<undefined | GuildMember>
  • Adds a role (or multiple roles) from the member.

    example
    // Add a single role to the member
    guildMember.roles.add('391156570408615936')
    example
    // Add multiple roles to the member
    guildMember.roles.add(['391156570408615936', '391156570408615937'])

    Parameters

    • roles: string | string[] = []

      The role Ids to add

    • reason: string = ''

      Reason for adding the roles

    Returns Promise<undefined | GuildMember>

  • remove(roles?: string | string[], reason?: string): Promise<undefined | GuildMember>
  • Removes a role (or multiple roles) from the member.

    example
    // Remove a single role from the member
    guildMember.roles.remove('391156570408615936')
    example
    // Remove multiple roles from the member
    guildMember.roles.remove(['391156570408615936', '391156570408615937'])

    Parameters

    • roles: string | string[] = []

      The role Ids to remove

    • reason: string = ''

      Reason for removing the roles

    Returns Promise<undefined | GuildMember>

  • set(roles?: string | string[], reason?: string): Promise<GuildMember>
  • Sets the roles applied to the member

    example
    // Set the member's roles to a single role
    guildMember.roles.set(['391156570408615936'])
    example
    // Remove all the roles from a member
    guildMember.roles.set([])

    Parameters

    • roles: string | string[] = []

      The role Ids to apply

    • reason: string = ''

      Reason for applying the roles

    Returns Promise<GuildMember>

Generated using TypeDoc version 0.22.16, the 9/16/2022 at 1:09:15 AM