vk-io
    Preparing search index...

    Class MessageContext<S>

    Type Parameters

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any
    Index

    Constructors

    Properties

    "[kAttachments]": (
        Attachment<object, string>
        | ExternalAttachment<object, string>
    )[]
    "[kMessagePayload]": any
    "[kReplyMessage]": undefined | MessageContext<S>
    $filled: boolean
    $groupId?: number
    $match: RegExpMatchArray
    api: API
    getAllAttachments: {
        (type: "audio" | AUDIO): AudioAttachment[];
        (type: "audio_message" | AUDIO_MESSAGE): AudioMessageAttachment[];
        (type: "graffiti" | GRAFFITI): GraffitiAttachment[];
        (type: "doc" | DOCUMENT): DocumentAttachment[];
        (type: "market_album" | MARKET_ALBUM): MarketAlbumAttachment[];
        (type: "market" | MARKET): MarketAttachment[];
        (type: "photo" | PHOTO): PhotoAttachment[];
        (type: "story" | STORY): StoryAttachment[];
        (type: "video" | VIDEO): VideoAttachment[];
        (type: "wall" | WALL): WallAttachment[];
        (type: "poll" | POLL): PollAttachment[];
        (type: "gift" | GIFT): GiftAttachment[];
        (type: "link" | LINK): LinkAttachment[];
        (type: "sticker" | STICKER): StickerAttachment[];
        (type: "wall_reply" | WALL_REPLY): WallReplyAttachment[];
    }

    Type Declaration

    hasAllAttachments: (type?: AttachmentTypeString | AttachmentType) => boolean

    Type Declaration

    state: S
    text?: string
    type: "message"
    upload: Upload

    Accessors

    • get clientInfo(): {
          button_actions: (
              "location"
              | "text"
              | "vkpay"
              | "open_app"
              | "open_link"
              | "callback"
          )[];
          carousel: boolean;
          inline_keyboard: boolean;
          keyboard: boolean;
          lang_id: number;
      }

      Returns the capabilities of the client the user is using.

      Returns {
          button_actions: (
              "location"
              | "text"
              | "vkpay"
              | "open_app"
              | "open_link"
              | "callback"
          )[];
          carousel: boolean;
          inline_keyboard: boolean;
          keyboard: boolean;
          lang_id: number;
      }

    • get geo(): | undefined
      | {
          coordinates: { latitude: number; longitude: number };
          place?: {
              address?: number;
              checkins?: number;
              city: string;
              country: number;
              created?: number;
              group_id?: number;
              group_photo?: string;
              icon?: string;
              id: number;
              latitude?: number;
              longitude?: number;
              title?: string;
              type?: number;
              updated?: number;
          };
          type: "point";
      }

      Returns geo

      Returns
          | undefined
          | {
              coordinates: { latitude: number; longitude: number };
              place?: {
                  address?: number;
                  checkins?: number;
                  city: string;
                  country: number;
                  created?: number;
                  group_id?: number;
                  group_photo?: string;
                  icon?: string;
                  id: number;
                  latitude?: number;
                  longitude?: number;
                  title?: string;
                  type?: number;
                  updated?: number;
              };
              type: "point";
          }

    • get message(): {
          action?: {
              email?: string;
              member_id?: number;
              photo?: { photo_100: string; photo_200: string; photo_50: string };
              text?: string;
              type: MessageContextPayloadEventType;
          };
          admin_author_id?: number;
          attachments: object[];
          conversation_message_id: number;
          date: number;
          from_id: number;
          fwd_messages?: (
              { id: number; conversation_message_id: number; out: number; peer_id: number; from_id: number; text?: string | undefined; date: number; update_time?: number | undefined; random_id: number; ref?: string | undefined; ... 14 more ...; is_expired?: boolean | undefined; }
          )[];
          geo?: {
              coordinates: { latitude: number; longitude: number };
              place?: {
                  address?: number;
                  checkins?: number;
                  city: string;
                  country: number;
                  created?: number;
                  group_id?: number;
                  group_photo?: string;
                  icon?: string;
                  id: number;
                  latitude?: number;
                  longitude?: number;
                  title?: string;
                  type?: number;
                  updated?: number;
              };
              type: "point";
          };
          id: number;
          important: boolean;
          is_cropped?: boolean;
          is_expired?: boolean;
          members_count?: number;
          message_tag?: string;
          out: number;
          payload?: string;
          peer_id: number;
          pinned_at?: number;
          random_id: number;
          ref?: string;
          ref_source?: string;
          reply_message?: { id: number; conversation_message_id: number; out: number; peer_id: number; from_id: number; text?: string | undefined; date: number; update_time?: number | undefined; random_id: number; ref?: string | undefined; ... 14 more ...; is_expired?: boolean | undefined; };
          text?: string;
          update_time?: number;
          was_listened?: boolean;
      }

      Return alias of payload.message

      Returns {
          action?: {
              email?: string;
              member_id?: number;
              photo?: { photo_100: string; photo_200: string; photo_50: string };
              text?: string;
              type: MessageContextPayloadEventType;
          };
          admin_author_id?: number;
          attachments: object[];
          conversation_message_id: number;
          date: number;
          from_id: number;
          fwd_messages?: (
              { id: number; conversation_message_id: number; out: number; peer_id: number; from_id: number; text?: string | undefined; date: number; update_time?: number | undefined; random_id: number; ref?: string | undefined; ... 14 more ...; is_expired?: boolean | undefined; }
          )[];
          geo?: {
              coordinates: { latitude: number; longitude: number };
              place?: {
                  address?: number;
                  checkins?: number;
                  city: string;
                  country: number;
                  created?: number;
                  group_id?: number;
                  group_photo?: string;
                  icon?: string;
                  id: number;
                  latitude?: number;
                  longitude?: number;
                  title?: string;
                  type?: number;
                  updated?: number;
              };
              type: "point";
          };
          id: number;
          important: boolean;
          is_cropped?: boolean;
          is_expired?: boolean;
          members_count?: number;
          message_tag?: string;
          out: number;
          payload?: string;
          peer_id: number;
          pinned_at?: number;
          random_id: number;
          ref?: string;
          ref_source?: string;
          reply_message?: { id: number; conversation_message_id: number; out: number; peer_id: number; from_id: number; text?: string | undefined; date: number; update_time?: number | undefined; random_id: number; ref?: string | undefined; ... 14 more ...; is_expired?: boolean | undefined; };
          text?: string;
          update_time?: number;
          was_listened?: boolean;
      }

    Methods