Hierarchy

Constructors

  • Parameters

    • client: Client
    • 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 SystemMessage

Properties

client: Client
deleted: boolean = false

Accessors

Methods

  • 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

  • Update this object with new API data.

    Parameters

    • data: Partial<{
          _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;
          };
      }> = {}

    Returns SystemMessage