Represents a Guild Category.

Hierarchy (view full)

  • Base<number>
    • Category

Constructors

  • Parameters

    • data: {
          createdAt: string;
          groupId: string;
          id: number;
          name: string;
          priority?: number;
          serverId: string;
          updatedAt?: string;
      }
      • createdAt: string

        Created at Format: date-time

        The ISO 8601 timestamp that the category was created at

      • groupId: string

        Group ID

        The ID of the group

      • id: number

        The ID of the category

      • name: string

        Name of the category

      • Optionalpriority?: number

        Priority

        The priority of the category will determine its position relative to other categories in the group. The higher the value, the higher up it will be displayed in the UI. Returned values can be null, in which case sorting will be done by createdAt in descending order. Due to legacy issues, sending a null value is not possible

      • serverId: string

        Server ID

        The ID of the server

      • OptionalupdatedAt?: string

        Updated at Format: date-time

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

    • client: Client

    Returns Category

Properties

client: Client

App's client.

createdAt: Date

Date of the creation of the category.

groupID: string

The ID of the group

guildID: string

The ID of the server

id: number

Item ID

name: string

Name of the category (min length 1; max length 100)

updatedAt: null | Date

The date of the last edition of the category.

Methods

  • Create a channel category permission assigned to a user or role.

    Parameters

    • targetID: string | number

      ID of the user (string) or role (number) to assign the permission to

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

      Permission options

      Warning: targetID must have the correct type (number=role, string=user).

      • permissions: Record<string, never>

        A JSON object of Enums/Permissions with true, false or null values. Permission list can only contain relevant permissions for the channel type

    Returns Promise<Permission>

  • Delete a category permission.

    Parameters

    • targetID: string | number

      ID of the user or role to delete the permission from

    Returns Promise<void>

  • Update a guild category.

    Parameters

    • options: {
          name?: string;
          priority?: number;
      }

      Edit options.

      • Optionalname?: string

        Name of the category

      • Optionalpriority?: number

        Priority

        The priority of the category will determine its position relative to other categories in the group. The higher the value, the higher up it will be displayed in the UI. Returned values can be null, in which case sorting will be done by createdAt in descending order. Due to legacy issues, sending a null value is not possible

    Returns Promise<Category>

  • Update a category permission.

    Warning: targetID must have the correct type (number=role, string=user).

    Parameters

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

        A JSON object of Enums/Permissions with true, false or null values. Permission list can only contain relevant permissions for the channel type

    Returns Promise<Permission>

  • Get permission coming from a category.

    Parameters

    • targetID: string | number

      ID of the user (string) or role (number) to get the permission for

      Warning: targetID must have the correct type (number=role, string=user).

    Returns Promise<Permission>