Hierarchy

Constructors

Properties

[toStringTag]: string
channel: Channel
client: Client
size: number

Returns

the number of elements in the Map.

[species]: MapConstructor

Accessors

Methods

  • Returns an iterable of entries in the map.

    Returns IterableIterator<[string, BaseMessage]>

  • Returns void

  • Parameters

    • data: {
          _id: string;
          attachments?: {
              _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;
          }[];
          author: string;
          channel: string;
          content?: string;
          edited?: string;
          embeds?: ({
              colour?: string;
              description?: string;
              icon_url?: string;
              image?: {
                  height: number;
                  size: "Large" | "Preview";
                  url: string;
                  width: number;
              };
              original_url?: string;
              site_name?: string;
              special?: {
                  type: "None";
              } | {
                  type: "GIF";
              } | {
                  id: string;
                  timestamp?: string;
                  type: "YouTube";
              } | {
                  content_type: "Channel";
                  id: string;
                  type: "Lightspeed";
              } | {
                  content_type: "Video" | "Channel" | "Clip";
                  id: string;
                  type: "Twitch";
              } | {
                  content_type: string;
                  id: string;
                  type: "Spotify";
              } | {
                  type: "Soundcloud";
              } | {
                  content_type: "Album" | "Track";
                  id: string;
                  type: "Bandcamp";
              } | {
                  id: string;
                  type: "Streamable";
              };
              title?: string;
              type: "Website";
              url?: string;
              video?: {
                  height: number;
                  url: string;
                  width: number;
              };
          } | {
              height: number;
              size: "Large" | "Preview";
              type: "Image";
              url: string;
              width: number;
          } | {
              height: number;
              type: "Video";
              url: string;
              width: number;
          } | {
              colour?: string;
              description?: string;
              icon_url?: string;
              media?: {
                  _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;
              };
              title?: string;
              type: "Text";
              url?: string;
          } | {
              type: "None";
          })[];
          interactions?: {
              reactions?: string[];
              restrict_reactions?: boolean;
          };
          masquerade?: {
              avatar?: string;
              colour?: string;
              name?: string;
          };
          mentions?: string[];
          nonce?: string;
          reactions?: {
              [key: string]: string[];
          };
          replies?: string[];
          system?: {
              content: string;
              type: "text";
          } | {
              by: string;
              id: string;
              type: "user_added";
          } | {
              by: string;
              id: string;
              type: "user_remove";
          } | {
              id: string;
              type: "user_joined";
          } | {
              id: string;
              type: "user_left";
          } | {
              id: string;
              type: "user_kicked";
          } | {
              id: string;
              type: "user_banned";
          } | {
              by: string;
              name: string;
              type: "channel_renamed";
          } | {
              by: string;
              type: "channel_description_changed";
          } | {
              by: string;
              type: "channel_icon_changed";
          } | {
              from: string;
              to: string;
              type: "channel_ownership_changed";
          };
          webhook?: {
              avatar?: string;
              name: string;
          };
      }
      • _id: string

        Description

        Unique Id

      • Optional attachments?: {
            _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

        Array of attachments

      • author: string

        Description

        Id of the user or webhook that sent this message

      • channel: string

        Description

        Id of the channel this message was sent in

      • Optional content?: string

        Description

        Message content

      • Optional edited?: string

        Description

        Time at which this message was last edited

      • Optional embeds?: ({
            colour?: string;
            description?: string;
            icon_url?: string;
            image?: {
                height: number;
                size: "Large" | "Preview";
                url: string;
                width: number;
            };
            original_url?: string;
            site_name?: string;
            special?: {
                type: "None";
            } | {
                type: "GIF";
            } | {
                id: string;
                timestamp?: string;
                type: "YouTube";
            } | {
                content_type: "Channel";
                id: string;
                type: "Lightspeed";
            } | {
                content_type: "Video" | "Channel" | "Clip";
                id: string;
                type: "Twitch";
            } | {
                content_type: string;
                id: string;
                type: "Spotify";
            } | {
                type: "Soundcloud";
            } | {
                content_type: "Album" | "Track";
                id: string;
                type: "Bandcamp";
            } | {
                id: string;
                type: "Streamable";
            };
            title?: string;
            type: "Website";
            url?: string;
            video?: {
                height: number;
                url: string;
                width: number;
            };
        } | {
            height: number;
            size: "Large" | "Preview";
            type: "Image";
            url: string;
            width: number;
        } | {
            height: number;
            type: "Video";
            url: string;
            width: number;
        } | {
            colour?: string;
            description?: string;
            icon_url?: string;
            media?: {
                _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;
            };
            title?: string;
            type: "Text";
            url?: string;
        } | {
            type: "None";
        })[]

        Description

        Attached embeds to this message

      • Optional interactions?: {
            reactions?: string[];
            restrict_reactions?: boolean;
        }

        Description

        Information about how this message should be interacted with

        • Optional reactions?: string[]

          Description

          Reactions which should always appear and be distinct

        • Optional restrict_reactions?: boolean

          Description

          Whether reactions should be restricted to the given list

          Can only be set to true if reactions list is of at least length 1

      • Optional masquerade?: {
            avatar?: string;
            colour?: string;
            name?: string;
        }

        Description

        Name and / or avatar overrides for this message

        • Optional avatar?: string

          Description

          Replace the avatar shown on this message (URL to image file)

        • Optional colour?: string

          Description

          Replace the display role colour shown on this message

          Must have ManageRole permission to use

        • Optional name?: string

          Description

          Replace the display name shown on this message

      • Optional mentions?: string[]

        Description

        Array of user ids mentioned in this message

      • Optional nonce?: string

        Description

        Unique value generated by client sending this message

      • Optional reactions?: {
            [key: string]: string[];
        }

        Description

        Hashmap of emoji IDs to array of user IDs

        • [key: string]: string[]
      • Optional replies?: string[]

        Description

        Array of message ids this message is replying to

      • Optional system?: {
            content: string;
            type: "text";
        } | {
            by: string;
            id: string;
            type: "user_added";
        } | {
            by: string;
            id: string;
            type: "user_remove";
        } | {
            id: string;
            type: "user_joined";
        } | {
            id: string;
            type: "user_left";
        } | {
            id: string;
            type: "user_kicked";
        } | {
            id: string;
            type: "user_banned";
        } | {
            by: string;
            name: string;
            type: "channel_renamed";
        } | {
            by: string;
            type: "channel_description_changed";
        } | {
            by: string;
            type: "channel_icon_changed";
        } | {
            from: string;
            to: string;
            type: "channel_ownership_changed";
        }

        Description

        System message

      • Optional webhook?: {
            avatar?: string;
            name: string;
        }

        Description

        The webhook that sent this message

        • Optional avatar?: string
        • name: string

    Returns BaseMessage

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

    Returns IterableIterator<[string, BaseMessage]>

  • Parameters

    • Optional params: {
          after?: string;
          before?: string;
          include_users?: boolean;
          limit?: number;
          nearby?: string;
          sort?: "Relevance" | "Latest" | "Oldest";
      }
      • Optional after?: string

        Message id after which messages should be fetched

      • Optional before?: string

        Message id before which messages should be fetched

      • Optional include_users?: boolean

        Whether to include user (and member, if server channel) objects

      • Optional limit?: number

        Maximum number of messages to fetch

        For fetching nearby messages, this is (limit + 1).

      • Optional nearby?: string

        Message id to search around

        Specifying 'nearby' ignores 'before', 'after' and 'sort'. It will also take half of limit rounded as the limits to each side. It also fetches the message ID specified.

      • Optional sort?: "Relevance" | "Latest" | "Oldest"

        Message sort direction

    Returns Promise<BaseMessage[]>

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

    Parameters

    • Optional updated: BaseMessage[]

      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

    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 BaseMessage

  • 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>

  • Parameters

    • params: {
          after?: string;
          before?: string;
          include_users?: boolean;
          limit?: number;
          query: string;
          sort?: "Relevance" | "Latest" | "Oldest";
      }
      • Optional after?: string

        Description

        Message id after which messages should be fetched

      • Optional before?: string

        Description

        Message id before which messages should be fetched

      • Optional include_users?: boolean

        Description

        Whether to include user (and member, if server channel) objects

      • Optional limit?: number

        Format: int64

        Description

        Maximum number of messages to fetch

      • query: string

        Description

        Full-text search query

        See MongoDB documentation for more information.

      • Optional sort?: "Relevance" | "Latest" | "Oldest"

        Description

        Message sort direction

        By default, it will be sorted by latest.

        Default

        Relevance

    Returns Promise<BaseMessage[]>

  • Returns an iterable of values in the map

    Returns IterableIterator<BaseMessage>