revbot.js
    Preparing search index...

    Class Server

    Represents a server (guild) in the client.

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new Server instance.

      Parameters

      • client: client

        The client instance.

      • data: {
            _id: string;
            analytics?: boolean;
            banner?:
                | null
                | {
                    _id: string;
                    content_type: string;
                    deleted?: null
                    | boolean;
                    filename: string;
                    message_id?: null | string;
                    metadata:
                        | { type: "File" }
                        | { type: "Text" }
                        | { height: 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;
                };
            categories?: null
            | { channels: string[]; id: string; title: string }[];
            channels: string[];
            default_permissions: number;
            description?: null | string;
            discoverable?: boolean;
            flags?: number;
            icon?:
                | null
                | {
                    _id: string;
                    content_type: string;
                    deleted?: null
                    | boolean;
                    filename: string;
                    message_id?: null | string;
                    metadata:
                        | { type: "File" }
                        | { type: "Text" }
                        | { height: 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;
            nsfw?: boolean;
            owner: string;
            roles?: {
                [key: string]: {
                    colour?: null
                    | string;
                    hoist?: boolean;
                    name: string;
                    permissions: { a: number; d: number };
                    rank?: number;
                };
            };
            system_messages?: | null
            | {
                user_banned?: null
                | string;
                user_joined?: null | string;
                user_kicked?: null | string;
                user_left?: null | string;
            };
        }

        The raw data for the server from the API.

        • _id: string

          Unique Id

        • Optionalanalytics?: boolean

          Whether to enable analytics

        • Optionalbanner?:
              | null
              | {
                  _id: string;
                  content_type: string;
                  deleted?: null
                  | boolean;
                  filename: string;
                  message_id?: null | string;
                  metadata:
                      | { type: "File" }
                      | { type: "Text" }
                      | { height: 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;
              }

          Banner attachment

        • Optionalcategories?: null | { channels: string[]; id: string; title: string }[]

          Categories for this server

        • channels: string[]

          Channels within this server

        • default_permissions: number

          Format: int64

          Default set of server and channel permissions

        • Optionaldescription?: null | string

          Description for the server

        • Optionaldiscoverable?: boolean

          Whether this server should be publicly discoverable

        • Optionalflags?: number

          Format: uint32

          Bitfield of server flags

        • Optionalicon?:
              | null
              | {
                  _id: string;
                  content_type: string;
                  deleted?: null
                  | boolean;
                  filename: string;
                  message_id?: null | string;
                  metadata:
                      | { type: "File" }
                      | { type: "Text" }
                      | { height: 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;
              }

          Icon attachment

        • name: string

          Name of the server

        • Optionalnsfw?: boolean

          Whether this server is flagged as not safe for work

        • owner: string

          User id of the owner

        • Optionalroles?: {
              [key: string]: {
                  colour?: null | string;
                  hoist?: boolean;
                  name: string;
                  permissions: { a: number; d: number };
                  rank?: number;
              };
          }

          Roles for this server

        • Optionalsystem_messages?:
              | null
              | {
                  user_banned?: null
                  | string;
                  user_joined?: null | string;
                  user_kicked?: null | string;
                  user_left?: null | string;
              }

          Configuration for sending system event messages

      Returns Server

    Properties

    analytics: boolean = false

    Whether analytics are enabled for the server.

    banner: null | Attachment = null

    The banner of the server, or null if none is set.

    categories: Map<string, Category> = ...

    The categories in the server.

    channels: ServerChannelManager = ...

    Manages the channels of the server.

    client: client

    The client instance.

    description: null | string = null

    The description of the server, or null if none is set.

    discoverable: boolean = false

    Whether the server is discoverable.

    emojis: Map<string, Emoji> = ...

    the emojies associated with the server

    icon: null | Attachment = null

    The icon of the server, or null if none is set.

    id: string

    The unique identifier for the object.

    members: ServerMemberManager = ...

    Manages the members of the server.

    name: string

    The name of the server.

    nsfw: boolean = false

    Whether the server is marked as NSFW (Not Safe For Work).

    ownerId: string

    The ID of the user who owns the server.

    permissions: ServerPermissions

    The default permissions for the server.

    roles: RoleManager = ...

    Manages the roles of the server.

    Accessors

    Methods

    • Updates the object with new data and returns a clone of the object.

      Parameters

      • data: PartialObject

        The data to update the object with.

      • Optionalclear: string[]

        Fields to clear in the object.

      Returns this

      A clone of the updated object.