Hierarchy

  • BaseManager<Server>
    • ServerManager

Constructors

Properties

[toStringTag]: string
client: Client
size: number

Returns

the number of elements in the Map.

[species]: MapConstructor

Methods

  • Returns an iterable of entries in the map.

    Returns IterableIterator<[string, Server]>

  • Returns void

  • Parameters

    • 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

  • Returns an iterable of key, value pairs for every entry in the map.

    Returns IterableIterator<[string, Server]>

  • Parameters

    • id: string
    • Optional 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

    • Optional channels: ({
          _id: string;
          channel_type: "SavedMessages";
          user: string;
      } | {
          _id: string;
          active: boolean;
          channel_type: "DirectMessage";
          last_message_id?: string;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "Group";
          description?: string;
          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;
          };
          last_message_id?: string;
          name: string;
          nsfw?: boolean;
          owner: string;
          permissions?: number;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "TextChannel";
          default_permissions?: {
              a: number;
              d: number;
          };
          description?: string;
          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;
          };
          last_message_id?: string;
          name: string;
          nsfw?: boolean;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      } | {
          _id: string;
          channel_type: "VoiceChannel";
          default_permissions?: {
              a: number;
              d: number;
          };
          description?: string;
          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;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      })[]

    Returns Promise<Server>

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

    Parameters

    • Optional updated: Server[]

      The objects that caused this update.

    Returns void

  • Executes a provided function once per each key/value pair in the Map, in insertion order.

    Parameters

    • callbackfn: ((value: Server, key: string, map: Map<string, Server>) => void)
        • (value: Server, key: string, map: Map<string, Server>): void
        • Parameters

          Returns void

    • Optional thisArg: any

    Returns void

  • Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

    Returns

    Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

    Parameters

    • key: string

    Returns Server

  • Returns

    boolean indicating whether an element with the specified key exists or not.

    Parameters

    • key: string

    Returns boolean

  • Returns an iterable of keys in the map

    Returns IterableIterator<string>

  • Returns an iterable of values in the map

    Returns IterableIterator<Server>