Represents a Guild Role.

Hierarchy (view full)

Constructors

  • Parameters

    • data: {
          botUserId?: string;
          colors?: number[];
          createdAt: string;
          icon?: string;
          id: number;
          isBase: boolean;
          isDisplayedSeparately: boolean;
          isMentionable: boolean;
          isSelfAssignable: boolean;
          name: string;
          permissions: string[];
          priority?: number;
          serverId: string;
          updatedAt?: string;
      }
      • OptionalbotUserId?: string

        Bot user ID Format: user-id

        The bot user ID this role has been defined for. Roles with this populated can only be deleted by kicking the bot

      • Optionalcolors?: number[]

        An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient

      • createdAt: string

        Created at Format: date-time

        The ISO 8601 timestamp that the role was created at

      • Optionalicon?: string

        Role icon URL Format: media-uri

        The URL of the role icon

      • id: number

        Role ID

        The ID of the role

      • isBase: boolean

        Is Base

        The default role users are given when joining the server. Base roles are tied directly to the server and cannot be created or deleted

        false
        
      • isDisplayedSeparately: boolean

        Display Separately

        If set, the role will be displayed separately in the channel member list

        false
        
      • isMentionable: boolean

        Mentionable

        If set, this role can be mentioned

        false
        
      • isSelfAssignable: boolean

        Self Assignable

        If set, this roll will be self assigned

        false
        
      • name: string

        Role name

        The role's name

      • permissions: string[]

        Permissions must be a collection of valid permissions as defined in the Enums/Permissions section

      • Optionalpriority?: number

        Priority

        The priority the role will be in relation to other roles in the server. The higher the value, the more precedence the role has over lower priority roles, and the higher up it will be displayed in the UI. Values can be zero or negative!

      • serverId: string

        Server ID

        The ID of the server

      • OptionalupdatedAt?: string

        Updated at Format: date-time

        The ISO 8601 timestamp that the role was updated at, if relevant

    • client: Client

    Returns Role

Properties

appUserID: null | string

The app user ID this role has been defined for. Roles with this populated can only be deleted by kicking the app

client: Client

App's client.

colors: null | number[]

An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient (min items 0; max items 2)

createdAt: Date

Date of when the role was created.

editedTimestamp: null | Date

Date of when role was last edited.

guildID: string

ID of the guild

iconURL: null | string

The URL of the role icon

id: number

Item ID

isBase: boolean

The default role users are given when joining the server. Base roles are tied directly to the server and cannot be created or deleted

isDisplayedSeparately: boolean

If set, the role will be displayed separately in the channel member

isMentionable: boolean

If set, this role can be mentioned

isSelfAssignable: boolean

If set, this roll will be self-assigned

name: string

The role's name

permissions: Permissions[]

Array of permission (Permissions enum)

position: null | number

The position the role will be in relation to the roles in the server

Methods

  • Edit the role permission

    Parameters

    • options: {
          permissions: Record<string, never>;
      }
      • permissions: Record<string, never>

        A JSON object of Enums/Permissions with true or false values.

    Returns Promise<Role>