import Api from './api'; import { V1 } from './v1-types'; export declare class Messages { private readonly api; private readonly url; constructor(api: Api); /** * Send text message to private chat * @param phoneNumber phone number, for example '79001234567' * @param text // text message to send */ sendTextMessage(phoneNumber: string, text: string): Promise; /** * Send text message to group chat * @param chatId Groupd id in format like "00000000000-XXXXXXXXXX". For example : "79001234567-1581234048" * @param text // text message to send */ sendTextMessageToGroup(chatId: string, text: string): Promise; /** * Send image. Before image have to be uploaded to server using method media.uploadMedia() * @param phoneNumber phone number, for example '79001234567' * @param mediaId id obtained from uploading image via method media.uploadMedia() * @param caption title under image in WhatsApp * @param recipient_type chat type. Can be individual or group */ sendImageById(phoneNumber: string, mediaId: string, caption?: string, recipient_type?: V1.RecipientTypes): Promise; /** * Send image by any url accessible from public zone of Internet * @param phoneNumber phone number, for example '79001234567' * @param link url * @param caption title under image in WhatsApp * @param recipient_type chat type. Can be individual or group */ sendImageByLink(phoneNumber: string, link: string, caption?: string, recipient_type?: V1.RecipientTypes): Promise; /** * Send video. Before video have to be uploaded to server using method media.uploadMedia() * @param phoneNumber phone number, for example '79001234567' * @param mediaId id obtained from uploading video via method media.uploadMedia() * @param recipient_type chat type. Can be individual or group */ sendVideoById(phoneNumber: string, mediaId: string, recipient_type?: V1.RecipientTypes): Promise; /** * Send video by any url accessible from public zone of Internet * @param phoneNumber phone number, for example '79001234567' * @param link url * @param caption title under video in WhatsApp * @param recipient_type chat type. Can be individual or group */ sendVideoByLink(phoneNumber: string, link: string, recipient_type?: V1.RecipientTypes): Promise; /** * Send audio. Before audio have to be uploaded to server using method media.uploadMedia() * @param phoneNumber phone number, for example '79001234567' * @param mediaId id obtained from uploading audio via method media.uploadMedia() * @param recipient_type chat type. Can be individual or group */ sendAudioById(phoneNumber: string, mediaId: string, recipient_type?: V1.RecipientTypes): Promise; /** * Send audio by any url accessible from public zone of Internet * @param phoneNumber phone number, for example '79001234567' * @param link url * @param caption title under audio in WhatsApp * @param recipient_type chat type. Can be individual or group */ sendAudioByLink(phoneNumber: string, link: string, recipient_type?: V1.RecipientTypes): Promise; /** * Send document. Before document have to be uploaded to server using method media.uploadMedia() * @param phoneNumber phone number, for example '79001234567' * @param mediaId id obtained from uploading document via method media.uploadMedia() * @param recipient_type chat type. Can be individual or group */ sendDocumentById(phoneNumber: string, mediaId: string, recipient_type?: V1.RecipientTypes): Promise; /** * Send document by any url accessible from public zone of Internet * @param phoneNumber phone number, for example '79001234567' * @param link url * @param caption title under document in WhatsApp * @param recipient_type chat type. Can be individual or group */ sendDocumentByLink(phoneNumber: string, link: string, recipient_type?: V1.RecipientTypes): Promise; }