Hierarchy

Constructors

  • Parameters

    • client: Client
    • data: {
          _id: string;
          analytics?: boolean;
          banner?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          categories?: {
              channels: string[];
              id: string;
              title: string;
          }[];
          channels: string[];
          default_permissions: number;
          description?: string;
          discoverable?: boolean;
          flags?: number;
          icon?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          name: string;
          nsfw?: boolean;
          owner: string;
          roles?: {
              [key: string]: components["schemas"]["Role"];
          };
          system_messages?: {
              user_banned?: string;
              user_joined?: string;
              user_kicked?: string;
              user_left?: string;
          };
      }
      • _id: string

        Description

        Unique Id

      • Optional analytics?: boolean

        Description

        Whether to enable analytics

      • Optional banner?: {
            _id: string;
            content_type: string;
            deleted?: boolean;
            filename: string;
            message_id?: string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: string;
            reported?: boolean;
            server_id?: string;
            size: number;
            tag: string;
            user_id?: string;
        }

        Description

        Banner attachment

        • _id: string

          Description

          Unique Id

        • content_type: string

          Description

          Raw content type of this file

        • Optional deleted?: boolean

          Description

          Whether this file was deleted

        • filename: string

          Description

          Original filename

        • Optional message_id?: string
        • metadata: {
              type: "File";
          } | {
              type: "Text";
          } | {
              height: number;
              type: "Image";
              width: number;
          } | {
              height: number;
              type: "Video";
              width: number;
          } | {
              type: "Audio";
          }

          Description

          Parsed metadata of this file

        • Optional object_id?: string

          Description

          Id of the object this file is associated with

        • Optional reported?: boolean

          Description

          Whether this file was reported

        • Optional server_id?: string
        • size: number

          Format: int

          Description

          Size of this file (in bytes)

        • tag: string

          Description

          Tag / bucket this file was uploaded to

        • Optional user_id?: string
      • Optional categories?: {
            channels: string[];
            id: string;
            title: string;
        }[]

        Description

        Categories for this server

      • channels: string[]

        Description

        Channels within this server

      • default_permissions: number

        Format: int64

        Description

        Default set of server and channel permissions

      • Optional description?: string

        Description

        Description for the server

      • Optional discoverable?: boolean

        Description

        Whether this server should be publicly discoverable

      • Optional flags?: number

        Format: int32

        Description

        Bitfield of server flags

      • Optional icon?: {
            _id: string;
            content_type: string;
            deleted?: boolean;
            filename: string;
            message_id?: string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: string;
            reported?: boolean;
            server_id?: string;
            size: number;
            tag: string;
            user_id?: string;
        }

        Description

        Icon attachment

        • _id: string

          Description

          Unique Id

        • content_type: string

          Description

          Raw content type of this file

        • Optional deleted?: boolean

          Description

          Whether this file was deleted

        • filename: string

          Description

          Original filename

        • Optional message_id?: string
        • metadata: {
              type: "File";
          } | {
              type: "Text";
          } | {
              height: number;
              type: "Image";
              width: number;
          } | {
              height: number;
              type: "Video";
              width: number;
          } | {
              type: "Audio";
          }

          Description

          Parsed metadata of this file

        • Optional object_id?: string

          Description

          Id of the object this file is associated with

        • Optional reported?: boolean

          Description

          Whether this file was reported

        • Optional server_id?: string
        • size: number

          Format: int

          Description

          Size of this file (in bytes)

        • tag: string

          Description

          Tag / bucket this file was uploaded to

        • Optional user_id?: string
      • name: string

        Description

        Name of the server

      • Optional nsfw?: boolean

        Description

        Whether this server is flagged as not safe for work

      • owner: string

        Description

        User id of the owner

      • Optional roles?: {
            [key: string]: components["schemas"]["Role"];
        }

        Description

        Roles for this server

        • [key: string]: components["schemas"]["Role"]
      • Optional system_messages?: {
            user_banned?: string;
            user_joined?: string;
            user_kicked?: string;
            user_left?: string;
        }

        Description

        Configuration for sending system event messages

        • Optional user_banned?: string

          Description

          ID of channel to send user banned messages in

        • Optional user_joined?: string

          Description

          ID of channel to send user join messages in

        • Optional user_kicked?: string

          Description

          ID of channel to send user kicked messages in

        • Optional user_left?: string

          Description

          ID of channel to send user left messages in

    Returns Server

Properties

client: Client
deleted: boolean = false
members: MemberManager

Accessors

  • get orderedChannels(): Category[]
  • Get an array of ordered categories with their respective channels. Uncategorized channels are returned in the id="default" category.

    Returns Category[]

  • get systemMessages(): {
        user_banned?: string;
        user_joined?: string;
        user_kicked?: string;
        user_left?: string;
    }
  • Returns {
        user_banned?: string;
        user_joined?: string;
        user_kicked?: string;
        user_left?: string;
    }

    • Optional user_banned?: string

      Description

      ID of channel to send user banned messages in

    • Optional user_joined?: string

      Description

      ID of channel to send user join messages in

    • Optional user_kicked?: string

      Description

      ID of channel to send user kicked messages in

    • Optional user_left?: string

      Description

      ID of channel to send user left messages in

Methods

  • Edit this server.

    Parameters

    • data: {
          analytics?: boolean;
          banner?: string;
          categories?: {
              channels: string[];
              id: string;
              title: string;
          }[];
          description?: string;
          discoverable?: boolean;
          flags?: number;
          icon?: string;
          name?: string;
          remove?: ("Description" | "Icon" | "Categories" | "SystemMessages" | "Banner")[];
          system_messages?: {
              user_banned?: string;
              user_joined?: string;
              user_kicked?: string;
              user_left?: string;
          };
      }
      • Optional analytics?: boolean

        Description

        Whether analytics should be collected for this server

        Must be enabled in order to show up on Revolt Discover.

      • Optional banner?: string

        Description

        Attachment Id for banner

      • Optional categories?: {
            channels: string[];
            id: string;
            title: string;
        }[]

        Description

        Category structure for server

      • Optional description?: string

        Description

        Server description

      • Optional discoverable?: boolean

        Description

        Whether this server is public and should show up on Revolt Discover

      • Optional flags?: number

        Format: int32

        Description

        Bitfield of server flags

      • Optional icon?: string

        Description

        Attachment Id for icon

      • Optional name?: string

        Description

        Server name

      • Optional remove?: ("Description" | "Icon" | "Categories" | "SystemMessages" | "Banner")[]

        Description

        Fields to remove from server object

      • Optional system_messages?: {
            user_banned?: string;
            user_joined?: string;
            user_kicked?: string;
            user_left?: string;
        }

        Description

        System message configuration

        • Optional user_banned?: string

          Description

          ID of channel to send user banned messages in

        • Optional user_joined?: string

          Description

          ID of channel to send user join messages in

        • Optional user_kicked?: string

          Description

          ID of channel to send user kicked messages in

        • Optional user_left?: string

          Description

          ID of channel to send user left messages in

    Returns Promise<void>

  • Fetch bans for this server.

    Returns Promise<{
        reason: string;
        userAvatar: Attachment;
        userID: string;
        userUsername: string;
    }[]>

  • Runs all of the callbacks for this emitter. (meant to run when an update occurs)

    Parameters

    • Optional updated: any[]

      The objects that caused this update.

    Returns void

  • Leave (or delete if owner) this server.

    Parameters

    • Optional silent: boolean

    Returns Promise<void>

  • Set permissions for a role id or 'default'.

    Parameters

    • id: "default"
    • permissions: number

    Returns Promise<void>

  • Type Parameters

    • T extends string

    Parameters

    • id: T extends "default" ? never : T
    • permissions: {
          allow: number;
          deny: number;
      }
      • allow: number

        Format: uint64

        Description

        Allow bit flags

      • deny: number

        Format: uint64

        Description

        Disallow bit flags

    Returns Promise<void>

  • Update this object with new API data.

    Parameters

    • data: Partial<{
          _id: string;
          analytics?: boolean;
          banner?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          categories?: {
              channels: string[];
              id: string;
              title: string;
          }[];
          channels: string[];
          default_permissions: number;
          description?: string;
          discoverable?: boolean;
          flags?: number;
          icon?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          name: string;
          nsfw?: boolean;
          owner: string;
          roles?: {
              [key: string]: components["schemas"]["Role"];
          };
          system_messages?: {
              user_banned?: string;
              user_joined?: string;
              user_kicked?: string;
              user_left?: string;
          };
      }>

    Returns Server