revbot.js
    Preparing search index...

    Class ServerCreate

    Represents the event handler for server creation.

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Handles the server creation event.

      Parameters

      • 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 created 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 Promise<void>

      A promise that resolves when the server is added and members are optionally fetched.