UNPKG

waha.js

Version:

TypeScript SDK for WAHA (WhatsApp HTTP API)

39 lines (38 loc) 1.2 kB
import { WahaBaseClient } from '../client'; import { WAHAChatPresences, WAHASessionPresence } from '../types'; /** * Presence module for WAHA API */ export declare class PresenceModule { private client; /** * Create a new Presence module * @param client Base client */ constructor(client: WahaBaseClient); /** * Set session presence * @param session Session name * @param data Presence data */ setPresence(session: string | undefined, data: WAHASessionPresence): Promise<void>; /** * Get all subscribed presence information * @param session Session name * @returns List of chat presences */ getAllPresences(session?: string): Promise<WAHAChatPresences[]>; /** * Get the presence for a specific chat * @param session Session name * @param chatId Chat ID * @returns Chat presence */ getPresence(session: string | undefined, chatId: string): Promise<WAHAChatPresences>; /** * Subscribe to presence events for a chat * @param session Session name * @param chatId Chat ID */ subscribePresence(session: string | undefined, chatId: string): Promise<void>; }