UNPKG

@kamuridesu/whatframework

Version:

A simple WhatsApp Bot Framework on top of Baileys

31 lines (30 loc) 1.83 kB
import { makeWASocket, WAMessage, WAMessageContent, WAMessageKey, proto } from '@whiskeysockets/baileys'; import { IBot, GroupsData, Media, IMessageHandler } from "../../@types/types.js"; import { IMessage, IReactionMessage } from '../../@types/message.js'; import { Message } from '../data/message.js'; import Translations from '../../libs/lang/interface.js'; declare class WABot implements IBot { connection?: ReturnType<typeof makeWASocket>; reconnectOnClose: boolean; readonly name: string; readonly prefix: string; botNumber?: string; readonly ownerNumber: string; readonly language: string; readonly lang: Translations; groupsData: GroupsData; constructor(name?: string, prefix?: string, ownerNumber?: string, language?: string); getMessage(key: WAMessageKey): Promise<WAMessageContent | undefined>; init(messageHandler: IMessageHandler): Promise<void>; getGroups(): Promise<{ [_: string]: import("@whiskeysockets/baileys").GroupMetadata; } | undefined>; replyText(ctx: IMessage, text: string, options?: any): Promise<IMessage | undefined>; replyMedia(ctx: IMessage, media: string | Media | Buffer, messageType: string, mimeType?: string, mediaCaption?: string, options?: any): Promise<IMessage | undefined>; sendTextMessage(ctx: IMessage | string, text: string, options?: any): Promise<IMessage | undefined>; reactMessage(ctx: IMessage | string, reactionMessage: IReactionMessage, options?: any): Promise<IMessage | undefined>; createPoll(ctx: IMessage, pollName: string, options: Array<string>): Promise<boolean>; loadMessage(ctx: Message | WAMessageKey): Promise<IMessage | WAMessage | undefined>; loadMessageById(originJid: string, stanzaId: string): Promise<proto.IWebMessageInfo | undefined>; } export { WABot as Bot, Media };