UNPKG

nodevk-ts

Version:

Simple Node.js module that allows you to interact with the VKontakte API.

57 lines (56 loc) 1.79 kB
import Session, { IMethodParams } from "../Session/Session.js"; import EventHandler, { EventReturn } from "./EventHandler.js"; import { PhotoObject } from "../API/photos.js"; export interface AttachmentPhoto { type: 'photo'; photo: PhotoObject; } export declare type Attachment = AttachmentPhoto; export declare type ButtonType = "text" | 'vkpay' | 'open_app' | 'location' | 'open_link' | 'intent_subscribe' | 'intent_unsubscribe'; export interface ClientInfo { button_actions: ButtonType[]; keyboard: boolean; inline_keyboard: boolean; carousel: boolean; lang_id: number; } export interface ForwardMessage { date: number; from_id: number; text: string; attachments: []; conversation_message_id: number; peer_id: number; id: number; } export interface MessageObject { date: number; from_id: number; id: number; out: number; peer_id: number; text: string; conversation_message_id: number; fwd_messages: ForwardMessage[]; reply_message: ForwardMessage; important: boolean; random_id: number; attachments: Attachment[]; is_hidden: boolean; } export declare class NewMessageEvent { readonly ClientInfo: ClientInfo; readonly MessageSource: MessageObject; readonly Session: Session; constructor(o: { message: MessageObject; client_info: ClientInfo; }, session: Session); get message(): string; get from_id(): number; get peer_id(): number; reply(text: string, attachments?: string | readonly string[], params?: IMethodParams): Promise<void>; } export default interface NewMessageEventHandler extends EventHandler { (message: NewMessageEvent): EventReturn<boolean | void>; }