Class ServerRole

Server Role

Constructors

  • Construct server role

    Parameters

    • client: Client

      Client

    • serverId: string

      Server ID

    • id: string

      Role ID

    • data: {
          _id: string;
          colour?: null | string;
          hoist?: boolean;
          icon?:
              | null
              | {
                  _id: string;
                  content_type: string;
                  deleted?: null
                  | boolean;
                  filename: string;
                  message_id?: null | string;
                  metadata:
                      | { type: "File" }
                      | { type: "Text" }
                      | {
                          animated?: null | boolean;
                          height: number;
                          thumbhash?: null | number[];
                          type: "Image";
                          width: number;
                      }
                      | { height: number; type: "Video"; width: number }
                      | { type: "Audio" };
                  object_id?: null | string;
                  reported?: null | boolean;
                  server_id?: null | string;
                  size: number;
                  tag: string;
                  user_id?: null | string;
              };
          name: string;
          permissions: { a: number; d: number };
          rank?: number;
      }

      Role data

      • _id: string

        Unique Id

      • Optionalcolour?: null | string

        Colour used for this role

        This can be any valid CSS colour

      • Optionalhoist?: boolean

        Whether this role should be shown separately on the member sidebar

      • Optionalicon?:
            | null
            | {
                _id: string;
                content_type: string;
                deleted?: null
                | boolean;
                filename: string;
                message_id?: null | string;
                metadata:
                    | { type: "File" }
                    | { type: "Text" }
                    | {
                        animated?: null | boolean;
                        height: number;
                        thumbhash?: null | number[];
                        type: "Image";
                        width: number;
                    }
                    | { height: number; type: "Video"; width: number }
                    | { type: "Audio" };
                object_id?: null | string;
                reported?: null | boolean;
                server_id?: null | string;
                size: number;
                tag: string;
                user_id?: null | string;
            }

        Role icon

      • name: string

        Role name

      • permissions: { a: number; d: number }

        Permissions available to this role

        • a: number

          Format: int64

          Allow bit flags

        • d: number

          Format: int64

          Disallow bit flags

      • Optionalrank?: number

        Format: int64

        Ranking of this role

        0
        

    Returns ServerRole

Properties

client: Client
colour?: string
hoist: boolean
icon?: File
id: string
name: string
permissions: { a: bigint; d: bigint }
rank: number
serverId: string

Accessors

Methods