Class MessageContext<S>

Type Parameters

Hierarchy (view full)

Constructors

Properties

$filled: boolean
$groupId?: number
$match: RegExpMatchArray
[kAttachments]: (Attachment<object, string> | ExternalAttachment<object, string>)[]
[kMessagePayload]: any
[kReplyMessage]: undefined | MessageContext<S>
api: API
getAllAttachments: {
    (type): AudioAttachment[];
    (type): AudioMessageAttachment[];
    (type): GraffitiAttachment[];
    (type): DocumentAttachment[];
    (type): MarketAlbumAttachment[];
    (type): MarketAttachment[];
    (type): PhotoAttachment[];
    (type): StoryAttachment[];
    (type): VideoAttachment[];
    (type): WallAttachment[];
    (type): PollAttachment[];
    (type): GiftAttachment[];
    (type): LinkAttachment[];
    (type): StickerAttachment[];
    (type): WallReplyAttachment[];
}

Type declaration

hasAllAttachments: ((type?) => 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;
    }

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

    • Optional action?: {
          email?: string;
          member_id?: number;
          photo?: {
              photo_100: string;
              photo_200: string;
              photo_50: string;
          };
          text?: string;
          type: MessageContextPayloadEventType;
      }
      • Optional email?: string
      • Optional member_id?: number
      • Optional photo?: {
            photo_100: string;
            photo_200: string;
            photo_50: string;
        }
        • photo_100: string
        • photo_200: string
        • photo_50: string
      • Optional text?: string
      • type: MessageContextPayloadEventType
    • Optional admin_author_id?: number
    • attachments: object[]
    • conversation_message_id: number
    • date: number
    • from_id: number
    • Optional 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; })[]
    • Optional 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";
      }
      • coordinates: {
            latitude: number;
            longitude: number;
        }
        • latitude: number
        • longitude: number
      • Optional 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;
        }
        • Optional address?: number
        • Optional checkins?: number
        • city: string
        • country: number
        • Optional created?: number
        • Optional group_id?: number
        • Optional group_photo?: string
        • Optional icon?: string
        • id: number
        • Optional latitude?: number
        • Optional longitude?: number
        • Optional title?: string
        • Optional type?: number
        • Optional updated?: number
      • type: "point"
    • id: number
    • important: boolean
    • Optional is_cropped?: boolean
    • Optional is_expired?: boolean
    • Optional members_count?: number
    • Optional message_tag?: string
    • out: number
    • Optional payload?: string
    • peer_id: number
    • Optional pinned_at?: number
    • random_id: number
    • Optional ref?: string
    • Optional ref_source?: string
    • Optional 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; }
    • Optional text?: string
    • Optional update_time?: number
    • Optional was_listened?: boolean

Methods

  • Applies the payload

    Parameters

    • payload: IMessageContextPayload | {
          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;
      }

    Returns void

Generated using TypeDoc