Represents a Guilded role in a server

Hierarchy

  • Base<{
        id: number;
        serverId: string;
    }, number>
    • Role

Constructors

Properties

_createdAt: number

The date this role was created

_updatedAt: null | number

The date this role was last updated, if it was

botUserId: null | string

The bot user ID this role has been defined for.

client: Client
colors: number[]

The colors belonging to this role. If a solid color role, then there will be just one color in this array. Otherwise, the first color is the solid color, and second is a gradient.

icon: null | string

The URL of the role's icon

id: number

Identifier of this structrure

isBase: boolean

Whether this is the default role for members

isDisplayedSeparately: boolean

Whether this role is hoisted or not

isMentionable: boolean

Whether this role is mentionable

isSelfAssignable: boolean

Whether this role is self assignable by members

name: string

The name of this role

permissions: string[]

The permissions this role has

priority: null | number

The position of this role on the hierarchy

raw: {
    id: number;
    serverId: string;
}

Bare data of this structure

Type declaration

  • id: number
  • serverId: string
serverId: string

The ID of the server this role belongs to

Accessors

Methods

  • Assign role to member

    Parameters

    • memberId: string

      The ID of the member to assign the role to

    Returns Promise<void>

    A Promise that resolves when the role has been assigned to the member

  • Award XP to a role

    Parameters

    • amount: number

      The amount of XP to award to the role

    Returns Promise<void>

    A Promise that resolves to the new total XP of the role

  • Remove role from member

    Parameters

    • memberId: string

      The ID of the member to remove the role from

    Returns Promise<void>

    A Promise that resolves when the role has been removed from the member

Generated using TypeDoc