Options
All
  • Public
  • Public/Protected
  • All
Menu

@adiwajshing/baileys

Index

References

Namespaces

Enumerations

Interfaces

Type aliases

Properties

Variables

Functions

References

Renames and re-exports WebMessageInfoStatus
Renames and re-exports WebMessageInfoStubType
Renames and re-exports proto

Type aliases

AnyMediaMessageContent: (({ caption?: string; image: WAMediaUpload; jpegThumbnail?: string } & Mentionable & Buttonable & Templatable & WithDimensions) | ({ caption?: string; gifPlayback?: boolean; jpegThumbnail?: string; video: WAMediaUpload } & Mentionable & Buttonable & Templatable & WithDimensions) | { audio: WAMediaUpload; ptt?: boolean; seconds?: number } | ({ sticker: WAMediaUpload } & WithDimensions) | ({ document: WAMediaUpload; fileName?: string; mimetype: string } & Buttonable & Templatable)) & { mimetype?: string }
AnyMessageContent: AnyRegularMessageContent | { force?: boolean; forward: WAMessage } | { delete: WAMessageKey } | { disappearingMessagesInChat: boolean | number }
AnyRegularMessageContent: (({ text: string } & Mentionable & Buttonable & Templatable & Listable) | AnyMediaMessageContent | { contacts: { contacts: IContactMessage[]; displayName?: string } } | { location: WALocationMessage }) & ViewOnce
AnyWASocket: WASocket | WALegacySocket
AppStateChunk: { collectionsToHandle: WAPatchName[]; totalMutations: ChatMutation[] }

Type declaration

AuthenticationCreds: SignalCreds & { account?: IADVSignedDeviceIdentity; advSecretKey: string; firstUnuploadedPreKeyId: number; lastAccountSyncTimestamp?: number; me?: Contact; myAppStateKeyId?: string; nextPreKeyId: number; noiseKey: KeyPair; serverHasPreKeys: boolean; signalIdentities?: SignalIdentity[] }
AuthenticationState: { creds: AuthenticationCreds; keys: SignalKeyStore }

Type declaration

BaileysEventMap<T>: { blocklist.set: { blocklist: string[] }; blocklist.update: { blocklist: string[]; type: "add" | "remove" }; chats.delete: string[]; chats.set: { chats: Chat[]; isLatest: boolean }; chats.update: Partial<Chat>[]; chats.upsert: Chat[]; connection.update: Partial<ConnectionState>; contacts.set: { contacts: Contact[] }; contacts.update: Partial<Contact>[]; contacts.upsert: Contact[]; creds.update: Partial<T>; group-participants.update: { action: ParticipantAction; id: string; participants: string[] }; groups.update: Partial<GroupMetadata>[]; groups.upsert: GroupMetadata[]; message-receipt.update: MessageUserReceiptUpdate[]; messages.delete: { keys: WAMessageKey[] } | { all: true; jid: string }; messages.set: { isLatest: boolean; messages: WAMessage[] }; messages.update: WAMessageUpdate[]; messages.upsert: { messages: WAMessage[]; type: MessageUpdateType }; presence.update: { id: string; presences: {} } }

Type parameters

  • T

Type declaration

  • blocklist.set: { blocklist: string[] }
    • blocklist: string[]
  • blocklist.update: { blocklist: string[]; type: "add" | "remove" }
    • blocklist: string[]
    • type: "add" | "remove"
  • chats.delete: string[]

    delete chats with given ID

  • chats.set: { chats: Chat[]; isLatest: boolean }

    set chats (history sync), chats are reverse chronologically sorted

    • chats: Chat[]
    • isLatest: boolean
  • chats.update: Partial<Chat>[]

    update the given chats

  • chats.upsert: Chat[]

    upsert chats

  • connection.update: Partial<ConnectionState>

    connection state has been updated -- WS closed, opened, connecting etc.

  • contacts.set: { contacts: Contact[] }

    set contacts (history sync)

  • contacts.update: Partial<Contact>[]
  • contacts.upsert: Contact[]
  • creds.update: Partial<T>

    credentials updated -- some metadata, keys or something

  • group-participants.update: { action: ParticipantAction; id: string; participants: string[] }

    apply an action to participants in a group

  • groups.update: Partial<GroupMetadata>[]
  • groups.upsert: GroupMetadata[]
  • message-receipt.update: MessageUserReceiptUpdate[]
  • messages.delete: { keys: WAMessageKey[] } | { all: true; jid: string }
  • messages.set: { isLatest: boolean; messages: WAMessage[] }

    set messages (history sync), messages are reverse chronologically sorted

  • messages.update: WAMessageUpdate[]
  • messages.upsert: { messages: WAMessage[]; type: MessageUpdateType }

    add/update the given messages. If they were received while the connection was online, the update will have type: "notify"

  • presence.update: { id: string; presences: {} }

    presence of contact in a chat updated

BinaryNode: { attrs: {}; content?: BinaryNode[] | string | Uint8Array; tag: string }

the binary node WA uses internally for communication

this is manipulated soley as an object and it does not have any functions. This is done for easy serialization, to prevent running into issues with prototypes & to maintain functional code structure

Type declaration

  • attrs: {}
    • [key: string]: string
  • Optional content?: BinaryNode[] | string | Uint8Array
  • tag: string
BinaryNodeAttributes: BinaryNode["attrs"]
BinaryNodeData: BinaryNode["content"]
CatalogCollection: { id: string; name: string; products: Product[]; status: CatalogStatus }

Type declaration

CatalogResult: { data: { data: any[]; paging: { cursors: { after: string; before: string } } } }

Type declaration

  • data: { data: any[]; paging: { cursors: { after: string; before: string } } }
    • data: any[]
    • paging: { cursors: { after: string; before: string } }
      • cursors: { after: string; before: string }
        • after: string
        • before: string
CatalogStatus: { canAppeal: boolean; status: string }

Type declaration

  • canAppeal: boolean
  • status: string
Chat: Omit<IConversation, "messages"> & { archive?: boolean; mute?: number | null; pin?: number | null }
ChatModification: { archive: boolean; lastMessages: LastMessageList } | { pin: boolean } | { mute: number | null } | { clear: "all" | { messages: { fromMe?: boolean; id: string }[] } } | { star: { messages: { fromMe?: boolean; id: string }[]; star: boolean } } | { lastMessages: LastMessageList; markRead: boolean } | { delete: true; lastMessages: LastMessageList }
ChatMutation: { index: string[]; syncAction: ISyncActionData }

Type declaration

CommonSocketConfig<T>: { agent?: Agent; auth?: T; browser: WABrowserDescription; connectTimeoutMs: number; customUploadHosts: MediaConnInfo["hosts"]; defaultQueryTimeoutMs: number | undefined; emitOwnEvents: boolean; fetchAgent?: Agent; keepAliveIntervalMs: number; logger: Logger; mediaCache?: NodeCache; printQRInTerminal: boolean; version: WAVersion; waWebSocketUrl: string | URL }

Type parameters

  • T

Type declaration

  • Optional agent?: Agent

    proxy agent

  • Optional auth?: T

    provide an auth state object to maintain the auth state

  • browser: WABrowserDescription

    override browser config

  • connectTimeoutMs: number

    Fails the connection if the socket times out in this interval

  • customUploadHosts: MediaConnInfo["hosts"]
  • defaultQueryTimeoutMs: number | undefined

    Default timeout for queries, undefined for no timeout

  • emitOwnEvents: boolean

    should events be emitted for actions done by this socket connection

  • Optional fetchAgent?: Agent

    agent used for fetch requests -- uploading/downloading media

  • keepAliveIntervalMs: number

    ping-pong interval for WS connection

  • logger: Logger

    pino logger

  • Optional mediaCache?: NodeCache

    provide a cache to store media, so does not have to be re-uploaded

  • printQRInTerminal: boolean

    should the QR be printed in the terminal

  • version: WAVersion

    version to connect with

  • waWebSocketUrl: string | URL

    the WS url to connect to WA

ConnectionState: { connection: WAConnectionState; isNewLogin?: boolean; lastDisconnect?: { date: Date; error: Error }; legacy?: { phoneConnected: boolean; user?: Contact }; qr?: string; receivedPendingNotifications?: boolean }

Type declaration

  • connection: WAConnectionState

    connection is now open, connecting or closed

  • Optional isNewLogin?: boolean

    is this a new login

  • Optional lastDisconnect?: { date: Date; error: Error }

    the error that caused the connection to close

    • date: Date
    • error: Error
  • Optional legacy?: { phoneConnected: boolean; user?: Contact }

    legacy connection options

    • phoneConnected: boolean
    • Optional user?: Contact
  • Optional qr?: string

    the current QR code

  • Optional receivedPendingNotifications?: boolean

    has the device received all pending notifications while it was offline

CurveKeyPair: { private: Uint8Array; public: Uint8Array }

Type declaration

  • private: Uint8Array
  • public: Uint8Array
DebouncedTimeout: ReturnType<typeof debouncedTimeout>
DownloadableMessage: { directPath?: string; mediaKey?: Uint8Array; url?: string }

Type declaration

  • Optional directPath?: string
  • Optional mediaKey?: Uint8Array
  • Optional url?: string
GroupParticipant: Contact & { admin?: "admin" | "superadmin" | null; isAdmin?: boolean; isSuperAdmin?: boolean }
JidServer: "c.us" | "g.us" | "broadcast" | "s.whatsapp.net" | "call"
JidWithDevice: { device?: number; user: string }

Type declaration

  • Optional device?: number
  • user: string
KeyPair: { private: Uint8Array; public: Uint8Array }

Type declaration

  • private: Uint8Array
  • public: Uint8Array
LTHashState: { hash: Buffer; indexValueMap: {}; version: number }

Type declaration

  • hash: Buffer
  • indexValueMap: {}
    • [indexMacBase64: string]: { valueMac: Uint8Array | Buffer }
      • valueMac: Uint8Array | Buffer
  • version: number
LastMessageList: Pick<IWebMessageInfo, "key" | "messageTimestamp">[]

the last messages in a chat, sorted reverse-chronologically for MD modifications, the last message in the array must be the last message recv in the chat

LegacySocketConfig: CommonSocketConfig<LegacyAuthenticationCreds> & { expectResponseTimeout: number; phoneResponseTimeMs: number }
MediaConnInfo: { auth: string; fetchDate: Date; hosts: { hostname: string; maxContentLengthBytes: number }[]; ttl: number }

Type declaration

  • auth: string
  • fetchDate: Date
  • hosts: { hostname: string; maxContentLengthBytes: number }[]
  • ttl: number
MediaDownloadOptions: { endByte?: number; startByte?: number }

Type declaration

  • Optional endByte?: number
  • Optional startByte?: number
MediaGenerationOptions: { logger?: Logger; mediaCache?: NodeCache; mediaUploadTimeoutMs?: number; upload: WAMediaUploadFunction }

Type declaration

  • Optional logger?: Logger
  • Optional mediaCache?: NodeCache

    cache media so it does not have to be uploaded again

  • Optional mediaUploadTimeoutMs?: number
  • upload: WAMediaUploadFunction
MediaType: "image" | "video" | "sticker" | "audio" | "document" | "history" | "md-app-state"
MessageContentGenerationOptions: MediaGenerationOptions & { getUrlInfo?: any }
MessageGenerationOptionsFromContent: MiscMessageGenerationOptions & { userJid: string }
MessageRelayOptions: { additionalAttributes?: {}; messageId?: string; participant?: string; cachedGroupMetadata?: any }

Type declaration

  • Optional additionalAttributes?: {}
    • [_: string]: string
  • Optional messageId?: string
  • Optional participant?: string

    only send to a specific participant

  • cachedGroupMetadata?:function
MessageType: keyof Message

Set of message types that are supported by the library

MessageUpdateType: "append" | "notify" | "replace"
MessageUserReceipt: IUserReceipt
MessageUserReceiptUpdate: { key: IMessageKey; receipt: MessageUserReceipt }

Type declaration

MiscMessageGenerationOptions: { ephemeralExpiration?: number | string; mediaUploadTimeoutMs?: number; messageId?: string; quoted?: WAMessage; timestamp?: Date }

Type declaration

  • Optional ephemeralExpiration?: number | string

    disappearing messages settings

  • Optional mediaUploadTimeoutMs?: number
  • Optional messageId?: string

    Force message id

  • Optional quoted?: WAMessage

    the message you want to quote

  • Optional timestamp?: Date

    optional, if you want to manually set the timestamp of the message

OrderDetails: { price: OrderPrice; products: OrderProduct[] }

Type declaration

OrderPrice: { currency: string; total: number }

Type declaration

  • currency: string
  • total: number
OrderProduct: { currency: string; id: string; imageUrl: string; name: string; price: number; quantity: number }

Type declaration

  • currency: string
  • id: string
  • imageUrl: string
  • name: string
  • price: number
  • quantity: number
ParticipantAction: "add" | "remove" | "promote" | "demote"
Product: ProductBase & { availability: ProductAvailability; id: string; imageUrls: {}; reviewStatus: {} }
ProductAvailability: "in stock"
ProductBase: { currency: string; description: string; isHidden?: boolean; name: string; price: number; retailerId?: string; url?: string }

Type declaration

  • currency: string
  • description: string
  • Optional isHidden?: boolean
  • name: string
  • price: number
  • Optional retailerId?: string
  • Optional url?: string
ProductCreate: ProductBase & { images: WAMediaUpload[]; originCountryCode: string | undefined }
ProductCreateResult: { data: { product: any } }

Type declaration

  • data: { product: any }
    • product: any
ProductUpdate: Omit<ProductCreate, "originCountryCode">
ProtocolAddress: { deviceId: number; name: string }

Type declaration

  • deviceId: number
  • name: string
SignalAuthState: { creds: SignalCreds; keys: SignalKeyStore }

Type declaration

SignalCreds: { registrationId: number; signedIdentityKey: KeyPair; signedPreKey: SignedKeyPair }

Type declaration

  • Readonly registrationId: number
  • Readonly signedIdentityKey: KeyPair
  • Readonly signedPreKey: SignedKeyPair
SignalDataSet: { [ T in keyof SignalDataTypeMap]?: {} }
SignalDataTypeMap: { app-state-sync-key: IAppStateSyncKeyData; app-state-sync-version: LTHashState; pre-key: KeyPair; sender-key: any; sender-key-memory: {}; session: any }

Type declaration

SignalIdentity: { identifier: ProtocolAddress; identifierKey: Uint8Array }

Type declaration

SignalKeyStore: { get: any; set: any }

Type declaration

SignalKeyStoreWithTransaction: SignalKeyStore & { isInTransaction: any; prefetch: any; transaction: any }
SignedKeyPair: { keyId: number; keyPair: KeyPair; signature: Uint8Array }

Type declaration

  • keyId: number
  • keyPair: KeyPair
  • signature: Uint8Array
SocketConfig: CommonSocketConfig<AuthenticationState> & { msgRetryCounterMap?: {}; userDevicesCache?: NodeCache; getMessage: any }
SocketQueryOptions: SocketSendMessageOptions & { expect200?: boolean; requiresPhoneConnection?: boolean; timeoutMs?: number }
SocketSendMessageOptions: { binaryTag?: WATag; json: BinaryNode | any[]; longTag?: boolean; tag?: string }

Type declaration

  • Optional binaryTag?: WATag
  • json: BinaryNode | any[]
  • Optional longTag?: boolean
  • Optional tag?: string
WABrowserDescription: [string, string, string]
WABusinessHoursConfig: { close_time?: number; day_of_week: string; mode: string; open_time?: number }

Type declaration

  • Optional close_time?: number
  • day_of_week: string
  • mode: string
  • Optional open_time?: number
WABusinessProfile: { business_hours: { business_config?: WABusinessHoursConfig[]; config?: WABusinessHoursConfig[]; timezone?: string }; categories: { id: string; localized_display_name: string }[]; description: string; email: string; website: string[]; wid?: string }

Type declaration

WAConnectionState: "open" | "connecting" | "close"
WAContactMessage: IContactMessage
WAContactsArrayMessage: IContactsArrayMessage
WAContextInfo: IContextInfo
WAInitResponse: { ref: string; status: 200; ttl: number }

Type declaration

  • ref: string
  • status: 200
  • ttl: number
WALegacySocket: ReturnType<typeof makeWALegacySocket>
WALocationMessage: ILocationMessage
WAMediaUpload: Buffer | { url: URL | string } | { stream: Readable }
WAMediaUploadFunction: (readStream: Readable, opts: { fileEncSha256B64: string; mediaType: MediaType; timeoutMs?: number }) => Promise<{ directPath: string; mediaUrl: string }>

Type declaration

    • (readStream: Readable, opts: { fileEncSha256B64: string; mediaType: MediaType; timeoutMs?: number }): Promise<{ directPath: string; mediaUrl: string }>
    • Parameters

      • readStream: Readable
      • opts: { fileEncSha256B64: string; mediaType: MediaType; timeoutMs?: number }
        • fileEncSha256B64: string
        • mediaType: MediaType
        • Optional timeoutMs?: number

      Returns Promise<{ directPath: string; mediaUrl: string }>

WAMessage: IWebMessageInfo
WAMessageContent: IMessage
WAMessageCursor: { before: WAMessageKey | undefined } | { after: WAMessageKey | undefined }
WAMessageKey: IMessageKey
WAMessageUpdate: { key: IMessageKey; update: Partial<WAMessage> }

Type declaration

WAPatchCreate: { apiVersion: number; index: string[]; operation: SyncdMutationSyncdOperation; syncAction: ISyncActionValue; type: WAPatchName }

Type declaration

WAPatchName: "critical_block" | "critical_unblock_low" | "regular_low" | "regular_high" | "regular"
WAPresence: "unavailable" | "available" | "composing" | "recording" | "paused"

set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send

WASocket: ReturnType<typeof default>
WATag: [WAMetric, WAFlag]

Tag used with binary queries

WATextMessage: IExtendedTextMessage
WAVersion: [number, number, number]

Properties

Binary: any
makeInMemoryStore: (__namedParameters: BaileysInMemoryStoreConfig) => { bind: (ev: BaileysEventEmitter) => void; chats: default<Chat, string>; contacts: {}; fetchBroadcastListInfo: (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<GroupMetadata>; fetchGroupMetadata: (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }) => Promise<GroupMetadata>; fetchImageUrl: (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }) => Promise<string>; fetchMessageReceipts: (__namedParameters: IMessageKey, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IUserReceipt[]>; fromJSON: (json: { chats: Chat[]; contacts: {}; messages: {} }) => void; groupMetadata: {}; loadMessage: (jid: string, id: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo>; loadMessages: (jid: string, count: number, cursor: WAMessageCursor, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo[]>; messages: {}; mostRecentMessage: (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo>; presences: {}; readFromFile: (path: string) => void; state: ConnectionState; toJSON: () => { chats: default<Chat, string>; contacts: {}; messages: {} }; writeToFile: (path: string) => void }

Type declaration

    • (__namedParameters: BaileysInMemoryStoreConfig): { bind: (ev: BaileysEventEmitter) => void; chats: default<Chat, string>; contacts: {}; fetchBroadcastListInfo: (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<GroupMetadata>; fetchGroupMetadata: (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }) => Promise<GroupMetadata>; fetchImageUrl: (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }) => Promise<string>; fetchMessageReceipts: (__namedParameters: IMessageKey, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IUserReceipt[]>; fromJSON: (json: { chats: Chat[]; contacts: {}; messages: {} }) => void; groupMetadata: {}; loadMessage: (jid: string, id: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo>; loadMessages: (jid: string, count: number, cursor: WAMessageCursor, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo[]>; messages: {}; mostRecentMessage: (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo>; presences: {}; readFromFile: (path: string) => void; state: ConnectionState; toJSON: () => { chats: default<Chat, string>; contacts: {}; messages: {} }; writeToFile: (path: string) => void }
    • Parameters

      • __namedParameters: BaileysInMemoryStoreConfig

      Returns { bind: (ev: BaileysEventEmitter) => void; chats: default<Chat, string>; contacts: {}; fetchBroadcastListInfo: (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<GroupMetadata>; fetchGroupMetadata: (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }) => Promise<GroupMetadata>; fetchImageUrl: (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }) => Promise<string>; fetchMessageReceipts: (__namedParameters: IMessageKey, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IUserReceipt[]>; fromJSON: (json: { chats: Chat[]; contacts: {}; messages: {} }) => void; groupMetadata: {}; loadMessage: (jid: string, id: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo>; loadMessages: (jid: string, count: number, cursor: WAMessageCursor, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo[]>; messages: {}; mostRecentMessage: (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo>; presences: {}; readFromFile: (path: string) => void; state: ConnectionState; toJSON: () => { chats: default<Chat, string>; contacts: {}; messages: {} }; writeToFile: (path: string) => void }

      • bind: (ev: BaileysEventEmitter) => void
          • binds to a BaileysEventEmitter. It listens to all events and constructs a state that you can query accurate data from. Eg. can use the store to fetch chats, contacts, messages etc.

            Parameters

            Returns void

      • chats: default<Chat, string>
      • contacts: {}
      • fetchBroadcastListInfo: (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<GroupMetadata>
          • (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }): Promise<GroupMetadata>
          • Parameters

            • jid: string
            • sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }
              • authInfo: LegacyAuthenticationCreds
              • blockUser: (jid: string, type?: "add" | "remove") => Promise<void>
                  • (jid: string, type?: "add" | "remove"): Promise<void>
                  • Add or remove user from blocklist

                    Parameters

                    • jid: string

                      the ID of the person who you are blocking/unblocking

                    • type: "add" | "remove" = 'add'

                      type of operation

                    Returns Promise<void>

              • canLogin: () => boolean
                  • (): boolean
                  • Can you login to WA without scanning the QR

                    Returns boolean

              • chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>
                  • (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number): Promise<void | { status: number }>
                  • Modify a given chat (archive, pin etc.)

                    Parameters

                    • modification: ChatModification
                    • jid: string

                      the ID of the person/group you are modifiying

                    • chatInfo: Pick<Chat, "mute" | "pin">
                    • Optional timestampNow: number

                    Returns Promise<void | { status: number }>

              • chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>
                  • (fromMessage: IMessageKey, count: number): Promise<void>
                  • Parameters

                    Returns Promise<void>

              • currentEpoch: () => number
                  • (): number
                  • Returns number

              • downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>
              • end: (error: Error) => void
                  • (error: Error): void
                  • Parameters

                    • error: Error

                    Returns void

              • ev: LegacyBaileysEventEmitter
              • fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>
              • generateMessageTag: (longTag?: boolean) => string
                  • (longTag?: boolean): string
                  • generate message tag and increment epoch

                    Parameters

                    • longTag: boolean = false

                    Returns string

              • generateUrlInfo: (text: string) => Promise<WAUrlInfo>
                  • Query a string to check if it has a url, if it does, return WAUrlInfo

                    Parameters

                    • text: string

                    Returns Promise<WAUrlInfo>

              • getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>
              • getBusinessProfile: (jid: string) => Promise<WABusinessProfile>
                  • Query Business Profile (Useful for VCards)

                    Parameters

                    • jid: string

                      Business Jid

                    Returns Promise<WABusinessProfile>

                    profile object or undefined if not business account

              • getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>
                  • (jid?: string, limit?: number): Promise<{ beforeCursor: string; products: Product[] }>
                  • Parameters

                    • Optional jid: string
                    • limit: number = 10

                    Returns Promise<{ beforeCursor: string; products: Product[] }>

              • getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>
                  • (orderId: string, tokenBase64: string): Promise<OrderDetails>
                  • Parameters

                    • orderId: string
                    • tokenBase64: string

                    Returns Promise<OrderDetails>

              • getStatus: (jid: string) => Promise<{ status: string }>
                  • (jid: string): Promise<{ status: string }>
                  • Query the status of the person (see groupMetadata() for groups)

                    Parameters

                    • jid: string

                    Returns Promise<{ status: string }>

              • groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>
                  • Create a group

                    Parameters

                    • title: string

                      like, the title of the group

                    • participants: string[]

                      people to include in the group

                    Returns Promise<GroupMetadata>

              • groupInviteCode: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Parameters

                    • jid: string

                    Returns Promise<string>

              • groupLeave: (id: string) => Promise<void>
                  • (id: string): Promise<void>
                  • Leave a group

                    Parameters

                    • id: string

                    Returns Promise<void>

              • groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>
              • groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>
                  • Update participants in the group

                    Parameters

                    Returns Promise<string[]>

              • groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>
                  • (jid: string, description: string): Promise<{ status: number }>
                  • Update the group description

                    Parameters

                    • jid: string

                      the ID of the group

                    • description: string

                    Returns Promise<{ status: number }>

              • groupUpdateSubject: (id: string, title: string) => Promise<void>
                  • (id: string, title: string): Promise<void>
                  • Update the subject of the group

                    Parameters

                    • id: string
                    • title: string

                      the new title of the group

                    Returns Promise<void>

              • loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>
                  • Load a single message specified by the ID

                    Parameters

                    • jid: string
                    • id: string

                    Returns Promise<WebMessageInfo>

              • logout: () => Promise<void>
                  • (): Promise<void>
                  • Logs you out from WA If connected, invalidates the credentials with the server

                    Returns Promise<void>

              • messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>
                  • Parameters

                    • jid: string
                    • messageID: string

                    Returns Promise<IUserReceipt[]>

              • onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • (str: string): Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • Query whether a given number is registered on WhatsApp

                    Parameters

                    • str: string

                      phone number/jid you want to check for

                    Returns Promise<{ exists: boolean; isBusiness: boolean; jid: string }>

                    undefined if the number doesn't exists, otherwise the correctly formatted jid

              • presenceSubscribe: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Request updates on the presence of a user this returns nothing, you'll receive updates in chats.update event

                    Parameters

                    • jid: string

                    Returns Promise<string>

              • productCreate: (product: ProductCreate) => Promise<Product>
              • productDelete: (productIds: string[]) => Promise<{ deleted: any }>
                  • (productIds: string[]): Promise<{ deleted: any }>
                  • Parameters

                    • productIds: string[]

                    Returns Promise<{ deleted: any }>

              • productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>
              • profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>
                  • (jid: string, timeoutMs?: number): Promise<string>
                  • Parameters

                    • jid: string
                    • Optional timeoutMs: number

                    Returns Promise<string>

              • query: (__namedParameters: SocketQueryOptions) => Promise<any>
              • relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>
                  • (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }): Promise<void>
                  • Relay (send) a WAMessage; more advanced functionality to send a built WA Message, you may want to stick with sendMessage()

                    Parameters

                    • message: IWebMessageInfo
                    • __namedParameters: { waitForAck: boolean } = ...
                      • waitForAck: boolean

                    Returns Promise<void>

              • searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • (txt: string, inJid: string, count: number, page: number): Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • Parameters

                    • txt: string
                    • inJid: string
                    • count: number
                    • page: number

                    Returns Promise<{ last: boolean; messages: WebMessageInfo[] }>

              • sendAdminTest: () => Promise<string>
                  • (): Promise<string>
                  • checks for phone connection

                    Returns Promise<string>

              • sendChatsQuery: (epoch: number) => Promise<string>
                  • (epoch: number): Promise<string>
                  • Parameters

                    • epoch: number

                    Returns Promise<string>

              • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>
              • sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>
              • sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>
                  • Tell someone about your presence -- online, typing, offline etc.

                    Parameters

                    • type: WAPresence

                      your presence

                    • jid: string

                      the ID of the person/group who you are updating

                    Returns Promise<string>

              • setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>
                  • (nodes: BinaryNode[], binaryTag?: WATag, tag?: string): Promise<{ status: number }>
                  • Generic function for action, set queries

                    Parameters

                    Returns Promise<{ status: number }>

              • setStatus: (status: string) => Promise<{ status: number }>
                  • (status: string): Promise<{ status: number }>
                  • Parameters

                    • status: string

                    Returns Promise<{ status: number }>

              • state: ConnectionState
              • type: "legacy"
              • updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>
              • updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }
                  • (info: { encKey: Buffer; macKey: Buffer }): { encKey: Buffer; macKey: Buffer }
                  • Parameters

                    • info: { encKey: Buffer; macKey: Buffer }
                      • encKey: Buffer
                      • macKey: Buffer

                    Returns { encKey: Buffer; macKey: Buffer }

                    • encKey: Buffer
                    • macKey: Buffer
              • updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>
              • updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>
                  • (name: string): Promise<{ pushname: string; status: number }>
                  • Parameters

                    • name: string

                    Returns Promise<{ pushname: string; status: number }>

              • waUploadToServer: WAMediaUploadFunction
              • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
              • waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }
                  • (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number): { cancelToken: () => void; promise: Promise<any> }
                  • Wait for a message with a certain tag to be received

                    Parameters

                    • tag: string

                      the message tag to await

                    • requiresPhoneConnection: boolean
                    • Optional timeoutMs: number

                      timeout after which the promise will reject

                    Returns { cancelToken: () => void; promise: Promise<any> }

                    • cancelToken: () => void
                        • (): void
                        • Returns void

                    • promise: Promise<any>
              • waitForSocketOpen: () => Promise<void>
                  • (): Promise<void>
                  • Returns Promise<void>

              • ws: WebSocket
              • updateProfilePicture:function
                • updateProfilePicture(jid: string, img: Buffer): Promise<void>

            Returns Promise<GroupMetadata>

      • fetchGroupMetadata: (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }) => Promise<GroupMetadata>
          • (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }): Promise<GroupMetadata>
          • Parameters

            • jid: string
            • sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }
              • appPatch: (patchCreate: WAPatchCreate) => Promise<void>
              • assertSessions: (jids: string[], force: boolean) => Promise<boolean>
                  • (jids: string[], force: boolean): Promise<boolean>
                  • Parameters

                    • jids: string[]
                    • force: boolean

                    Returns Promise<boolean>

              • assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>
                  • (range: number, execute: (keys: {}) => Promise<void>): Promise<void>
                  • get some pre-keys and do something with them

                    Parameters

                    • range: number
                    • execute: (keys: {}) => Promise<void>
                        • (keys: {}): Promise<void>
                        • Parameters

                          • keys: {}
                            • [_: number]: any

                          Returns Promise<void>

                    Returns Promise<void>

              • authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }
              • chatModify: (mod: ChatModification, jid: string) => Promise<void>
                  • modify a chat -- mark unread, read etc. lastMessages must be sorted in reverse chronologically requires the last messages till the last message received; required for archive & unread

                    Parameters

                    Returns Promise<void>

              • end: (error: Error) => void
                  • (error: Error): void
                  • Parameters

                    • error: Error

                    Returns void

              • ev: BaileysEventEmitter
              • fetchBlocklist: () => Promise<string[]>
                  • (): Promise<string[]>
                  • Returns Promise<string[]>

              • fetchPrivacySettings: (force?: boolean) => Promise<{}>
                  • (force?: boolean): Promise<{}>
                  • Parameters

                    • force: boolean = false

                    Returns Promise<{}>

              • fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>
                  • (jid: string): Promise<{ setAt: Date; status: string }>
                  • Parameters

                    • jid: string

                    Returns Promise<{ setAt: Date; status: string }>

              • generateMessageTag: () => string
                  • (): string
                  • Returns string

              • getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>
              • getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>
                  • (jid?: string, limit?: number): Promise<{ products: Product[] }>
                  • Parameters

                    • Optional jid: string
                    • limit: number = 10

                    Returns Promise<{ products: Product[] }>

              • getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>
                  • Parameters

                    • Optional jid: string
                    • limit: number = 51

                    Returns Promise<{ collections: CatalogCollection[] }>

              • getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>
                  • (orderId: string, tokenBase64: string): Promise<OrderDetails>
                  • Parameters

                    • orderId: string
                    • tokenBase64: string

                    Returns Promise<OrderDetails>

              • groupAcceptInvite: (code: string) => Promise<string>
                  • (code: string): Promise<string>
                  • Parameters

                    • code: string

                    Returns Promise<string>

              • groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>
                  • (subject: string, participants: string[]): Promise<GroupMetadata>
                  • Parameters

                    • subject: string
                    • participants: string[]

                    Returns Promise<GroupMetadata>

              • groupFetchAllParticipating: () => Promise<{}>
                  • (): Promise<{}>
                  • Returns Promise<{}>

              • groupInviteCode: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Parameters

                    • jid: string

                    Returns Promise<string>

              • groupLeave: (id: string) => Promise<void>
                  • (id: string): Promise<void>
                  • Parameters

                    • id: string

                    Returns Promise<void>

              • groupMetadata: (jid: string) => Promise<GroupMetadata>
              • groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>
                  • Parameters

                    Returns Promise<string[]>

              • groupRevokeInvite: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Parameters

                    • jid: string

                    Returns Promise<string>

              • groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>
                  • (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked"): Promise<void>
                  • Parameters

                    • jid: string
                    • setting: "announcement" | "not_announcement" | "locked" | "unlocked"

                    Returns Promise<void>

              • groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>
                  • (jid: string, ephemeralExpiration: number): Promise<void>
                  • Parameters

                    • jid: string
                    • ephemeralExpiration: number

                    Returns Promise<void>

              • groupUpdateDescription: (jid: string, description?: string) => Promise<void>
                  • (jid: string, description?: string): Promise<void>
                  • Parameters

                    • jid: string
                    • Optional description: string

                    Returns Promise<void>

              • groupUpdateSubject: (jid: string, subject: string) => Promise<void>
                  • (jid: string, subject: string): Promise<void>
                  • Parameters

                    • jid: string
                    • subject: string

                    Returns Promise<void>

              • logout: () => Promise<void>
                  • (): Promise<void>
                  • logout & invalidate connection

                    Returns Promise<void>

              • onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>
                  • (...jids: string[]): Promise<{ exists: boolean; jid: string }[]>
                  • Parameters

                    • Rest ...jids: string[]

                    Returns Promise<{ exists: boolean; jid: string }[]>

              • presenceSubscribe: (toJid: string) => Promise<void>
                  • (toJid: string): Promise<void>
                  • Parameters

                    • toJid: string

                    Returns Promise<void>

              • processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>
              • productCreate: (create: ProductCreate) => Promise<Product>
              • productDelete: (productIds: string[]) => Promise<{ deleted: number }>
                  • (productIds: string[]): Promise<{ deleted: number }>
                  • Parameters

                    • productIds: string[]

                    Returns Promise<{ deleted: number }>

              • productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>
              • profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>
                  • (jid: string, type?: "preview" | "image", timeoutMs?: number): Promise<string>
                  • fetch the profile picture of a user/group type = "preview" for a low res picture type = "image for the high res picture"

                    Parameters

                    • jid: string
                    • type: "preview" | "image" = 'preview'
                    • Optional timeoutMs: number

                    Returns Promise<string>

              • query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>
                  • send a query, and wait for its response. auto-generates message ID if not provided

                    Parameters

                    Returns Promise<BinaryNode>

              • refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>
              • relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>
              • resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>
              • resyncMainAppState: () => Promise<void>
                  • (): Promise<void>
                  • Returns Promise<void>

              • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>
              • sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>
                  • (__namedParameters: BinaryNode, extraAttrs: {}): Promise<void>
                  • Parameters

                    • __namedParameters: BinaryNode
                    • extraAttrs: {}
                      • [key: string]: string

                    Returns Promise<void>

              • sendNode: (node: BinaryNode) => Promise<void>
                  • send a binary node

                    Parameters

                    Returns Promise<void>

              • sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>
                  • Parameters

                    Returns Promise<void>

              • sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>
                  • (data: Buffer | Uint8Array): Promise<void>
                  • send a raw buffer

                    Parameters

                    • data: Buffer | Uint8Array

                    Returns Promise<void>

              • sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>
                  • (jid: string, participant: string, messageIds: string[]): Promise<void>
                  • Parameters

                    • jid: string
                    • participant: string
                    • messageIds: string[]

                    Returns Promise<void>

              • sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>
                  • (jid: string, participant: string, messageIds: string[], type: "read" | "read-self"): Promise<void>
                  • generic send receipt function used for receipts of phone call, read, delivery etc.

                    Parameters

                    • jid: string
                    • participant: string
                    • messageIds: string[]
                    • type: "read" | "read-self"

                    Returns Promise<void>

              • sendRetryRequest: (node: BinaryNode) => Promise<void>
              • type: "md"
              • updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>
                  • (jid: string, action: "block" | "unblock"): Promise<void>
                  • Parameters

                    • jid: string
                    • action: "block" | "unblock"

                    Returns Promise<void>

              • updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>
              • user: Contact
              • waUploadToServer: WAMediaUploadFunction
              • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
              • waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>
                  • (msgId: string, timeoutMs?: number): Promise<any>
                  • Wait for a message with a certain tag to be received

                    Parameters

                    • msgId: string
                    • timeoutMs: number = defaultQueryTimeoutMs

                      timeout after which the promise will reject

                    Returns Promise<any>

              • waitForSocketOpen: () => Promise<void>
                  • (): Promise<void>
                  • Returns Promise<void>

              • ws: WebSocket

            Returns Promise<GroupMetadata>

      • fetchImageUrl: (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }) => Promise<string>
          • (jid: string, sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }): Promise<string>
          • Parameters

            • jid: string
            • sock: { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }
              • appPatch: (patchCreate: WAPatchCreate) => Promise<void>
              • assertSessions: (jids: string[], force: boolean) => Promise<boolean>
                  • (jids: string[], force: boolean): Promise<boolean>
                  • Parameters

                    • jids: string[]
                    • force: boolean

                    Returns Promise<boolean>

              • assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>
                  • (range: number, execute: (keys: {}) => Promise<void>): Promise<void>
                  • get some pre-keys and do something with them

                    Parameters

                    • range: number
                    • execute: (keys: {}) => Promise<void>
                        • (keys: {}): Promise<void>
                        • Parameters

                          • keys: {}
                            • [_: number]: any

                          Returns Promise<void>

                    Returns Promise<void>

              • authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }
              • chatModify: (mod: ChatModification, jid: string) => Promise<void>
                  • modify a chat -- mark unread, read etc. lastMessages must be sorted in reverse chronologically requires the last messages till the last message received; required for archive & unread

                    Parameters

                    Returns Promise<void>

              • end: (error: Error) => void
                  • (error: Error): void
                  • Parameters

                    • error: Error

                    Returns void

              • ev: BaileysEventEmitter
              • fetchBlocklist: () => Promise<string[]>
                  • (): Promise<string[]>
                  • Returns Promise<string[]>

              • fetchPrivacySettings: (force?: boolean) => Promise<{}>
                  • (force?: boolean): Promise<{}>
                  • Parameters

                    • force: boolean = false

                    Returns Promise<{}>

              • fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>
                  • (jid: string): Promise<{ setAt: Date; status: string }>
                  • Parameters

                    • jid: string

                    Returns Promise<{ setAt: Date; status: string }>

              • generateMessageTag: () => string
                  • (): string
                  • Returns string

              • getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>
              • getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>
                  • (jid?: string, limit?: number): Promise<{ products: Product[] }>
                  • Parameters

                    • Optional jid: string
                    • limit: number = 10

                    Returns Promise<{ products: Product[] }>

              • getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>
                  • Parameters

                    • Optional jid: string
                    • limit: number = 51

                    Returns Promise<{ collections: CatalogCollection[] }>

              • getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>
                  • (orderId: string, tokenBase64: string): Promise<OrderDetails>
                  • Parameters

                    • orderId: string
                    • tokenBase64: string

                    Returns Promise<OrderDetails>

              • groupAcceptInvite: (code: string) => Promise<string>
                  • (code: string): Promise<string>
                  • Parameters

                    • code: string

                    Returns Promise<string>

              • groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>
                  • (subject: string, participants: string[]): Promise<GroupMetadata>
                  • Parameters

                    • subject: string
                    • participants: string[]

                    Returns Promise<GroupMetadata>

              • groupFetchAllParticipating: () => Promise<{}>
                  • (): Promise<{}>
                  • Returns Promise<{}>

              • groupInviteCode: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Parameters

                    • jid: string

                    Returns Promise<string>

              • groupLeave: (id: string) => Promise<void>
                  • (id: string): Promise<void>
                  • Parameters

                    • id: string

                    Returns Promise<void>

              • groupMetadata: (jid: string) => Promise<GroupMetadata>
              • groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>
                  • Parameters

                    Returns Promise<string[]>

              • groupRevokeInvite: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Parameters

                    • jid: string

                    Returns Promise<string>

              • groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>
                  • (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked"): Promise<void>
                  • Parameters

                    • jid: string
                    • setting: "announcement" | "not_announcement" | "locked" | "unlocked"

                    Returns Promise<void>

              • groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>
                  • (jid: string, ephemeralExpiration: number): Promise<void>
                  • Parameters

                    • jid: string
                    • ephemeralExpiration: number

                    Returns Promise<void>

              • groupUpdateDescription: (jid: string, description?: string) => Promise<void>
                  • (jid: string, description?: string): Promise<void>
                  • Parameters

                    • jid: string
                    • Optional description: string

                    Returns Promise<void>

              • groupUpdateSubject: (jid: string, subject: string) => Promise<void>
                  • (jid: string, subject: string): Promise<void>
                  • Parameters

                    • jid: string
                    • subject: string

                    Returns Promise<void>

              • logout: () => Promise<void>
                  • (): Promise<void>
                  • logout & invalidate connection

                    Returns Promise<void>

              • onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>
                  • (...jids: string[]): Promise<{ exists: boolean; jid: string }[]>
                  • Parameters

                    • Rest ...jids: string[]

                    Returns Promise<{ exists: boolean; jid: string }[]>

              • presenceSubscribe: (toJid: string) => Promise<void>
                  • (toJid: string): Promise<void>
                  • Parameters

                    • toJid: string

                    Returns Promise<void>

              • processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>
              • productCreate: (create: ProductCreate) => Promise<Product>
              • productDelete: (productIds: string[]) => Promise<{ deleted: number }>
                  • (productIds: string[]): Promise<{ deleted: number }>
                  • Parameters

                    • productIds: string[]

                    Returns Promise<{ deleted: number }>

              • productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>
              • profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>
                  • (jid: string, type?: "preview" | "image", timeoutMs?: number): Promise<string>
                  • fetch the profile picture of a user/group type = "preview" for a low res picture type = "image for the high res picture"

                    Parameters

                    • jid: string
                    • type: "preview" | "image" = 'preview'
                    • Optional timeoutMs: number

                    Returns Promise<string>

              • query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>
                  • send a query, and wait for its response. auto-generates message ID if not provided

                    Parameters

                    Returns Promise<BinaryNode>

              • refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>
              • relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>
              • resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>
              • resyncMainAppState: () => Promise<void>
                  • (): Promise<void>
                  • Returns Promise<void>

              • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>
              • sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>
                  • (__namedParameters: BinaryNode, extraAttrs: {}): Promise<void>
                  • Parameters

                    • __namedParameters: BinaryNode
                    • extraAttrs: {}
                      • [key: string]: string

                    Returns Promise<void>

              • sendNode: (node: BinaryNode) => Promise<void>
                  • send a binary node

                    Parameters

                    Returns Promise<void>

              • sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>
                  • Parameters

                    Returns Promise<void>

              • sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>
                  • (data: Buffer | Uint8Array): Promise<void>
                  • send a raw buffer

                    Parameters

                    • data: Buffer | Uint8Array

                    Returns Promise<void>

              • sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>
                  • (jid: string, participant: string, messageIds: string[]): Promise<void>
                  • Parameters

                    • jid: string
                    • participant: string
                    • messageIds: string[]

                    Returns Promise<void>

              • sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>
                  • (jid: string, participant: string, messageIds: string[], type: "read" | "read-self"): Promise<void>
                  • generic send receipt function used for receipts of phone call, read, delivery etc.

                    Parameters

                    • jid: string
                    • participant: string
                    • messageIds: string[]
                    • type: "read" | "read-self"

                    Returns Promise<void>

              • sendRetryRequest: (node: BinaryNode) => Promise<void>
              • type: "md"
              • updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>
                  • (jid: string, action: "block" | "unblock"): Promise<void>
                  • Parameters

                    • jid: string
                    • action: "block" | "unblock"

                    Returns Promise<void>

              • updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>
              • user: Contact
              • waUploadToServer: WAMediaUploadFunction
              • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
              • waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>
                  • (msgId: string, timeoutMs?: number): Promise<any>
                  • Wait for a message with a certain tag to be received

                    Parameters

                    • msgId: string
                    • timeoutMs: number = defaultQueryTimeoutMs

                      timeout after which the promise will reject

                    Returns Promise<any>

              • waitForSocketOpen: () => Promise<void>
                  • (): Promise<void>
                  • Returns Promise<void>

              • ws: WebSocket

            Returns Promise<string>

      • fetchMessageReceipts: (__namedParameters: IMessageKey, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IUserReceipt[]>
          • (__namedParameters: IMessageKey, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }): Promise<IUserReceipt[]>
          • Parameters

            • __namedParameters: IMessageKey
            • sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }
              • authInfo: LegacyAuthenticationCreds
              • blockUser: (jid: string, type?: "add" | "remove") => Promise<void>
                  • (jid: string, type?: "add" | "remove"): Promise<void>
                  • Add or remove user from blocklist

                    Parameters

                    • jid: string

                      the ID of the person who you are blocking/unblocking

                    • type: "add" | "remove" = 'add'

                      type of operation

                    Returns Promise<void>

              • canLogin: () => boolean
                  • (): boolean
                  • Can you login to WA without scanning the QR

                    Returns boolean

              • chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>
                  • (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number): Promise<void | { status: number }>
                  • Modify a given chat (archive, pin etc.)

                    Parameters

                    • modification: ChatModification
                    • jid: string

                      the ID of the person/group you are modifiying

                    • chatInfo: Pick<Chat, "mute" | "pin">
                    • Optional timestampNow: number

                    Returns Promise<void | { status: number }>

              • chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>
                  • (fromMessage: IMessageKey, count: number): Promise<void>
                  • Parameters

                    Returns Promise<void>

              • currentEpoch: () => number
                  • (): number
                  • Returns number

              • downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>
              • end: (error: Error) => void
                  • (error: Error): void
                  • Parameters

                    • error: Error

                    Returns void

              • ev: LegacyBaileysEventEmitter
              • fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>
              • generateMessageTag: (longTag?: boolean) => string
                  • (longTag?: boolean): string
                  • generate message tag and increment epoch

                    Parameters

                    • longTag: boolean = false

                    Returns string

              • generateUrlInfo: (text: string) => Promise<WAUrlInfo>
                  • Query a string to check if it has a url, if it does, return WAUrlInfo

                    Parameters

                    • text: string

                    Returns Promise<WAUrlInfo>

              • getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>
              • getBusinessProfile: (jid: string) => Promise<WABusinessProfile>
                  • Query Business Profile (Useful for VCards)

                    Parameters

                    • jid: string

                      Business Jid

                    Returns Promise<WABusinessProfile>

                    profile object or undefined if not business account

              • getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>
                  • (jid?: string, limit?: number): Promise<{ beforeCursor: string; products: Product[] }>
                  • Parameters

                    • Optional jid: string
                    • limit: number = 10

                    Returns Promise<{ beforeCursor: string; products: Product[] }>

              • getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>
                  • (orderId: string, tokenBase64: string): Promise<OrderDetails>
                  • Parameters

                    • orderId: string
                    • tokenBase64: string

                    Returns Promise<OrderDetails>

              • getStatus: (jid: string) => Promise<{ status: string }>
                  • (jid: string): Promise<{ status: string }>
                  • Query the status of the person (see groupMetadata() for groups)

                    Parameters

                    • jid: string

                    Returns Promise<{ status: string }>

              • groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>
                  • Create a group

                    Parameters

                    • title: string

                      like, the title of the group

                    • participants: string[]

                      people to include in the group

                    Returns Promise<GroupMetadata>

              • groupInviteCode: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Parameters

                    • jid: string

                    Returns Promise<string>

              • groupLeave: (id: string) => Promise<void>
                  • (id: string): Promise<void>
                  • Leave a group

                    Parameters

                    • id: string

                    Returns Promise<void>

              • groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>
              • groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>
                  • Update participants in the group

                    Parameters

                    Returns Promise<string[]>

              • groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>
                  • (jid: string, description: string): Promise<{ status: number }>
                  • Update the group description

                    Parameters

                    • jid: string

                      the ID of the group

                    • description: string

                    Returns Promise<{ status: number }>

              • groupUpdateSubject: (id: string, title: string) => Promise<void>
                  • (id: string, title: string): Promise<void>
                  • Update the subject of the group

                    Parameters

                    • id: string
                    • title: string

                      the new title of the group

                    Returns Promise<void>

              • loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>
                  • Load a single message specified by the ID

                    Parameters

                    • jid: string
                    • id: string

                    Returns Promise<WebMessageInfo>

              • logout: () => Promise<void>
                  • (): Promise<void>
                  • Logs you out from WA If connected, invalidates the credentials with the server

                    Returns Promise<void>

              • messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>
                  • Parameters

                    • jid: string
                    • messageID: string

                    Returns Promise<IUserReceipt[]>

              • onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • (str: string): Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • Query whether a given number is registered on WhatsApp

                    Parameters

                    • str: string

                      phone number/jid you want to check for

                    Returns Promise<{ exists: boolean; isBusiness: boolean; jid: string }>

                    undefined if the number doesn't exists, otherwise the correctly formatted jid

              • presenceSubscribe: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Request updates on the presence of a user this returns nothing, you'll receive updates in chats.update event

                    Parameters

                    • jid: string

                    Returns Promise<string>

              • productCreate: (product: ProductCreate) => Promise<Product>
              • productDelete: (productIds: string[]) => Promise<{ deleted: any }>
                  • (productIds: string[]): Promise<{ deleted: any }>
                  • Parameters

                    • productIds: string[]

                    Returns Promise<{ deleted: any }>

              • productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>
              • profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>
                  • (jid: string, timeoutMs?: number): Promise<string>
                  • Parameters

                    • jid: string
                    • Optional timeoutMs: number

                    Returns Promise<string>

              • query: (__namedParameters: SocketQueryOptions) => Promise<any>
              • relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>
                  • (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }): Promise<void>
                  • Relay (send) a WAMessage; more advanced functionality to send a built WA Message, you may want to stick with sendMessage()

                    Parameters

                    • message: IWebMessageInfo
                    • __namedParameters: { waitForAck: boolean } = ...
                      • waitForAck: boolean

                    Returns Promise<void>

              • searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • (txt: string, inJid: string, count: number, page: number): Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • Parameters

                    • txt: string
                    • inJid: string
                    • count: number
                    • page: number

                    Returns Promise<{ last: boolean; messages: WebMessageInfo[] }>

              • sendAdminTest: () => Promise<string>
                  • (): Promise<string>
                  • checks for phone connection

                    Returns Promise<string>

              • sendChatsQuery: (epoch: number) => Promise<string>
                  • (epoch: number): Promise<string>
                  • Parameters

                    • epoch: number

                    Returns Promise<string>

              • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>
              • sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>
              • sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>
                  • Tell someone about your presence -- online, typing, offline etc.

                    Parameters

                    • type: WAPresence

                      your presence

                    • jid: string

                      the ID of the person/group who you are updating

                    Returns Promise<string>

              • setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>
                  • (nodes: BinaryNode[], binaryTag?: WATag, tag?: string): Promise<{ status: number }>
                  • Generic function for action, set queries

                    Parameters

                    Returns Promise<{ status: number }>

              • setStatus: (status: string) => Promise<{ status: number }>
                  • (status: string): Promise<{ status: number }>
                  • Parameters

                    • status: string

                    Returns Promise<{ status: number }>

              • state: ConnectionState
              • type: "legacy"
              • updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>
              • updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }
                  • (info: { encKey: Buffer; macKey: Buffer }): { encKey: Buffer; macKey: Buffer }
                  • Parameters

                    • info: { encKey: Buffer; macKey: Buffer }
                      • encKey: Buffer
                      • macKey: Buffer

                    Returns { encKey: Buffer; macKey: Buffer }

                    • encKey: Buffer
                    • macKey: Buffer
              • updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>
              • updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>
                  • (name: string): Promise<{ pushname: string; status: number }>
                  • Parameters

                    • name: string

                    Returns Promise<{ pushname: string; status: number }>

              • waUploadToServer: WAMediaUploadFunction
              • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
              • waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }
                  • (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number): { cancelToken: () => void; promise: Promise<any> }
                  • Wait for a message with a certain tag to be received

                    Parameters

                    • tag: string

                      the message tag to await

                    • requiresPhoneConnection: boolean
                    • Optional timeoutMs: number

                      timeout after which the promise will reject

                    Returns { cancelToken: () => void; promise: Promise<any> }

                    • cancelToken: () => void
                        • (): void
                        • Returns void

                    • promise: Promise<any>
              • waitForSocketOpen: () => Promise<void>
                  • (): Promise<void>
                  • Returns Promise<void>

              • ws: WebSocket
              • updateProfilePicture:function
                • updateProfilePicture(jid: string, img: Buffer): Promise<void>

            Returns Promise<IUserReceipt[]>

      • fromJSON: (json: { chats: Chat[]; contacts: {}; messages: {} }) => void
          • (json: { chats: Chat[]; contacts: {}; messages: {} }): void
          • Parameters

            • json: { chats: Chat[]; contacts: {}; messages: {} }

            Returns void

      • groupMetadata: {}
      • loadMessage: (jid: string, id: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo>
          • (jid: string, id: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }): Promise<IWebMessageInfo>
          • Parameters

            • jid: string
            • id: string
            • sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }
              • authInfo: LegacyAuthenticationCreds
              • blockUser: (jid: string, type?: "add" | "remove") => Promise<void>
                  • (jid: string, type?: "add" | "remove"): Promise<void>
                  • Add or remove user from blocklist

                    Parameters

                    • jid: string

                      the ID of the person who you are blocking/unblocking

                    • type: "add" | "remove" = 'add'

                      type of operation

                    Returns Promise<void>

              • canLogin: () => boolean
                  • (): boolean
                  • Can you login to WA without scanning the QR

                    Returns boolean

              • chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>
                  • (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number): Promise<void | { status: number }>
                  • Modify a given chat (archive, pin etc.)

                    Parameters

                    • modification: ChatModification
                    • jid: string

                      the ID of the person/group you are modifiying

                    • chatInfo: Pick<Chat, "mute" | "pin">
                    • Optional timestampNow: number

                    Returns Promise<void | { status: number }>

              • chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>
                  • (fromMessage: IMessageKey, count: number): Promise<void>
                  • Parameters

                    Returns Promise<void>

              • currentEpoch: () => number
                  • (): number
                  • Returns number

              • downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>
              • end: (error: Error) => void
                  • (error: Error): void
                  • Parameters

                    • error: Error

                    Returns void

              • ev: LegacyBaileysEventEmitter
              • fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>
              • generateMessageTag: (longTag?: boolean) => string
                  • (longTag?: boolean): string
                  • generate message tag and increment epoch

                    Parameters

                    • longTag: boolean = false

                    Returns string

              • generateUrlInfo: (text: string) => Promise<WAUrlInfo>
                  • Query a string to check if it has a url, if it does, return WAUrlInfo

                    Parameters

                    • text: string

                    Returns Promise<WAUrlInfo>

              • getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>
              • getBusinessProfile: (jid: string) => Promise<WABusinessProfile>
                  • Query Business Profile (Useful for VCards)

                    Parameters

                    • jid: string

                      Business Jid

                    Returns Promise<WABusinessProfile>

                    profile object or undefined if not business account

              • getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>
                  • (jid?: string, limit?: number): Promise<{ beforeCursor: string; products: Product[] }>
                  • Parameters

                    • Optional jid: string
                    • limit: number = 10

                    Returns Promise<{ beforeCursor: string; products: Product[] }>

              • getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>
                  • (orderId: string, tokenBase64: string): Promise<OrderDetails>
                  • Parameters

                    • orderId: string
                    • tokenBase64: string

                    Returns Promise<OrderDetails>

              • getStatus: (jid: string) => Promise<{ status: string }>
                  • (jid: string): Promise<{ status: string }>
                  • Query the status of the person (see groupMetadata() for groups)

                    Parameters

                    • jid: string

                    Returns Promise<{ status: string }>

              • groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>
                  • Create a group

                    Parameters

                    • title: string

                      like, the title of the group

                    • participants: string[]

                      people to include in the group

                    Returns Promise<GroupMetadata>

              • groupInviteCode: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Parameters

                    • jid: string

                    Returns Promise<string>

              • groupLeave: (id: string) => Promise<void>
                  • (id: string): Promise<void>
                  • Leave a group

                    Parameters

                    • id: string

                    Returns Promise<void>

              • groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>
              • groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>
                  • Update participants in the group

                    Parameters

                    Returns Promise<string[]>

              • groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>
                  • (jid: string, description: string): Promise<{ status: number }>
                  • Update the group description

                    Parameters

                    • jid: string

                      the ID of the group

                    • description: string

                    Returns Promise<{ status: number }>

              • groupUpdateSubject: (id: string, title: string) => Promise<void>
                  • (id: string, title: string): Promise<void>
                  • Update the subject of the group

                    Parameters

                    • id: string
                    • title: string

                      the new title of the group

                    Returns Promise<void>

              • loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>
                  • Load a single message specified by the ID

                    Parameters

                    • jid: string
                    • id: string

                    Returns Promise<WebMessageInfo>

              • logout: () => Promise<void>
                  • (): Promise<void>
                  • Logs you out from WA If connected, invalidates the credentials with the server

                    Returns Promise<void>

              • messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>
                  • Parameters

                    • jid: string
                    • messageID: string

                    Returns Promise<IUserReceipt[]>

              • onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • (str: string): Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • Query whether a given number is registered on WhatsApp

                    Parameters

                    • str: string

                      phone number/jid you want to check for

                    Returns Promise<{ exists: boolean; isBusiness: boolean; jid: string }>

                    undefined if the number doesn't exists, otherwise the correctly formatted jid

              • presenceSubscribe: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Request updates on the presence of a user this returns nothing, you'll receive updates in chats.update event

                    Parameters

                    • jid: string

                    Returns Promise<string>

              • productCreate: (product: ProductCreate) => Promise<Product>
              • productDelete: (productIds: string[]) => Promise<{ deleted: any }>
                  • (productIds: string[]): Promise<{ deleted: any }>
                  • Parameters

                    • productIds: string[]

                    Returns Promise<{ deleted: any }>

              • productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>
              • profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>
                  • (jid: string, timeoutMs?: number): Promise<string>
                  • Parameters

                    • jid: string
                    • Optional timeoutMs: number

                    Returns Promise<string>

              • query: (__namedParameters: SocketQueryOptions) => Promise<any>
              • relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>
                  • (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }): Promise<void>
                  • Relay (send) a WAMessage; more advanced functionality to send a built WA Message, you may want to stick with sendMessage()

                    Parameters

                    • message: IWebMessageInfo
                    • __namedParameters: { waitForAck: boolean } = ...
                      • waitForAck: boolean

                    Returns Promise<void>

              • searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • (txt: string, inJid: string, count: number, page: number): Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • Parameters

                    • txt: string
                    • inJid: string
                    • count: number
                    • page: number

                    Returns Promise<{ last: boolean; messages: WebMessageInfo[] }>

              • sendAdminTest: () => Promise<string>
                  • (): Promise<string>
                  • checks for phone connection

                    Returns Promise<string>

              • sendChatsQuery: (epoch: number) => Promise<string>
                  • (epoch: number): Promise<string>
                  • Parameters

                    • epoch: number

                    Returns Promise<string>

              • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>
              • sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>
              • sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>
                  • Tell someone about your presence -- online, typing, offline etc.

                    Parameters

                    • type: WAPresence

                      your presence

                    • jid: string

                      the ID of the person/group who you are updating

                    Returns Promise<string>

              • setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>
                  • (nodes: BinaryNode[], binaryTag?: WATag, tag?: string): Promise<{ status: number }>
                  • Generic function for action, set queries

                    Parameters

                    Returns Promise<{ status: number }>

              • setStatus: (status: string) => Promise<{ status: number }>
                  • (status: string): Promise<{ status: number }>
                  • Parameters

                    • status: string

                    Returns Promise<{ status: number }>

              • state: ConnectionState
              • type: "legacy"
              • updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>
              • updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }
                  • (info: { encKey: Buffer; macKey: Buffer }): { encKey: Buffer; macKey: Buffer }
                  • Parameters

                    • info: { encKey: Buffer; macKey: Buffer }
                      • encKey: Buffer
                      • macKey: Buffer

                    Returns { encKey: Buffer; macKey: Buffer }

                    • encKey: Buffer
                    • macKey: Buffer
              • updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>
              • updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>
                  • (name: string): Promise<{ pushname: string; status: number }>
                  • Parameters

                    • name: string

                    Returns Promise<{ pushname: string; status: number }>

              • waUploadToServer: WAMediaUploadFunction
              • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
              • waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }
                  • (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number): { cancelToken: () => void; promise: Promise<any> }
                  • Wait for a message with a certain tag to be received

                    Parameters

                    • tag: string

                      the message tag to await

                    • requiresPhoneConnection: boolean
                    • Optional timeoutMs: number

                      timeout after which the promise will reject

                    Returns { cancelToken: () => void; promise: Promise<any> }

                    • cancelToken: () => void
                        • (): void
                        • Returns void

                    • promise: Promise<any>
              • waitForSocketOpen: () => Promise<void>
                  • (): Promise<void>
                  • Returns Promise<void>

              • ws: WebSocket
              • updateProfilePicture:function
                • updateProfilePicture(jid: string, img: Buffer): Promise<void>

            Returns Promise<IWebMessageInfo>

      • loadMessages: (jid: string, count: number, cursor: WAMessageCursor, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo[]>
          • (jid: string, count: number, cursor: WAMessageCursor, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }): Promise<IWebMessageInfo[]>
          • loads messages from the store, if not found -- uses the legacy connection

            Parameters

            • jid: string
            • count: number
            • cursor: WAMessageCursor
            • sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }
              • authInfo: LegacyAuthenticationCreds
              • blockUser: (jid: string, type?: "add" | "remove") => Promise<void>
                  • (jid: string, type?: "add" | "remove"): Promise<void>
                  • Add or remove user from blocklist

                    Parameters

                    • jid: string

                      the ID of the person who you are blocking/unblocking

                    • type: "add" | "remove" = 'add'

                      type of operation

                    Returns Promise<void>

              • canLogin: () => boolean
                  • (): boolean
                  • Can you login to WA without scanning the QR

                    Returns boolean

              • chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>
                  • (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number): Promise<void | { status: number }>
                  • Modify a given chat (archive, pin etc.)

                    Parameters

                    • modification: ChatModification
                    • jid: string

                      the ID of the person/group you are modifiying

                    • chatInfo: Pick<Chat, "mute" | "pin">
                    • Optional timestampNow: number

                    Returns Promise<void | { status: number }>

              • chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>
                  • (fromMessage: IMessageKey, count: number): Promise<void>
                  • Parameters

                    Returns Promise<void>

              • currentEpoch: () => number
                  • (): number
                  • Returns number

              • downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>
              • end: (error: Error) => void
                  • (error: Error): void
                  • Parameters

                    • error: Error

                    Returns void

              • ev: LegacyBaileysEventEmitter
              • fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>
              • generateMessageTag: (longTag?: boolean) => string
                  • (longTag?: boolean): string
                  • generate message tag and increment epoch

                    Parameters

                    • longTag: boolean = false

                    Returns string

              • generateUrlInfo: (text: string) => Promise<WAUrlInfo>
                  • Query a string to check if it has a url, if it does, return WAUrlInfo

                    Parameters

                    • text: string

                    Returns Promise<WAUrlInfo>

              • getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>
              • getBusinessProfile: (jid: string) => Promise<WABusinessProfile>
                  • Query Business Profile (Useful for VCards)

                    Parameters

                    • jid: string

                      Business Jid

                    Returns Promise<WABusinessProfile>

                    profile object or undefined if not business account

              • getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>
                  • (jid?: string, limit?: number): Promise<{ beforeCursor: string; products: Product[] }>
                  • Parameters

                    • Optional jid: string
                    • limit: number = 10

                    Returns Promise<{ beforeCursor: string; products: Product[] }>

              • getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>
                  • (orderId: string, tokenBase64: string): Promise<OrderDetails>
                  • Parameters

                    • orderId: string
                    • tokenBase64: string

                    Returns Promise<OrderDetails>

              • getStatus: (jid: string) => Promise<{ status: string }>
                  • (jid: string): Promise<{ status: string }>
                  • Query the status of the person (see groupMetadata() for groups)

                    Parameters

                    • jid: string

                    Returns Promise<{ status: string }>

              • groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>
                  • Create a group

                    Parameters

                    • title: string

                      like, the title of the group

                    • participants: string[]

                      people to include in the group

                    Returns Promise<GroupMetadata>

              • groupInviteCode: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Parameters

                    • jid: string

                    Returns Promise<string>

              • groupLeave: (id: string) => Promise<void>
                  • (id: string): Promise<void>
                  • Leave a group

                    Parameters

                    • id: string

                    Returns Promise<void>

              • groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>
              • groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>
                  • Update participants in the group

                    Parameters

                    Returns Promise<string[]>

              • groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>
                  • (jid: string, description: string): Promise<{ status: number }>
                  • Update the group description

                    Parameters

                    • jid: string

                      the ID of the group

                    • description: string

                    Returns Promise<{ status: number }>

              • groupUpdateSubject: (id: string, title: string) => Promise<void>
                  • (id: string, title: string): Promise<void>
                  • Update the subject of the group

                    Parameters

                    • id: string
                    • title: string

                      the new title of the group

                    Returns Promise<void>

              • loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>
                  • Load a single message specified by the ID

                    Parameters

                    • jid: string
                    • id: string

                    Returns Promise<WebMessageInfo>

              • logout: () => Promise<void>
                  • (): Promise<void>
                  • Logs you out from WA If connected, invalidates the credentials with the server

                    Returns Promise<void>

              • messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>
                  • Parameters

                    • jid: string
                    • messageID: string

                    Returns Promise<IUserReceipt[]>

              • onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • (str: string): Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • Query whether a given number is registered on WhatsApp

                    Parameters

                    • str: string

                      phone number/jid you want to check for

                    Returns Promise<{ exists: boolean; isBusiness: boolean; jid: string }>

                    undefined if the number doesn't exists, otherwise the correctly formatted jid

              • presenceSubscribe: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Request updates on the presence of a user this returns nothing, you'll receive updates in chats.update event

                    Parameters

                    • jid: string

                    Returns Promise<string>

              • productCreate: (product: ProductCreate) => Promise<Product>
              • productDelete: (productIds: string[]) => Promise<{ deleted: any }>
                  • (productIds: string[]): Promise<{ deleted: any }>
                  • Parameters

                    • productIds: string[]

                    Returns Promise<{ deleted: any }>

              • productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>
              • profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>
                  • (jid: string, timeoutMs?: number): Promise<string>
                  • Parameters

                    • jid: string
                    • Optional timeoutMs: number

                    Returns Promise<string>

              • query: (__namedParameters: SocketQueryOptions) => Promise<any>
              • relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>
                  • (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }): Promise<void>
                  • Relay (send) a WAMessage; more advanced functionality to send a built WA Message, you may want to stick with sendMessage()

                    Parameters

                    • message: IWebMessageInfo
                    • __namedParameters: { waitForAck: boolean } = ...
                      • waitForAck: boolean

                    Returns Promise<void>

              • searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • (txt: string, inJid: string, count: number, page: number): Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • Parameters

                    • txt: string
                    • inJid: string
                    • count: number
                    • page: number

                    Returns Promise<{ last: boolean; messages: WebMessageInfo[] }>

              • sendAdminTest: () => Promise<string>
                  • (): Promise<string>
                  • checks for phone connection

                    Returns Promise<string>

              • sendChatsQuery: (epoch: number) => Promise<string>
                  • (epoch: number): Promise<string>
                  • Parameters

                    • epoch: number

                    Returns Promise<string>

              • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>
              • sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>
              • sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>
                  • Tell someone about your presence -- online, typing, offline etc.

                    Parameters

                    • type: WAPresence

                      your presence

                    • jid: string

                      the ID of the person/group who you are updating

                    Returns Promise<string>

              • setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>
                  • (nodes: BinaryNode[], binaryTag?: WATag, tag?: string): Promise<{ status: number }>
                  • Generic function for action, set queries

                    Parameters

                    Returns Promise<{ status: number }>

              • setStatus: (status: string) => Promise<{ status: number }>
                  • (status: string): Promise<{ status: number }>
                  • Parameters

                    • status: string

                    Returns Promise<{ status: number }>

              • state: ConnectionState
              • type: "legacy"
              • updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>
              • updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }
                  • (info: { encKey: Buffer; macKey: Buffer }): { encKey: Buffer; macKey: Buffer }
                  • Parameters

                    • info: { encKey: Buffer; macKey: Buffer }
                      • encKey: Buffer
                      • macKey: Buffer

                    Returns { encKey: Buffer; macKey: Buffer }

                    • encKey: Buffer
                    • macKey: Buffer
              • updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>
              • updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>
                  • (name: string): Promise<{ pushname: string; status: number }>
                  • Parameters

                    • name: string

                    Returns Promise<{ pushname: string; status: number }>

              • waUploadToServer: WAMediaUploadFunction
              • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
              • waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }
                  • (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number): { cancelToken: () => void; promise: Promise<any> }
                  • Wait for a message with a certain tag to be received

                    Parameters

                    • tag: string

                      the message tag to await

                    • requiresPhoneConnection: boolean
                    • Optional timeoutMs: number

                      timeout after which the promise will reject

                    Returns { cancelToken: () => void; promise: Promise<any> }

                    • cancelToken: () => void
                        • (): void
                        • Returns void

                    • promise: Promise<any>
              • waitForSocketOpen: () => Promise<void>
                  • (): Promise<void>
                  • Returns Promise<void>

              • ws: WebSocket
              • updateProfilePicture:function
                • updateProfilePicture(jid: string, img: Buffer): Promise<void>

            Returns Promise<IWebMessageInfo[]>

      • messages: {}
        • [_: string]: ReturnType<typeof makeMessagesDictionary>
      • mostRecentMessage: (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }) => Promise<IWebMessageInfo>
          • (jid: string, sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }): Promise<IWebMessageInfo>
          • Parameters

            • jid: string
            • sock: { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }
              • authInfo: LegacyAuthenticationCreds
              • blockUser: (jid: string, type?: "add" | "remove") => Promise<void>
                  • (jid: string, type?: "add" | "remove"): Promise<void>
                  • Add or remove user from blocklist

                    Parameters

                    • jid: string

                      the ID of the person who you are blocking/unblocking

                    • type: "add" | "remove" = 'add'

                      type of operation

                    Returns Promise<void>

              • canLogin: () => boolean
                  • (): boolean
                  • Can you login to WA without scanning the QR

                    Returns boolean

              • chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>
                  • (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number): Promise<void | { status: number }>
                  • Modify a given chat (archive, pin etc.)

                    Parameters

                    • modification: ChatModification
                    • jid: string

                      the ID of the person/group you are modifiying

                    • chatInfo: Pick<Chat, "mute" | "pin">
                    • Optional timestampNow: number

                    Returns Promise<void | { status: number }>

              • chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>
                  • (fromMessage: IMessageKey, count: number): Promise<void>
                  • Parameters

                    Returns Promise<void>

              • currentEpoch: () => number
                  • (): number
                  • Returns number

              • downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>
              • end: (error: Error) => void
                  • (error: Error): void
                  • Parameters

                    • error: Error

                    Returns void

              • ev: LegacyBaileysEventEmitter
              • fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>
              • generateMessageTag: (longTag?: boolean) => string
                  • (longTag?: boolean): string
                  • generate message tag and increment epoch

                    Parameters

                    • longTag: boolean = false

                    Returns string

              • generateUrlInfo: (text: string) => Promise<WAUrlInfo>
                  • Query a string to check if it has a url, if it does, return WAUrlInfo

                    Parameters

                    • text: string

                    Returns Promise<WAUrlInfo>

              • getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>
              • getBusinessProfile: (jid: string) => Promise<WABusinessProfile>
                  • Query Business Profile (Useful for VCards)

                    Parameters

                    • jid: string

                      Business Jid

                    Returns Promise<WABusinessProfile>

                    profile object or undefined if not business account

              • getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>
                  • (jid?: string, limit?: number): Promise<{ beforeCursor: string; products: Product[] }>
                  • Parameters

                    • Optional jid: string
                    • limit: number = 10

                    Returns Promise<{ beforeCursor: string; products: Product[] }>

              • getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>
                  • (orderId: string, tokenBase64: string): Promise<OrderDetails>
                  • Parameters

                    • orderId: string
                    • tokenBase64: string

                    Returns Promise<OrderDetails>

              • getStatus: (jid: string) => Promise<{ status: string }>
                  • (jid: string): Promise<{ status: string }>
                  • Query the status of the person (see groupMetadata() for groups)

                    Parameters

                    • jid: string

                    Returns Promise<{ status: string }>

              • groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>
                  • Create a group

                    Parameters

                    • title: string

                      like, the title of the group

                    • participants: string[]

                      people to include in the group

                    Returns Promise<GroupMetadata>

              • groupInviteCode: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Parameters

                    • jid: string

                    Returns Promise<string>

              • groupLeave: (id: string) => Promise<void>
                  • (id: string): Promise<void>
                  • Leave a group

                    Parameters

                    • id: string

                    Returns Promise<void>

              • groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>
              • groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>
                  • Update participants in the group

                    Parameters

                    Returns Promise<string[]>

              • groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>
                  • (jid: string, description: string): Promise<{ status: number }>
                  • Update the group description

                    Parameters

                    • jid: string

                      the ID of the group

                    • description: string

                    Returns Promise<{ status: number }>

              • groupUpdateSubject: (id: string, title: string) => Promise<void>
                  • (id: string, title: string): Promise<void>
                  • Update the subject of the group

                    Parameters

                    • id: string
                    • title: string

                      the new title of the group

                    Returns Promise<void>

              • loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>
                  • Load a single message specified by the ID

                    Parameters

                    • jid: string
                    • id: string

                    Returns Promise<WebMessageInfo>

              • logout: () => Promise<void>
                  • (): Promise<void>
                  • Logs you out from WA If connected, invalidates the credentials with the server

                    Returns Promise<void>

              • messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>
                  • Parameters

                    • jid: string
                    • messageID: string

                    Returns Promise<IUserReceipt[]>

              • onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • (str: string): Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
                  • Query whether a given number is registered on WhatsApp

                    Parameters

                    • str: string

                      phone number/jid you want to check for

                    Returns Promise<{ exists: boolean; isBusiness: boolean; jid: string }>

                    undefined if the number doesn't exists, otherwise the correctly formatted jid

              • presenceSubscribe: (jid: string) => Promise<string>
                  • (jid: string): Promise<string>
                  • Request updates on the presence of a user this returns nothing, you'll receive updates in chats.update event

                    Parameters

                    • jid: string

                    Returns Promise<string>

              • productCreate: (product: ProductCreate) => Promise<Product>
              • productDelete: (productIds: string[]) => Promise<{ deleted: any }>
                  • (productIds: string[]): Promise<{ deleted: any }>
                  • Parameters

                    • productIds: string[]

                    Returns Promise<{ deleted: any }>

              • productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>
              • profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>
                  • (jid: string, timeoutMs?: number): Promise<string>
                  • Parameters

                    • jid: string
                    • Optional timeoutMs: number

                    Returns Promise<string>

              • query: (__namedParameters: SocketQueryOptions) => Promise<any>
              • relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>
                  • (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }): Promise<void>
                  • Relay (send) a WAMessage; more advanced functionality to send a built WA Message, you may want to stick with sendMessage()

                    Parameters

                    • message: IWebMessageInfo
                    • __namedParameters: { waitForAck: boolean } = ...
                      • waitForAck: boolean

                    Returns Promise<void>

              • searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • (txt: string, inJid: string, count: number, page: number): Promise<{ last: boolean; messages: WebMessageInfo[] }>
                  • Parameters

                    • txt: string
                    • inJid: string
                    • count: number
                    • page: number

                    Returns Promise<{ last: boolean; messages: WebMessageInfo[] }>

              • sendAdminTest: () => Promise<string>
                  • (): Promise<string>
                  • checks for phone connection

                    Returns Promise<string>

              • sendChatsQuery: (epoch: number) => Promise<string>
                  • (epoch: number): Promise<string>
                  • Parameters

                    • epoch: number

                    Returns Promise<string>

              • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>
              • sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>
              • sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>
                  • Tell someone about your presence -- online, typing, offline etc.

                    Parameters

                    • type: WAPresence

                      your presence

                    • jid: string

                      the ID of the person/group who you are updating

                    Returns Promise<string>

              • setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>
                  • (nodes: BinaryNode[], binaryTag?: WATag, tag?: string): Promise<{ status: number }>
                  • Generic function for action, set queries

                    Parameters

                    Returns Promise<{ status: number }>

              • setStatus: (status: string) => Promise<{ status: number }>
                  • (status: string): Promise<{ status: number }>
                  • Parameters

                    • status: string

                    Returns Promise<{ status: number }>

              • state: ConnectionState
              • type: "legacy"
              • updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>
              • updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }
                  • (info: { encKey: Buffer; macKey: Buffer }): { encKey: Buffer; macKey: Buffer }
                  • Parameters

                    • info: { encKey: Buffer; macKey: Buffer }
                      • encKey: Buffer
                      • macKey: Buffer

                    Returns { encKey: Buffer; macKey: Buffer }

                    • encKey: Buffer
                    • macKey: Buffer
              • updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>
              • updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>
                  • (name: string): Promise<{ pushname: string; status: number }>
                  • Parameters

                    • name: string

                    Returns Promise<{ pushname: string; status: number }>

              • waUploadToServer: WAMediaUploadFunction
              • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
              • waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }
                  • (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number): { cancelToken: () => void; promise: Promise<any> }
                  • Wait for a message with a certain tag to be received

                    Parameters

                    • tag: string

                      the message tag to await

                    • requiresPhoneConnection: boolean
                    • Optional timeoutMs: number

                      timeout after which the promise will reject

                    Returns { cancelToken: () => void; promise: Promise<any> }

                    • cancelToken: () => void
                        • (): void
                        • Returns void

                    • promise: Promise<any>
              • waitForSocketOpen: () => Promise<void>
                  • (): Promise<void>
                  • Returns Promise<void>

              • ws: WebSocket
              • updateProfilePicture:function
                • updateProfilePicture(jid: string, img: Buffer): Promise<void>

            Returns Promise<IWebMessageInfo>

      • presences: {}
      • readFromFile: (path: string) => void
          • (path: string): void
          • Parameters

            • path: string

            Returns void

      • state: ConnectionState
      • toJSON: () => { chats: default<Chat, string>; contacts: {}; messages: {} }
          • (): { chats: default<Chat, string>; contacts: {}; messages: {} }
          • Returns { chats: default<Chat, string>; contacts: {}; messages: {} }

            • chats: default<Chat, string>
            • contacts: {}
            • messages: {}
              • [_: string]: ReturnType<typeof makeMessagesDictionary>
      • writeToFile: (path: string) => void
          • (path: string): void
          • Parameters

            • path: string

            Returns void

Variables

Browsers: { appropriate: (browser: any) => [string, string, string]; baileys: (browser: any) => [string, string, string]; macOS: (browser: any) => [string, string, string]; ubuntu: (browser: any) => [string, string, string] } = ...

Type declaration

  • appropriate: (browser: any) => [string, string, string]
      • (browser: any): [string, string, string]
      • The appropriate browser based on your OS & release

        Parameters

        • browser: any

        Returns [string, string, string]

  • baileys: (browser: any) => [string, string, string]
      • (browser: any): [string, string, string]
      • Parameters

        • browser: any

        Returns [string, string, string]

  • macOS: (browser: any) => [string, string, string]
      • (browser: any): [string, string, string]
      • Parameters

        • browser: any

        Returns [string, string, string]

  • ubuntu: (browser: any) => [string, string, string]
      • (browser: any): [string, string, string]
      • Parameters

        • browser: any

        Returns [string, string, string]

BufferJSON: { replacer: (k: any, value: any) => any; reviver: (_: any, value: any) => any } = ...

Type declaration

  • replacer: (k: any, value: any) => any
      • (k: any, value: any): any
      • Parameters

        • k: any
        • value: any

        Returns any

  • reviver: (_: any, value: any) => any
      • (_: any, value: any): any
      • Parameters

        • _: any
        • value: any

        Returns any

Curve: { generateKeyPair: () => KeyPair; sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer; sign: (privateKey: Uint8Array, buf: Uint8Array) => Buffer; verify: (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean } = ...

Type declaration

  • generateKeyPair: () => KeyPair
  • sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer
      • (privateKey: Uint8Array, publicKey: Uint8Array): Buffer
      • Parameters

        • privateKey: Uint8Array
        • publicKey: Uint8Array

        Returns Buffer

  • sign: (privateKey: Uint8Array, buf: Uint8Array) => Buffer
      • (privateKey: Uint8Array, buf: Uint8Array): Buffer
      • Parameters

        • privateKey: Uint8Array
        • buf: Uint8Array

        Returns Buffer

  • verify: (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean
      • (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean
      • Parameters

        • pubKey: Uint8Array
        • message: Uint8Array
        • signature: Uint8Array

        Returns boolean

DEFAULT_CONNECTION_CONFIG: SocketConfig = ...
DEFAULT_LEGACY_CONNECTION_CONFIG: LegacySocketConfig = ...
DEFAULT_ORIGIN: "https://web.whatsapp.com" = 'https://web.whatsapp.com'
DEF_CALLBACK_PREFIX: "CB:" = 'CB:'
DEF_TAG_PREFIX: "TAG:" = 'TAG:'
KEY_BUNDLE_TYPE: "\u0005" = ''
LT_HASH_ANTI_TAMPERING: d = ...
MEDIA_KEYS: MediaType[] = ...
MEDIA_PATH_MAP: { [ T in MediaType]: string } = ...
NOISE_MODE: "Noise_XX_25519_AESGCM_SHA256\u0000\u0000\u0000\u0000" = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0'
NOISE_WA_HEADER: Uint8Array = ...
OFFICIAL_BIZ_JID: "16505361212@c.us" = '16505361212@c.us'
PHONE_CONNECTION_CB: "CB:Pong" = 'CB:Pong'
PSA_WID: "0@c.us" = '0@c.us'
SERVER_JID: "server@c.us" = 'server@c.us'
STORIES_JID: "status@broadcast" = 'status@broadcast'
S_WHATSAPP_NET: "@s.whatsapp.net" = '@s.whatsapp.net'
UNAUTHORIZED_CODES: number[] = ...
URL_REGEX: RegExp = ...
WA_DEFAULT_EPHEMERAL: number = ...

Functions

  • aesDecrypt(buffer: Buffer, key: Buffer): Buffer
  • decrypt AES 256 CBC; where the IV is prefixed to the buffer

    Parameters

    • buffer: Buffer
    • key: Buffer

    Returns Buffer

  • aesDecryptWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer
  • decrypt AES 256 CBC

    Parameters

    • buffer: Buffer
    • key: Buffer
    • IV: Buffer

    Returns Buffer

  • aesEncrypWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer
  • aesEncrypt(buffer: Buffer | Uint8Array, key: Buffer): Buffer
  • areJidsSameUser(jid1: string, jid2: string): boolean
  • createSignalIdentity(wid: string, accountSignatureKey: Uint8Array): SignalIdentity
  • debouncedTimeout(intervalMs?: number, task?: () => void): { cancel: () => void; setInterval: (newInterval: number) => number; setTask: (newTask: () => void) => () => void; start: (newIntervalMs?: number, newTask?: () => void) => void }
  • Parameters

    • intervalMs: number = 1000
    • task: () => void = undefined
        • (): void
        • Returns void

    Returns { cancel: () => void; setInterval: (newInterval: number) => number; setTask: (newTask: () => void) => () => void; start: (newIntervalMs?: number, newTask?: () => void) => void }

    • cancel: () => void
        • (): void
        • Returns void

    • setInterval: (newInterval: number) => number
        • (newInterval: number): number
        • Parameters

          • newInterval: number

          Returns number

    • setTask: (newTask: () => void) => () => void
        • (newTask: () => void): () => void
        • Parameters

          • newTask: () => void
              • (): void
              • Returns void

          Returns () => void

            • (): void
            • Returns void

    • start: (newIntervalMs?: number, newTask?: () => void) => void
        • (newIntervalMs?: number, newTask?: () => void): void
        • Parameters

          • Optional newIntervalMs: number
          • Optional newTask: () => void
              • (): void
              • Returns void

          Returns void

  • decodeBinaryNodeLegacy(buffer: Buffer, indexRef: { index: number }): BinaryNode
  • decodeWAMessage(message: string | Buffer, auth: { encKey: Buffer; macKey: Buffer }, fromMe?: boolean): readonly [string, any, WATag]
  • Parameters

    • message: string | Buffer
    • auth: { encKey: Buffer; macKey: Buffer }
      • encKey: Buffer
      • macKey: Buffer
    • fromMe: boolean = false

    Returns readonly [string, any, WATag]

  • decryptGroupSignalProto(group: string, user: string, msg: Buffer | Uint8Array, auth: SignalAuthState): any
  • decryptSignalProto(user: string, type: "pkmsg" | "msg", msg: Buffer | Uint8Array, auth: SignalAuthState): Promise<Buffer>
  • default(config: Partial<SocketConfig>): { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }
  • Parameters

    Returns { appPatch: (patchCreate: WAPatchCreate) => Promise<void>; assertSessions: (jids: string[], force: boolean) => Promise<boolean>; assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>; authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }; chatModify: (mod: ChatModification, jid: string) => Promise<void>; end: (error: Error) => void; ev: BaileysEventEmitter; fetchBlocklist: () => Promise<string[]>; fetchPrivacySettings: (force?: boolean) => Promise<{}>; fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>; generateMessageTag: () => string; getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>; getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; groupAcceptInvite: (code: string) => Promise<string>; groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>; groupFetchAllParticipating: () => Promise<{}>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string) => Promise<GroupMetadata>; groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupRevokeInvite: (jid: string) => Promise<string>; groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>; groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>; groupUpdateDescription: (jid: string, description?: string) => Promise<void>; groupUpdateSubject: (jid: string, subject: string) => Promise<void>; logout: () => Promise<void>; onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>; presenceSubscribe: (toJid: string) => Promise<void>; processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>; productCreate: (create: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: number }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>; query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>; refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>; relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>; resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>; resyncMainAppState: () => Promise<void>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>; sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>; sendNode: (node: BinaryNode) => Promise<void>; sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>; sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>; sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>; sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>; sendRetryRequest: (node: BinaryNode) => Promise<void>; type: "md"; updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>; updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>; user: Contact; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>; waitForSocketOpen: () => Promise<void>; ws: WebSocket }

    • appPatch: (patchCreate: WAPatchCreate) => Promise<void>
    • assertSessions: (jids: string[], force: boolean) => Promise<boolean>
        • (jids: string[], force: boolean): Promise<boolean>
        • Parameters

          • jids: string[]
          • force: boolean

          Returns Promise<boolean>

    • assertingPreKeys: (range: number, execute: (keys: {}) => Promise<void>) => Promise<void>
        • (range: number, execute: (keys: {}) => Promise<void>): Promise<void>
        • get some pre-keys and do something with them

          Parameters

          • range: number
          • execute: (keys: {}) => Promise<void>
              • (keys: {}): Promise<void>
              • Parameters

                • keys: {}
                  • [_: number]: any

                Returns Promise<void>

          Returns Promise<void>

    • authState: { creds: AuthenticationCreds; keys: SignalKeyStoreWithTransaction }
    • chatModify: (mod: ChatModification, jid: string) => Promise<void>
        • modify a chat -- mark unread, read etc. lastMessages must be sorted in reverse chronologically requires the last messages till the last message received; required for archive & unread

          Parameters

          Returns Promise<void>

    • end: (error: Error) => void
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    • ev: BaileysEventEmitter
    • fetchBlocklist: () => Promise<string[]>
        • (): Promise<string[]>
        • Returns Promise<string[]>

    • fetchPrivacySettings: (force?: boolean) => Promise<{}>
        • (force?: boolean): Promise<{}>
        • Parameters

          • force: boolean = false

          Returns Promise<{}>

    • fetchStatus: (jid: string) => Promise<{ setAt: Date; status: string }>
        • (jid: string): Promise<{ setAt: Date; status: string }>
        • Parameters

          • jid: string

          Returns Promise<{ setAt: Date; status: string }>

    • generateMessageTag: () => string
        • (): string
        • Returns string

    • getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>
    • getCatalog: (jid?: string, limit?: number) => Promise<{ products: Product[] }>
        • (jid?: string, limit?: number): Promise<{ products: Product[] }>
        • Parameters

          • Optional jid: string
          • limit: number = 10

          Returns Promise<{ products: Product[] }>

    • getCollections: (jid?: string, limit?: number) => Promise<{ collections: CatalogCollection[] }>
        • Parameters

          • Optional jid: string
          • limit: number = 51

          Returns Promise<{ collections: CatalogCollection[] }>

    • getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>
        • (orderId: string, tokenBase64: string): Promise<OrderDetails>
        • Parameters

          • orderId: string
          • tokenBase64: string

          Returns Promise<OrderDetails>

    • groupAcceptInvite: (code: string) => Promise<string>
        • (code: string): Promise<string>
        • Parameters

          • code: string

          Returns Promise<string>

    • groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>
        • (subject: string, participants: string[]): Promise<GroupMetadata>
        • Parameters

          • subject: string
          • participants: string[]

          Returns Promise<GroupMetadata>

    • groupFetchAllParticipating: () => Promise<{}>
        • (): Promise<{}>
        • Returns Promise<{}>

    • groupInviteCode: (jid: string) => Promise<string>
        • (jid: string): Promise<string>
        • Parameters

          • jid: string

          Returns Promise<string>

    • groupLeave: (id: string) => Promise<void>
        • (id: string): Promise<void>
        • Parameters

          • id: string

          Returns Promise<void>

    • groupMetadata: (jid: string) => Promise<GroupMetadata>
    • groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<string[]>
        • Parameters

          Returns Promise<string[]>

    • groupRevokeInvite: (jid: string) => Promise<string>
        • (jid: string): Promise<string>
        • Parameters

          • jid: string

          Returns Promise<string>

    • groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>
        • (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked"): Promise<void>
        • Parameters

          • jid: string
          • setting: "announcement" | "not_announcement" | "locked" | "unlocked"

          Returns Promise<void>

    • groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>
        • (jid: string, ephemeralExpiration: number): Promise<void>
        • Parameters

          • jid: string
          • ephemeralExpiration: number

          Returns Promise<void>

    • groupUpdateDescription: (jid: string, description?: string) => Promise<void>
        • (jid: string, description?: string): Promise<void>
        • Parameters

          • jid: string
          • Optional description: string

          Returns Promise<void>

    • groupUpdateSubject: (jid: string, subject: string) => Promise<void>
        • (jid: string, subject: string): Promise<void>
        • Parameters

          • jid: string
          • subject: string

          Returns Promise<void>

    • logout: () => Promise<void>
        • (): Promise<void>
        • logout & invalidate connection

          Returns Promise<void>

    • onWhatsApp: (...jids: string[]) => Promise<{ exists: boolean; jid: string }[]>
        • (...jids: string[]): Promise<{ exists: boolean; jid: string }[]>
        • Parameters

          • Rest ...jids: string[]

          Returns Promise<{ exists: boolean; jid: string }[]>

    • presenceSubscribe: (toJid: string) => Promise<void>
        • (toJid: string): Promise<void>
        • Parameters

          • toJid: string

          Returns Promise<void>

    • processMessage: (message: IWebMessageInfo, chatUpdate: Partial<Chat>) => Promise<void>
    • productCreate: (create: ProductCreate) => Promise<Product>
    • productDelete: (productIds: string[]) => Promise<{ deleted: number }>
        • (productIds: string[]): Promise<{ deleted: number }>
        • Parameters

          • productIds: string[]

          Returns Promise<{ deleted: number }>

    • productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>
    • profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string>
        • (jid: string, type?: "preview" | "image", timeoutMs?: number): Promise<string>
        • fetch the profile picture of a user/group type = "preview" for a low res picture type = "image for the high res picture"

          Parameters

          • jid: string
          • type: "preview" | "image" = 'preview'
          • Optional timeoutMs: number

          Returns Promise<string>

    • query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>
        • send a query, and wait for its response. auto-generates message ID if not provided

          Parameters

          Returns Promise<BinaryNode>

    • refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>
    • relayMessage: (jid: string, message: IMessage, __namedParameters: MessageRelayOptions) => Promise<string>
    • resyncAppState: (collections: WAPatchName[]) => Promise<AppStateChunk>
    • resyncMainAppState: () => Promise<void>
        • (): Promise<void>
        • Returns Promise<void>

    • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WebMessageInfo>
    • sendMessageAck: (__namedParameters: BinaryNode, extraAttrs: {}) => Promise<void>
        • (__namedParameters: BinaryNode, extraAttrs: {}): Promise<void>
        • Parameters

          • __namedParameters: BinaryNode
          • extraAttrs: {}
            • [key: string]: string

          Returns Promise<void>

    • sendNode: (node: BinaryNode) => Promise<void>
        • send a binary node

          Parameters

          Returns Promise<void>

    • sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>
        • Parameters

          Returns Promise<void>

    • sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>
        • (data: Buffer | Uint8Array): Promise<void>
        • send a raw buffer

          Parameters

          • data: Buffer | Uint8Array

          Returns Promise<void>

    • sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise<void>
        • (jid: string, participant: string, messageIds: string[]): Promise<void>
        • Parameters

          • jid: string
          • participant: string
          • messageIds: string[]

          Returns Promise<void>

    • sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise<void>
        • (jid: string, participant: string, messageIds: string[], type: "read" | "read-self"): Promise<void>
        • generic send receipt function used for receipts of phone call, read, delivery etc.

          Parameters

          • jid: string
          • participant: string
          • messageIds: string[]
          • type: "read" | "read-self"

          Returns Promise<void>

    • sendRetryRequest: (node: BinaryNode) => Promise<void>
    • type: "md"
    • updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>
        • (jid: string, action: "block" | "unblock"): Promise<void>
        • Parameters

          • jid: string
          • action: "block" | "unblock"

          Returns Promise<void>

    • updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>
    • user: Contact
    • waUploadToServer: WAMediaUploadFunction
    • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
    • waitForMessage: (msgId: string, timeoutMs?: number) => Promise<any>
        • (msgId: string, timeoutMs?: number): Promise<any>
        • Wait for a message with a certain tag to be received

          Parameters

          • msgId: string
          • timeoutMs: number = defaultQueryTimeoutMs

            timeout after which the promise will reject

          Returns Promise<any>

    • waitForSocketOpen: () => Promise<void>
        • (): Promise<void>
        • Returns Promise<void>

    • ws: WebSocket
  • delay(ms: number): Promise<void>
  • delayCancellable(ms: number): { cancel: () => void; delay: Promise<void> }
  • Parameters

    • ms: number

    Returns { cancel: () => void; delay: Promise<void> }

    • cancel: () => void
        • (): void
        • Returns void

    • delay: Promise<void>
  • encodeBigEndian(e: number, t?: number): Uint8Array
  • encodeBinaryNodeLegacy(__namedParameters: BinaryNode, buffer?: number[]): Buffer
  • encodeInt(e: number, t: number): Uint8Array
  • encodeWAMessage(message: IMessage): Buffer
  • encryptSenderKeyMsgSignalProto(group: string, data: Buffer | Uint8Array, meId: string, auth: SignalAuthState): Promise<{ ciphertext: Uint8Array; senderKeyDistributionMessageKey: Buffer }>
  • Parameters

    Returns Promise<{ ciphertext: Uint8Array; senderKeyDistributionMessageKey: Buffer }>

  • encryptSignalProto(user: string, buffer: Buffer, auth: SignalAuthState): Promise<{ ciphertext: Buffer; type: string }>
  • encryptedStream(media: WAMediaUpload, mediaType: MediaType, saveOriginalFileIfRequired?: boolean, logger?: Logger<LoggerOptions>): Promise<{ bodyPath: string; didSaveToTmpPath: boolean; encWriteStream: Readable; fileEncSha256: Buffer; fileLength: number; fileSha256: Buffer; mac: Buffer; mediaKey: Buffer }>
  • Parameters

    • media: WAMediaUpload
    • mediaType: MediaType
    • saveOriginalFileIfRequired: boolean = true
    • Optional logger: Logger<LoggerOptions>

    Returns Promise<{ bodyPath: string; didSaveToTmpPath: boolean; encWriteStream: Readable; fileEncSha256: Buffer; fileLength: number; fileSha256: Buffer; mac: Buffer; mediaKey: Buffer }>

  • extensionForMediaMessage(message: IMessage): string
  • extractImageThumb(bufferOrFilePath: string | Buffer | Readable): Promise<Buffer>
  • Extract the true message content from a message Eg. extracts the inner message from a disappearing message/view once message

    Parameters

    Returns IMessage

  • fetchLatestBaileysVersion(): Promise<{ error: undefined; isLatest: boolean; version: WAVersion } | { error: any; isLatest: boolean; version: WAVersion }>
  • utility that fetches latest baileys version from the master branch. Use to ensure your WA connection is always on the latest version

    Returns Promise<{ error: undefined; isLatest: boolean; version: WAVersion } | { error: any; isLatest: boolean; version: WAVersion }>

  • generateLoginNode(userJid: string, config: Pick<SocketConfig, "version" | "browser">): Uint8Array
  • generateMessageID(): string
  • generateOrGetPreKeys(creds: AuthenticationCreds, range: number): { lastPreKeyId: number; newPreKeys: {}; preKeysRange: readonly [number, number] }
  • Parameters

    Returns { lastPreKeyId: number; newPreKeys: {}; preKeysRange: readonly [number, number] }

    • lastPreKeyId: number
    • newPreKeys: {}
    • preKeysRange: readonly [number, number]
  • generateProfilePicture(mediaUpload: WAMediaUpload): Promise<{ img: Buffer }>
  • generateRegistrationId(): number
  • generateRegistrationNode(__namedParameters: SignalCreds, config: Pick<SocketConfig, "version" | "browser">): Uint8Array
  • generateSignalPubKey(pubKey: Buffer | Uint8Array): Buffer
  • generateThumbnail(file: string, mediaType: "image" | "video", options: { logger?: Logger<LoggerOptions> }): Promise<string>
  • generates a thumbnail for a given media, if required

    Parameters

    • file: string
    • mediaType: "image" | "video"
    • options: { logger?: Logger<LoggerOptions> }
      • Optional logger?: Logger<LoggerOptions>

    Returns Promise<string>

  • getAudioDuration(buffer: string | Buffer | Readable): Promise<number>
  • getBinaryNodeChildBuffer(node: BinaryNode, childTag: string): Buffer | Uint8Array
  • getBinaryNodeChildString(node: BinaryNode, childTag: string): string
  • getBinaryNodeChildUInt(node: BinaryNode, childTag: string, length: number): number
  • getDevice(id: string): "android" | "ios" | "web"
  • Returns the device predicted by message ID

    Parameters

    • id: string

    Returns "android" | "ios" | "web"

  • getHttpStream(url: string | URL, options?: AxiosRequestConfig<any> & { isStream?: true }): Promise<Readable>
  • getMediaKeys(buffer: any, mediaType: MediaType): { cipherKey: Buffer; iv: Buffer; macKey: Buffer }
  • generates all the keys required to encrypt/decrypt & sign a media message

    Parameters

    Returns { cipherKey: Buffer; iv: Buffer; macKey: Buffer }

    • cipherKey: Buffer
    • iv: Buffer
    • macKey: Buffer
  • getPreKeys(__namedParameters: SignalKeyStore, min: number, limit: number): Promise<{}>
  • getStream(item: WAMediaUpload): Promise<{ stream: Readable; type: string }>
  • hkdf(buffer: Uint8Array, expandedLength: number, __namedParameters: { info?: string; salt?: Buffer }): Buffer
  • Parameters

    • buffer: Uint8Array
    • expandedLength: number
    • __namedParameters: { info?: string; salt?: Buffer }
      • Optional info?: string
      • Optional salt?: Buffer

    Returns Buffer

  • hmacSign(buffer: Buffer | Uint8Array, key: Buffer | Uint8Array, variant?: "sha256" | "sha512"): Buffer
  • Parameters

    • buffer: Buffer | Uint8Array
    • key: Buffer | Uint8Array
    • variant: "sha256" | "sha512" = 'sha256'

    Returns Buffer

  • isJidBroadcast(jid: string): boolean
  • isJidGroup(jid: string): boolean
  • isJidStatusBroadcast(jid: string): boolean
  • isJidUser(jid: string): boolean
  • isLegacyBinaryNode(buffer: Buffer): boolean
  • jidDecode(jid: string): { agent: number; device: number; server: string; user: string }
  • Parameters

    • jid: string

    Returns { agent: number; device: number; server: string; user: string }

    • agent: number
    • device: number
    • server: string
    • user: string
  • jidEncode(user: string | number, server: JidServer, device?: number, agent?: number): string
  • jidNormalizedUser(jid: string): string
  • jidToSignalProtocolAddress(jid: string): any
  • jidToSignalSenderKeyName(group: string, user: string): string
  • makeNoiseHandler(__namedParameters: KeyPair): { authenticate: (data: Uint8Array) => void; decodeFrame: (newData: Buffer | Uint8Array, onFrame: (buff: BinaryNode | Uint8Array) => void) => void; decrypt: (ciphertext: Uint8Array) => Buffer; encodeFrame: (data: Buffer | Uint8Array) => Uint8Array; encrypt: (plaintext: Uint8Array) => Buffer; finishInit: () => void; mixIntoKey: (data: Uint8Array) => void; processHandshake: (__namedParameters: HandshakeMessage, noiseKey: KeyPair) => Buffer }
  • Parameters

    Returns { authenticate: (data: Uint8Array) => void; decodeFrame: (newData: Buffer | Uint8Array, onFrame: (buff: BinaryNode | Uint8Array) => void) => void; decrypt: (ciphertext: Uint8Array) => Buffer; encodeFrame: (data: Buffer | Uint8Array) => Uint8Array; encrypt: (plaintext: Uint8Array) => Buffer; finishInit: () => void; mixIntoKey: (data: Uint8Array) => void; processHandshake: (__namedParameters: HandshakeMessage, noiseKey: KeyPair) => Buffer }

    • authenticate: (data: Uint8Array) => void
        • (data: Uint8Array): void
        • Parameters

          • data: Uint8Array

          Returns void

    • decodeFrame: (newData: Buffer | Uint8Array, onFrame: (buff: BinaryNode | Uint8Array) => void) => void
        • (newData: Buffer | Uint8Array, onFrame: (buff: BinaryNode | Uint8Array) => void): void
        • Parameters

          • newData: Buffer | Uint8Array
          • onFrame: (buff: BinaryNode | Uint8Array) => void

          Returns void

    • decrypt: (ciphertext: Uint8Array) => Buffer
        • (ciphertext: Uint8Array): Buffer
        • Parameters

          • ciphertext: Uint8Array

          Returns Buffer

    • encodeFrame: (data: Buffer | Uint8Array) => Uint8Array
        • (data: Buffer | Uint8Array): Uint8Array
        • Parameters

          • data: Buffer | Uint8Array

          Returns Uint8Array

    • encrypt: (plaintext: Uint8Array) => Buffer
        • (plaintext: Uint8Array): Buffer
        • Parameters

          • plaintext: Uint8Array

          Returns Buffer

    • finishInit: () => void
        • (): void
        • Returns void

    • mixIntoKey: (data: Uint8Array) => void
        • (data: Uint8Array): void
        • Parameters

          • data: Uint8Array

          Returns void

    • processHandshake: (__namedParameters: HandshakeMessage, noiseKey: KeyPair) => Buffer
  • makeWALegacySocket(config: Partial<LegacySocketConfig>): { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }
  • Parameters

    Returns { authInfo: LegacyAuthenticationCreds; blockUser: (jid: string, type?: "add" | "remove") => Promise<void>; canLogin: () => boolean; chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>; chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>; currentEpoch: () => number; downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>; end: (error: Error) => void; ev: LegacyBaileysEventEmitter; fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>; generateMessageTag: (longTag?: boolean) => string; generateUrlInfo: (text: string) => Promise<WAUrlInfo>; getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>; getBusinessProfile: (jid: string) => Promise<WABusinessProfile>; getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>; getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>; getStatus: (jid: string) => Promise<{ status: string }>; groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>; groupInviteCode: (jid: string) => Promise<string>; groupLeave: (id: string) => Promise<void>; groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>; groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>; groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>; groupUpdateSubject: (id: string, title: string) => Promise<void>; loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>; logout: () => Promise<void>; messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>; onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>; presenceSubscribe: (jid: string) => Promise<string>; productCreate: (product: ProductCreate) => Promise<Product>; productDelete: (productIds: string[]) => Promise<{ deleted: any }>; productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>; profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>; query: (__namedParameters: SocketQueryOptions) => Promise<any>; relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>; searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>; sendAdminTest: () => Promise<string>; sendChatsQuery: (epoch: number) => Promise<string>; sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>; sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>; sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>; setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>; setStatus: (status: string) => Promise<{ status: number }>; state: ConnectionState; type: "legacy"; updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>; updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }; updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>; updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>; waUploadToServer: WAMediaUploadFunction; waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>; waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }; waitForSocketOpen: () => Promise<void>; ws: WebSocket; updateProfilePicture: any }

    • authInfo: LegacyAuthenticationCreds
    • blockUser: (jid: string, type?: "add" | "remove") => Promise<void>
        • (jid: string, type?: "add" | "remove"): Promise<void>
        • Add or remove user from blocklist

          Parameters

          • jid: string

            the ID of the person who you are blocking/unblocking

          • type: "add" | "remove" = 'add'

            type of operation

          Returns Promise<void>

    • canLogin: () => boolean
        • (): boolean
        • Can you login to WA without scanning the QR

          Returns boolean

    • chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | { status: number }>
        • (modification: ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number): Promise<void | { status: number }>
        • Modify a given chat (archive, pin etc.)

          Parameters

          • modification: ChatModification
          • jid: string

            the ID of the person/group you are modifiying

          • chatInfo: Pick<Chat, "mute" | "pin">
          • Optional timestampNow: number

          Returns Promise<void | { status: number }>

    • chatRead: (fromMessage: IMessageKey, count: number) => Promise<void>
        • (fromMessage: IMessageKey, count: number): Promise<void>
        • Parameters

          Returns Promise<void>

    • currentEpoch: () => number
        • (): number
        • Returns number

    • downloadMediaMessage: (message: IWebMessageInfo, type?: "buffer" | "stream", options?: MediaDownloadOptions) => Promise<Buffer | Transform>
    • end: (error: Error) => void
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    • ev: LegacyBaileysEventEmitter
    • fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<WebMessageInfo[]>
    • generateMessageTag: (longTag?: boolean) => string
        • (longTag?: boolean): string
        • generate message tag and increment epoch

          Parameters

          • longTag: boolean = false

          Returns string

    • generateUrlInfo: (text: string) => Promise<WAUrlInfo>
        • Query a string to check if it has a url, if it does, return WAUrlInfo

          Parameters

          • text: string

          Returns Promise<WAUrlInfo>

    • getBroadcastListInfo: (jid: string) => Promise<GroupMetadata>
    • getBusinessProfile: (jid: string) => Promise<WABusinessProfile>
        • Query Business Profile (Useful for VCards)

          Parameters

          • jid: string

            Business Jid

          Returns Promise<WABusinessProfile>

          profile object or undefined if not business account

    • getCatalog: (jid?: string, limit?: number) => Promise<{ beforeCursor: string; products: Product[] }>
        • (jid?: string, limit?: number): Promise<{ beforeCursor: string; products: Product[] }>
        • Parameters

          • Optional jid: string
          • limit: number = 10

          Returns Promise<{ beforeCursor: string; products: Product[] }>

    • getOrderDetails: (orderId: string, tokenBase64: string) => Promise<OrderDetails>
        • (orderId: string, tokenBase64: string): Promise<OrderDetails>
        • Parameters

          • orderId: string
          • tokenBase64: string

          Returns Promise<OrderDetails>

    • getStatus: (jid: string) => Promise<{ status: string }>
        • (jid: string): Promise<{ status: string }>
        • Query the status of the person (see groupMetadata() for groups)

          Parameters

          • jid: string

          Returns Promise<{ status: string }>

    • groupCreate: (title: string, participants: string[]) => Promise<GroupMetadata>
        • Create a group

          Parameters

          • title: string

            like, the title of the group

          • participants: string[]

            people to include in the group

          Returns Promise<GroupMetadata>

    • groupInviteCode: (jid: string) => Promise<string>
        • (jid: string): Promise<string>
        • Parameters

          • jid: string

          Returns Promise<string>

    • groupLeave: (id: string) => Promise<void>
        • (id: string): Promise<void>
        • Leave a group

          Parameters

          • id: string

          Returns Promise<void>

    • groupMetadata: (jid: string, minimal: boolean) => Promise<GroupMetadata>
    • groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise<string[]>
        • Update participants in the group

          Parameters

          Returns Promise<string[]>

    • groupUpdateDescription: (jid: string, description: string) => Promise<{ status: number }>
        • (jid: string, description: string): Promise<{ status: number }>
        • Update the group description

          Parameters

          • jid: string

            the ID of the group

          • description: string

          Returns Promise<{ status: number }>

    • groupUpdateSubject: (id: string, title: string) => Promise<void>
        • (id: string, title: string): Promise<void>
        • Update the subject of the group

          Parameters

          • id: string
          • title: string

            the new title of the group

          Returns Promise<void>

    • loadMessageFromWA: (jid: string, id: string) => Promise<WebMessageInfo>
        • Load a single message specified by the ID

          Parameters

          • jid: string
          • id: string

          Returns Promise<WebMessageInfo>

    • logout: () => Promise<void>
        • (): Promise<void>
        • Logs you out from WA If connected, invalidates the credentials with the server

          Returns Promise<void>

    • messageInfo: (jid: string, messageID: string) => Promise<IUserReceipt[]>
        • Parameters

          • jid: string
          • messageID: string

          Returns Promise<IUserReceipt[]>

    • onWhatsApp: (str: string) => Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
        • (str: string): Promise<{ exists: boolean; isBusiness: boolean; jid: string }>
        • Query whether a given number is registered on WhatsApp

          Parameters

          • str: string

            phone number/jid you want to check for

          Returns Promise<{ exists: boolean; isBusiness: boolean; jid: string }>

          undefined if the number doesn't exists, otherwise the correctly formatted jid

    • presenceSubscribe: (jid: string) => Promise<string>
        • (jid: string): Promise<string>
        • Request updates on the presence of a user this returns nothing, you'll receive updates in chats.update event

          Parameters

          • jid: string

          Returns Promise<string>

    • productCreate: (product: ProductCreate) => Promise<Product>
    • productDelete: (productIds: string[]) => Promise<{ deleted: any }>
        • (productIds: string[]): Promise<{ deleted: any }>
        • Parameters

          • productIds: string[]

          Returns Promise<{ deleted: any }>

    • productUpdate: (productId: string, update: ProductUpdate) => Promise<Product>
    • profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>
        • (jid: string, timeoutMs?: number): Promise<string>
        • Parameters

          • jid: string
          • Optional timeoutMs: number

          Returns Promise<string>

    • query: (__namedParameters: SocketQueryOptions) => Promise<any>
    • relayMessage: (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }) => Promise<void>
        • (message: IWebMessageInfo, __namedParameters?: { waitForAck: boolean }): Promise<void>
        • Relay (send) a WAMessage; more advanced functionality to send a built WA Message, you may want to stick with sendMessage()

          Parameters

          • message: IWebMessageInfo
          • __namedParameters: { waitForAck: boolean } = ...
            • waitForAck: boolean

          Returns Promise<void>

    • searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ last: boolean; messages: WebMessageInfo[] }>
        • (txt: string, inJid: string, count: number, page: number): Promise<{ last: boolean; messages: WebMessageInfo[] }>
        • Parameters

          • txt: string
          • inJid: string
          • count: number
          • page: number

          Returns Promise<{ last: boolean; messages: WebMessageInfo[] }>

    • sendAdminTest: () => Promise<string>
        • (): Promise<string>
        • checks for phone connection

          Returns Promise<string>

    • sendChatsQuery: (epoch: number) => Promise<string>
        • (epoch: number): Promise<string>
        • Parameters

          • epoch: number

          Returns Promise<string>

    • sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { waitForAck?: boolean }) => Promise<WebMessageInfo>
    • sendNode: (__namedParameters: SocketSendMessageOptions) => Promise<string>
    • sendPresenceUpdate: (type: WAPresence, jid: string) => Promise<string>
        • Tell someone about your presence -- online, typing, offline etc.

          Parameters

          • type: WAPresence

            your presence

          • jid: string

            the ID of the person/group who you are updating

          Returns Promise<string>

    • setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ status: number }>
        • (nodes: BinaryNode[], binaryTag?: WATag, tag?: string): Promise<{ status: number }>
        • Generic function for action, set queries

          Parameters

          Returns Promise<{ status: number }>

    • setStatus: (status: string) => Promise<{ status: number }>
        • (status: string): Promise<{ status: number }>
        • Parameters

          • status: string

          Returns Promise<{ status: number }>

    • state: ConnectionState
    • type: "legacy"
    • updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>
    • updateKeys: (info: { encKey: Buffer; macKey: Buffer }) => { encKey: Buffer; macKey: Buffer }
        • (info: { encKey: Buffer; macKey: Buffer }): { encKey: Buffer; macKey: Buffer }
        • Parameters

          • info: { encKey: Buffer; macKey: Buffer }
            • encKey: Buffer
            • macKey: Buffer

          Returns { encKey: Buffer; macKey: Buffer }

          • encKey: Buffer
          • macKey: Buffer
    • updateMediaMessage: (message: IWebMessageInfo) => Promise<BinaryNode>
    • updateProfileName: (name: string) => Promise<{ pushname: string; status: number }>
        • (name: string): Promise<{ pushname: string; status: number }>
        • Parameters

          • name: string

          Returns Promise<{ pushname: string; status: number }>

    • waUploadToServer: WAMediaUploadFunction
    • waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>
    • waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { cancelToken: () => void; promise: Promise<any> }
        • (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number): { cancelToken: () => void; promise: Promise<any> }
        • Wait for a message with a certain tag to be received

          Parameters

          • tag: string

            the message tag to await

          • requiresPhoneConnection: boolean
          • Optional timeoutMs: number

            timeout after which the promise will reject

          Returns { cancelToken: () => void; promise: Promise<any> }

          • cancelToken: () => void
              • (): void
              • Returns void

          • promise: Promise<any>
    • waitForSocketOpen: () => Promise<void>
        • (): Promise<void>
        • Returns Promise<void>

    • ws: WebSocket
    • updateProfilePicture:function
      • updateProfilePicture(jid: string, img: Buffer): Promise<void>
  • mediaMessageSHA256B64(message: IMessage): string
  • Normalizes ephemeral, view once messages to regular message content Eg. image messages in ephemeral messages, in view once messages etc.

    Parameters

    Returns IMessage

  • prepareDisappearingMessageSettingContent(ephemeralExpiration?: number): Message
  • promiseTimeout<T>(ms: number, promise: (resolve: (v?: T) => void, reject: (error: any) => void) => void): Promise<T>
  • Type parameters

    • T

    Parameters

    • ms: number
    • promise: (resolve: (v?: T) => void, reject: (error: any) => void) => void
        • (resolve: (v?: T) => void, reject: (error: any) => void): void
        • Parameters

          • resolve: (v?: T) => void
              • (v?: T): void
              • Parameters

                • Optional v: T

                Returns void

          • reject: (error: any) => void
              • (error: any): void
              • Parameters

                • error: any

                Returns void

          Returns void

    Returns Promise<T>

  • reduceBinaryNodeToDictionary(node: BinaryNode, tag: string): {}
  • sha256(buffer: Buffer): Buffer
  • shallowChanges<T>(old: T, current: T, __namedParameters: { lookForDeletedKeys: boolean }): Partial<T>
  • Type parameters

    • T

    Parameters

    • old: T
    • current: T
    • __namedParameters: { lookForDeletedKeys: boolean }
      • lookForDeletedKeys: boolean

    Returns Partial<T>

  • signalStorage(__namedParameters: SignalAuthState): { getOurIdentity: () => { privKey: Buffer; pubKey: Buffer }; getOurRegistrationId: () => number; isTrustedIdentity: () => boolean; loadPreKey: (id: string | number) => Promise<{ privKey: Buffer; pubKey: Buffer }>; loadSenderKey: (keyId: string) => Promise<any>; loadSession: (id: string) => Promise<any>; loadSignedPreKey: (keyId: number) => { privKey: Buffer; pubKey: Buffer }; removePreKey: (id: number) => Awaitable<void>; storeSenderKey: (keyId: any, key: any) => Promise<void>; storeSession: (id: any, session: any) => Promise<void> }
  • Parameters

    Returns { getOurIdentity: () => { privKey: Buffer; pubKey: Buffer }; getOurRegistrationId: () => number; isTrustedIdentity: () => boolean; loadPreKey: (id: string | number) => Promise<{ privKey: Buffer; pubKey: Buffer }>; loadSenderKey: (keyId: string) => Promise<any>; loadSession: (id: string) => Promise<any>; loadSignedPreKey: (keyId: number) => { privKey: Buffer; pubKey: Buffer }; removePreKey: (id: number) => Awaitable<void>; storeSenderKey: (keyId: any, key: any) => Promise<void>; storeSession: (id: any, session: any) => Promise<void> }

    • getOurIdentity: () => { privKey: Buffer; pubKey: Buffer }
        • (): { privKey: Buffer; pubKey: Buffer }
        • Returns { privKey: Buffer; pubKey: Buffer }

          • privKey: Buffer
          • pubKey: Buffer
    • getOurRegistrationId: () => number
        • (): number
        • Returns number

    • isTrustedIdentity: () => boolean
        • (): boolean
        • Returns boolean

    • loadPreKey: (id: string | number) => Promise<{ privKey: Buffer; pubKey: Buffer }>
        • (id: string | number): Promise<{ privKey: Buffer; pubKey: Buffer }>
        • Parameters

          • id: string | number

          Returns Promise<{ privKey: Buffer; pubKey: Buffer }>

    • loadSenderKey: (keyId: string) => Promise<any>
        • (keyId: string): Promise<any>
        • Parameters

          • keyId: string

          Returns Promise<any>

    • loadSession: (id: string) => Promise<any>
        • (id: string): Promise<any>
        • Parameters

          • id: string

          Returns Promise<any>

    • loadSignedPreKey: (keyId: number) => { privKey: Buffer; pubKey: Buffer }
        • (keyId: number): { privKey: Buffer; pubKey: Buffer }
        • Parameters

          • keyId: number

          Returns { privKey: Buffer; pubKey: Buffer }

          • privKey: Buffer
          • pubKey: Buffer
    • removePreKey: (id: number) => Awaitable<void>
        • (id: number): Awaitable<void>
        • Parameters

          • id: number

          Returns Awaitable<void>

    • storeSenderKey: (keyId: any, key: any) => Promise<void>
        • (keyId: any, key: any): Promise<void>
        • Parameters

          • keyId: any
          • key: any

          Returns Promise<void>

    • storeSession: (id: any, session: any) => Promise<void>
        • (id: any, session: any): Promise<void>
        • Parameters

          • id: any
          • session: any

          Returns Promise<void>

  • signedKeyPair(keyPair: KeyPair, keyId: number): { keyId: number; keyPair: KeyPair; signature: Buffer }
  • toBuffer(stream: Readable): Promise<Buffer>
  • toNumber(t: number | Long): number
  • toReadable(buffer: Buffer): Readable
  • unixTimestampSeconds(date?: Date): number
  • unpadRandomMax16(e: Buffer | Uint8Array): Uint8Array
  • useSingleFileAuthState(filename: string, logger?: Logger<LoggerOptions>): { state: AuthenticationState; saveState: any }
  • writeRandomPadMax16(e: any): any

Generated using TypeDoc