Implements

Constructors

Properties

_args: string[]
_client: {
    addChatLabel: (jid: string, labelId: string) => Promise<void>;
    addLabel: (jid: string, labels: LabelActionBody) => Promise<void>;
    addMessageLabel: (
        jid: string,
        messageId: string,
        labelId: string,
    ) => Promise<void>;
    addOrEditContact: (jid: string, contact: IContactAction) => Promise<void>;
    addOrEditQuickReply: (quickReply: QuickReplyAction) => Promise<void>;
    appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
    assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
    authState: {
        creds: AuthenticationCreds;
        keys: SignalKeyStoreWithTransaction;
    };
    chatModify: (mod: ChatModification, jid: string) => Promise<void>;
    cleanDirtyBits: (
        type: "account_sync" | "groups",
        fromTimestamp?: string | number,
    ) => Promise<void>;
    communityAcceptInvite: (code: string) => Promise<undefined | string>;
    communityAcceptInviteV4: (
        key: string | WAMessageKey,
        inviteMessage: IGroupInviteMessage,
    ) => Promise<any>;
    communityCreate: (
        subject: string,
        body: string,
    ) => Promise<null | GroupMetadata>;
    communityCreateGroup: (
        subject: string,
        participants: string[],
        parentCommunityJid: string,
    ) => Promise<null | GroupMetadata>;
    communityFetchAllParticipating: () => Promise<
        { [_: string]: GroupMetadata },
    >;
    communityFetchLinkedGroups: (
        jid: string,
    ) => Promise<
        {
            communityJid: string;
            isCommunity: boolean;
            linkedGroups: {
                creation: undefined
                | number;
                id: undefined | string;
                owner: undefined | string;
                size: undefined | number;
                subject: string;
            }[];
        },
    >;
    communityGetInviteInfo: (code: string) => Promise<GroupMetadata>;
    communityInviteCode: (jid: string) => Promise<undefined | string>;
    communityJoinApprovalMode: (
        jid: string,
        mode: "on" | "off",
    ) => Promise<void>;
    communityLeave: (id: string) => Promise<void>;
    communityLinkGroup: (
        groupJid: string,
        parentCommunityJid: string,
    ) => Promise<void>;
    communityMemberAddMode: (
        jid: string,
        mode: "admin_add" | "all_member_add",
    ) => Promise<void>;
    communityMetadata: (jid: string) => Promise<GroupMetadata>;
    communityParticipantsUpdate: (
        jid: string,
        participants: string[],
        action: ParticipantAction,
    ) => Promise<
        { content: BinaryNode; jid: undefined
        | string; status: string }[],
    >;
    communityRequestParticipantsList: (
        jid: string,
    ) => Promise<{ [key: string]: string }[]>;
    communityRequestParticipantsUpdate: (
        jid: string,
        participants: string[],
        action: "reject" | "approve",
    ) => Promise<{ jid: undefined | string; status: string }[]>;
    communityRevokeInvite: (jid: string) => Promise<undefined | string>;
    communityRevokeInviteV4: (
        communityJid: string,
        invitedJid: string,
    ) => Promise<boolean>;
    communitySettingUpdate: (
        jid: string,
        setting: "announcement" | "not_announcement" | "locked" | "unlocked",
    ) => Promise<void>;
    communityToggleEphemeral: (
        jid: string,
        ephemeralExpiration: number,
    ) => Promise<void>;
    communityUnlinkGroup: (
        groupJid: string,
        parentCommunityJid: string,
    ) => Promise<void>;
    communityUpdateDescription: (
        jid: string,
        description?: string,
    ) => Promise<void>;
    communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
    createCallLink: (
        type: "audio" | "video",
        event?: { startTime: number },
        timeoutMs?: number,
    ) => Promise<undefined | string>;
    createParticipantNodes: (
        recipientJids: string[],
        message: IMessage,
        extraAttrs?: { [key: string]: string },
        dsmMessage?: IMessage,
    ) => Promise<{ nodes: BinaryNode[]; shouldIncludeDeviceIdentity: boolean }>;
    digestKeyBundle: () => Promise<void>;
    end: (error: undefined | Error) => void;
    ev: BaileysEventEmitter & {
        buffer(): void;
        createBufferedFunction<A extends any[], T>(
            work: (...args: A) => Promise<T>,
        ): (...args: A) => Promise<T>;
        flush(): boolean;
        isBuffering(): boolean;
        process(
            handler: (events: Partial<BaileysEventMap>) => void | Promise<void>,
        ): () => void;
    };
    executeUSyncQuery: (
        usyncQuery: USyncQuery,
    ) => Promise<undefined | USyncQueryResult>;
    fetchBlocklist: () => Promise<(undefined | string)[]>;
    fetchDisappearingDuration: (
        ...jids: string[],
    ) => Promise<undefined | USyncQueryResultList[]>;
    fetchMessageHistory: (
        count: number,
        oldestMsgKey: WAMessageKey,
        oldestMsgTimestamp: any,
    ) => Promise<string>;
    fetchPrivacySettings: (force?: boolean) => Promise<{ [_: string]: string }>;
    fetchStatus: (
        ...jids: string[],
    ) => Promise<undefined | USyncQueryResultList[]>;
    generateMessageTag: () => string;
    getBotListV2: () => Promise<BotListInfo[]>;
    getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>;
    getCatalog: (
        __namedParameters: GetCatalogOptions,
    ) => Promise<{ nextPageCursor: undefined | string; products: Product[] }>;
    getCollections: (
        jid?: string,
        limit?: number,
    ) => Promise<{ collections: CatalogCollection[] }>;
    getOrderDetails: (
        orderId: string,
        tokenBase64: string,
    ) => Promise<OrderDetails>;
    getPrivacyTokens: (jids: string[]) => Promise<any>;
    getUSyncDevices: (
        jids: string[],
        useCache: boolean,
        ignoreZeroDevices: boolean,
    ) => Promise<(JidWithDevice & { jid: string })[]>;
    groupAcceptInvite: (code: string) => Promise<undefined | string>;
    groupAcceptInviteV4: (
        key: string | WAMessageKey,
        inviteMessage: IGroupInviteMessage,
    ) => Promise<any>;
    groupCreate: (
        subject: string,
        participants: string[],
    ) => Promise<GroupMetadata>;
    groupFetchAllParticipating: () => Promise<{ [_: string]: GroupMetadata }>;
    groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
    groupInviteCode: (jid: string) => Promise<undefined | string>;
    groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
    groupLeave: (id: string) => Promise<void>;
    groupMemberAddMode: (
        jid: string,
        mode: "admin_add" | "all_member_add",
    ) => Promise<void>;
    groupMetadata: (jid: string) => Promise<GroupMetadata>;
    groupParticipantsUpdate: (
        jid: string,
        participants: string[],
        action: ParticipantAction,
    ) => Promise<
        { content: BinaryNode; jid: undefined
        | string; status: string }[],
    >;
    groupRequestParticipantsList: (
        jid: string,
    ) => Promise<{ [key: string]: string }[]>;
    groupRequestParticipantsUpdate: (
        jid: string,
        participants: string[],
        action: "reject" | "approve",
    ) => Promise<{ jid: undefined | string; status: string }[]>;
    groupRevokeInvite: (jid: string) => Promise<undefined | string>;
    groupRevokeInviteV4: (
        groupJid: string,
        invitedJid: string,
    ) => Promise<boolean>;
    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>;
    logger: ILogger;
    logout: (msg?: string) => Promise<void>;
    messageRetryManager: null | MessageRetryManager;
    newsletterAdminCount: (jid: string) => Promise<number>;
    newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
    newsletterCreate: (
        name: string,
        description?: string,
    ) => Promise<NewsletterMetadata>;
    newsletterDelete: (jid: string) => Promise<void>;
    newsletterDemote: (jid: string, userJid: string) => Promise<void>;
    newsletterFetchMessages: (
        jid: string,
        count: number,
        since: number,
        after: number,
    ) => Promise<any>;
    newsletterFollow: (jid: string) => Promise<unknown>;
    newsletterMetadata: (
        type: "jid" | "invite",
        key: string,
    ) => Promise<null | NewsletterMetadata>;
    newsletterMute: (jid: string) => Promise<unknown>;
    newsletterReactMessage: (
        jid: string,
        serverId: string,
        reaction?: string,
    ) => Promise<void>;
    newsletterRemovePicture: (jid: string) => Promise<unknown>;
    newsletterSubscribers: (jid: string) => Promise<{ subscribers: number }>;
    newsletterUnfollow: (jid: string) => Promise<unknown>;
    newsletterUnmute: (jid: string) => Promise<unknown>;
    newsletterUpdate: (
        jid: string,
        updates: NewsletterUpdate,
    ) => Promise<unknown>;
    newsletterUpdateDescription: (
        jid: string,
        description: string,
    ) => Promise<unknown>;
    newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
    newsletterUpdatePicture: (
        jid: string,
        content: WAMediaUpload,
    ) => Promise<unknown>;
    onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
    onWhatsApp: (
        ...phoneNumber: string[],
    ) => Promise<undefined | { exists: boolean; jid: string }[]>;
    presenceSubscribe: (
        toJid: string,
        tcToken?: Buffer<ArrayBufferLike>,
    ) => Promise<void>;
    processingMutex: { mutex<T>(code: () => T | Promise<T>): Promise<T> };
    productCreate: (create: ProductCreate) => Promise<Product>;
    productDelete: (productIds: string[]) => Promise<{ deleted: number }>;
    productUpdate: (
        productId: string,
        update: ProductUpdate,
    ) => Promise<Product>;
    profilePictureUrl: (
        jid: string,
        type?: "image" | "preview",
        timeoutMs?: number,
    ) => Promise<undefined | string>;
    query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
    readMessages: (keys: WAMessageKey[]) => Promise<void>;
    refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>;
    rejectCall: (callId: string, callFrom: string) => Promise<void>;
    relayMessage: (
        jid: string,
        message: IMessage,
        __namedParameters: MessageRelayOptions,
    ) => Promise<string>;
    removeChatLabel: (jid: string, labelId: string) => Promise<void>;
    removeContact: (jid: string) => Promise<void>;
    removeCoverPhoto: (id: string) => Promise<any>;
    removeMessageLabel: (
        jid: string,
        messageId: string,
        labelId: string,
    ) => Promise<void>;
    removeProfilePicture: (jid: string) => Promise<void>;
    removeQuickReply: (timestamp: string) => Promise<void>;
    requestPairingCode: (
        phoneNumber: string,
        customPairingCode?: string,
    ) => Promise<string>;
    requestPlaceholderResend: (
        messageKey: WAMessageKey,
    ) => Promise<undefined | string>;
    resyncAppState: (
        collections: readonly (
            | "critical_unblock_low"
            | "regular_high"
            | "regular_low"
            | "critical_block"
            | "regular"
        )[],
        isInitialSync: boolean,
    ) => Promise<void>;
    rotateSignedPreKey: () => Promise<void>;
    sendMessage: (
        jid: string,
        content: AnyMessageContent,
        options?: MiscMessageGenerationOptions,
    ) => Promise<undefined | WAMessage>;
    sendMessageAck: (
        __namedParameters: BinaryNode,
        errorCode?: number,
    ) => Promise<void>;
    sendNode: (frame: BinaryNode) => Promise<void>;
    sendPeerDataOperationMessage: (
        pdoMessage: IPeerDataOperationRequestMessage,
    ) => Promise<string>;
    sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
    sendRawMessage: (
        data: Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>,
    ) => Promise<void>;
    sendReceipt: (
        jid: string,
        participant: undefined | string,
        messageIds: string[],
        type: MessageReceiptType,
    ) => Promise<void>;
    sendReceipts: (
        keys: WAMessageKey[],
        type: MessageReceiptType,
    ) => Promise<void>;
    sendRetryRequest: (
        node: BinaryNode,
        forceIncludeKeys?: boolean,
    ) => Promise<void>;
    sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
    signalRepository: SignalRepositoryWithLIDStore;
    star: (
        jid: string,
        messages: { fromMe?: boolean; id: string }[],
        star: boolean,
    ) => Promise<void>;
    subscribeNewsletterUpdates: (
        jid: string,
    ) => Promise<null | { duration: string }>;
    type: "md";
    updateBlockStatus: (
        jid: string,
        action: "block" | "unblock",
    ) => Promise<void>;
    updateBussinesProfile: (args: UpdateBussinesProfileProps) => Promise<any>;
    updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>;
    updateCoverPhoto: (photo: WAMediaUpload) => Promise<number>;
    updateDefaultDisappearingMode: (duration: number) => Promise<void>;
    updateDisableLinkPreviewsPrivacy: (
        isPreviewsDisabled: boolean,
    ) => Promise<void>;
    updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>;
    updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
    updateMediaMessage: (message: WAMessage) => Promise<WAMessage>;
    updateMessagesPrivacy: (value: WAPrivacyMessagesValue) => Promise<void>;
    updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
    updateProfileName: (name: string) => Promise<void>;
    updateProfilePicture: (
        jid: string,
        content: WAMediaUpload,
        dimensions?: { height: number; width: number },
    ) => Promise<void>;
    updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
    updateProfileStatus: (status: string) => Promise<void>;
    updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>;
    updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>;
    uploadPreKeys: (count?: number, retryCount?: number) => Promise<void>;
    uploadPreKeysToServerIfRequired: () => Promise<void>;
    upsertMessage: (msg: WAMessage, type: MessageUpsertType) => Promise<void>;
    user: undefined | Contact;
    waitForConnectionUpdate: (
        check: (u: Partial<ConnectionState>) => Promise<undefined | boolean>,
        timeoutMs?: number,
    ) => Promise<void>;
    waitForMessage: <T>(
        msgId: string,
        timeoutMs?: number,
    ) => Promise<undefined | T>;
    waitForSocketOpen: () => Promise<void>;
    wamBuffer: BinaryInfo;
    waUploadToServer: WAMediaUploadFunction;
    ws: WebSocketClient;
}
_command?: ICommandOptions
_config: {
    cmd: undefined | Collection<number | ICommandOptions, any>;
    prefix: string | RegExp | string[];
}
_self: ICtxSelf
_sender: {
    decodedJid: undefined | null | string;
    decodedJidAlt?: null | string;
    jid: undefined | null | string;
    jidAlt?: null | string;
    pushName: undefined | null | string;
}
_used: {
    command?: string;
    hears?: any;
    poll?: any;
    pollVote?: any;
    prefix?: string | string[];
    reactions?: any;
    upsert?: any;
}

Accessors

  • get core(): {
        addChatLabel: (jid: string, labelId: string) => Promise<void>;
        addLabel: (jid: string, labels: LabelActionBody) => Promise<void>;
        addMessageLabel: (
            jid: string,
            messageId: string,
            labelId: string,
        ) => Promise<void>;
        addOrEditContact: (jid: string, contact: IContactAction) => Promise<void>;
        addOrEditQuickReply: (quickReply: QuickReplyAction) => Promise<void>;
        appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
        assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
        authState: {
            creds: AuthenticationCreds;
            keys: SignalKeyStoreWithTransaction;
        };
        chatModify: (mod: ChatModification, jid: string) => Promise<void>;
        cleanDirtyBits: (
            type: "account_sync" | "groups",
            fromTimestamp?: string | number,
        ) => Promise<void>;
        communityAcceptInvite: (code: string) => Promise<undefined | string>;
        communityAcceptInviteV4: (
            key: string | WAMessageKey,
            inviteMessage: IGroupInviteMessage,
        ) => Promise<any>;
        communityCreate: (
            subject: string,
            body: string,
        ) => Promise<null | GroupMetadata>;
        communityCreateGroup: (
            subject: string,
            participants: string[],
            parentCommunityJid: string,
        ) => Promise<null | GroupMetadata>;
        communityFetchAllParticipating: () => Promise<
            { [_: string]: GroupMetadata },
        >;
        communityFetchLinkedGroups: (
            jid: string,
        ) => Promise<
            {
                communityJid: string;
                isCommunity: boolean;
                linkedGroups: {
                    creation: undefined
                    | number;
                    id: undefined | string;
                    owner: undefined | string;
                    size: undefined | number;
                    subject: string;
                }[];
            },
        >;
        communityGetInviteInfo: (code: string) => Promise<GroupMetadata>;
        communityInviteCode: (jid: string) => Promise<undefined | string>;
        communityJoinApprovalMode: (
            jid: string,
            mode: "on" | "off",
        ) => Promise<void>;
        communityLeave: (id: string) => Promise<void>;
        communityLinkGroup: (
            groupJid: string,
            parentCommunityJid: string,
        ) => Promise<void>;
        communityMemberAddMode: (
            jid: string,
            mode: "admin_add" | "all_member_add",
        ) => Promise<void>;
        communityMetadata: (jid: string) => Promise<GroupMetadata>;
        communityParticipantsUpdate: (
            jid: string,
            participants: string[],
            action: ParticipantAction,
        ) => Promise<
            { content: BinaryNode; jid: undefined
            | string; status: string }[],
        >;
        communityRequestParticipantsList: (
            jid: string,
        ) => Promise<{ [key: string]: string }[]>;
        communityRequestParticipantsUpdate: (
            jid: string,
            participants: string[],
            action: "reject" | "approve",
        ) => Promise<{ jid: undefined | string; status: string }[]>;
        communityRevokeInvite: (jid: string) => Promise<undefined | string>;
        communityRevokeInviteV4: (
            communityJid: string,
            invitedJid: string,
        ) => Promise<boolean>;
        communitySettingUpdate: (
            jid: string,
            setting: "announcement" | "not_announcement" | "locked" | "unlocked",
        ) => Promise<void>;
        communityToggleEphemeral: (
            jid: string,
            ephemeralExpiration: number,
        ) => Promise<void>;
        communityUnlinkGroup: (
            groupJid: string,
            parentCommunityJid: string,
        ) => Promise<void>;
        communityUpdateDescription: (
            jid: string,
            description?: string,
        ) => Promise<void>;
        communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
        createCallLink: (
            type: "audio" | "video",
            event?: { startTime: number },
            timeoutMs?: number,
        ) => Promise<undefined | string>;
        createParticipantNodes: (
            recipientJids: string[],
            message: IMessage,
            extraAttrs?: { [key: string]: string },
            dsmMessage?: IMessage,
        ) => Promise<{ nodes: BinaryNode[]; shouldIncludeDeviceIdentity: boolean }>;
        digestKeyBundle: () => Promise<void>;
        end: (error: undefined | Error) => void;
        ev: BaileysEventEmitter & {
            buffer(): void;
            createBufferedFunction<A extends any[], T>(
                work: (...args: A) => Promise<T>,
            ): (...args: A) => Promise<T>;
            flush(): boolean;
            isBuffering(): boolean;
            process(
                handler: (events: Partial<BaileysEventMap>) => void | Promise<void>,
            ): () => void;
        };
        executeUSyncQuery: (
            usyncQuery: USyncQuery,
        ) => Promise<undefined | USyncQueryResult>;
        fetchBlocklist: () => Promise<(undefined | string)[]>;
        fetchDisappearingDuration: (
            ...jids: string[],
        ) => Promise<undefined | USyncQueryResultList[]>;
        fetchMessageHistory: (
            count: number,
            oldestMsgKey: WAMessageKey,
            oldestMsgTimestamp: any,
        ) => Promise<string>;
        fetchPrivacySettings: (force?: boolean) => Promise<{ [_: string]: string }>;
        fetchStatus: (
            ...jids: string[],
        ) => Promise<undefined | USyncQueryResultList[]>;
        generateMessageTag: () => string;
        getBotListV2: () => Promise<BotListInfo[]>;
        getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>;
        getCatalog: (
            __namedParameters: GetCatalogOptions,
        ) => Promise<{ nextPageCursor: undefined | string; products: Product[] }>;
        getCollections: (
            jid?: string,
            limit?: number,
        ) => Promise<{ collections: CatalogCollection[] }>;
        getOrderDetails: (
            orderId: string,
            tokenBase64: string,
        ) => Promise<OrderDetails>;
        getPrivacyTokens: (jids: string[]) => Promise<any>;
        getUSyncDevices: (
            jids: string[],
            useCache: boolean,
            ignoreZeroDevices: boolean,
        ) => Promise<(JidWithDevice & { jid: string })[]>;
        groupAcceptInvite: (code: string) => Promise<undefined | string>;
        groupAcceptInviteV4: (
            key: string | WAMessageKey,
            inviteMessage: IGroupInviteMessage,
        ) => Promise<any>;
        groupCreate: (
            subject: string,
            participants: string[],
        ) => Promise<GroupMetadata>;
        groupFetchAllParticipating: () => Promise<{ [_: string]: GroupMetadata }>;
        groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
        groupInviteCode: (jid: string) => Promise<undefined | string>;
        groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
        groupLeave: (id: string) => Promise<void>;
        groupMemberAddMode: (
            jid: string,
            mode: "admin_add" | "all_member_add",
        ) => Promise<void>;
        groupMetadata: (jid: string) => Promise<GroupMetadata>;
        groupParticipantsUpdate: (
            jid: string,
            participants: string[],
            action: ParticipantAction,
        ) => Promise<
            { content: BinaryNode; jid: undefined
            | string; status: string }[],
        >;
        groupRequestParticipantsList: (
            jid: string,
        ) => Promise<{ [key: string]: string }[]>;
        groupRequestParticipantsUpdate: (
            jid: string,
            participants: string[],
            action: "reject" | "approve",
        ) => Promise<{ jid: undefined | string; status: string }[]>;
        groupRevokeInvite: (jid: string) => Promise<undefined | string>;
        groupRevokeInviteV4: (
            groupJid: string,
            invitedJid: string,
        ) => Promise<boolean>;
        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>;
        logger: ILogger;
        logout: (msg?: string) => Promise<void>;
        messageRetryManager: null | MessageRetryManager;
        newsletterAdminCount: (jid: string) => Promise<number>;
        newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
        newsletterCreate: (
            name: string,
            description?: string,
        ) => Promise<NewsletterMetadata>;
        newsletterDelete: (jid: string) => Promise<void>;
        newsletterDemote: (jid: string, userJid: string) => Promise<void>;
        newsletterFetchMessages: (
            jid: string,
            count: number,
            since: number,
            after: number,
        ) => Promise<any>;
        newsletterFollow: (jid: string) => Promise<unknown>;
        newsletterMetadata: (
            type: "jid" | "invite",
            key: string,
        ) => Promise<null | NewsletterMetadata>;
        newsletterMute: (jid: string) => Promise<unknown>;
        newsletterReactMessage: (
            jid: string,
            serverId: string,
            reaction?: string,
        ) => Promise<void>;
        newsletterRemovePicture: (jid: string) => Promise<unknown>;
        newsletterSubscribers: (jid: string) => Promise<{ subscribers: number }>;
        newsletterUnfollow: (jid: string) => Promise<unknown>;
        newsletterUnmute: (jid: string) => Promise<unknown>;
        newsletterUpdate: (
            jid: string,
            updates: NewsletterUpdate,
        ) => Promise<unknown>;
        newsletterUpdateDescription: (
            jid: string,
            description: string,
        ) => Promise<unknown>;
        newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
        newsletterUpdatePicture: (
            jid: string,
            content: WAMediaUpload,
        ) => Promise<unknown>;
        onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
        onWhatsApp: (
            ...phoneNumber: string[],
        ) => Promise<undefined | { exists: boolean; jid: string }[]>;
        presenceSubscribe: (
            toJid: string,
            tcToken?: Buffer<ArrayBufferLike>,
        ) => Promise<void>;
        processingMutex: { mutex<T>(code: () => T | Promise<T>): Promise<T> };
        productCreate: (create: ProductCreate) => Promise<Product>;
        productDelete: (productIds: string[]) => Promise<{ deleted: number }>;
        productUpdate: (
            productId: string,
            update: ProductUpdate,
        ) => Promise<Product>;
        profilePictureUrl: (
            jid: string,
            type?: "image" | "preview",
            timeoutMs?: number,
        ) => Promise<undefined | string>;
        query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
        readMessages: (keys: WAMessageKey[]) => Promise<void>;
        refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>;
        rejectCall: (callId: string, callFrom: string) => Promise<void>;
        relayMessage: (
            jid: string,
            message: IMessage,
            __namedParameters: MessageRelayOptions,
        ) => Promise<string>;
        removeChatLabel: (jid: string, labelId: string) => Promise<void>;
        removeContact: (jid: string) => Promise<void>;
        removeCoverPhoto: (id: string) => Promise<any>;
        removeMessageLabel: (
            jid: string,
            messageId: string,
            labelId: string,
        ) => Promise<void>;
        removeProfilePicture: (jid: string) => Promise<void>;
        removeQuickReply: (timestamp: string) => Promise<void>;
        requestPairingCode: (
            phoneNumber: string,
            customPairingCode?: string,
        ) => Promise<string>;
        requestPlaceholderResend: (
            messageKey: WAMessageKey,
        ) => Promise<undefined | string>;
        resyncAppState: (
            collections: readonly (
                | "critical_unblock_low"
                | "regular_high"
                | "regular_low"
                | "critical_block"
                | "regular"
            )[],
            isInitialSync: boolean,
        ) => Promise<void>;
        rotateSignedPreKey: () => Promise<void>;
        sendMessage: (
            jid: string,
            content: AnyMessageContent,
            options?: MiscMessageGenerationOptions,
        ) => Promise<undefined | WAMessage>;
        sendMessageAck: (
            __namedParameters: BinaryNode,
            errorCode?: number,
        ) => Promise<void>;
        sendNode: (frame: BinaryNode) => Promise<void>;
        sendPeerDataOperationMessage: (
            pdoMessage: IPeerDataOperationRequestMessage,
        ) => Promise<string>;
        sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
        sendRawMessage: (
            data: Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>,
        ) => Promise<void>;
        sendReceipt: (
            jid: string,
            participant: undefined | string,
            messageIds: string[],
            type: MessageReceiptType,
        ) => Promise<void>;
        sendReceipts: (
            keys: WAMessageKey[],
            type: MessageReceiptType,
        ) => Promise<void>;
        sendRetryRequest: (
            node: BinaryNode,
            forceIncludeKeys?: boolean,
        ) => Promise<void>;
        sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
        signalRepository: SignalRepositoryWithLIDStore;
        star: (
            jid: string,
            messages: { fromMe?: boolean; id: string }[],
            star: boolean,
        ) => Promise<void>;
        subscribeNewsletterUpdates: (
            jid: string,
        ) => Promise<null | { duration: string }>;
        type: "md";
        updateBlockStatus: (
            jid: string,
            action: "block" | "unblock",
        ) => Promise<void>;
        updateBussinesProfile: (args: UpdateBussinesProfileProps) => Promise<any>;
        updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>;
        updateCoverPhoto: (photo: WAMediaUpload) => Promise<number>;
        updateDefaultDisappearingMode: (duration: number) => Promise<void>;
        updateDisableLinkPreviewsPrivacy: (
            isPreviewsDisabled: boolean,
        ) => Promise<void>;
        updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>;
        updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
        updateMediaMessage: (message: WAMessage) => Promise<WAMessage>;
        updateMessagesPrivacy: (value: WAPrivacyMessagesValue) => Promise<void>;
        updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
        updateProfileName: (name: string) => Promise<void>;
        updateProfilePicture: (
            jid: string,
            content: WAMediaUpload,
            dimensions?: { height: number; width: number },
        ) => Promise<void>;
        updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
        updateProfileStatus: (status: string) => Promise<void>;
        updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>;
        updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>;
        uploadPreKeys: (count?: number, retryCount?: number) => Promise<void>;
        uploadPreKeysToServerIfRequired: () => Promise<void>;
        upsertMessage: (msg: WAMessage, type: MessageUpsertType) => Promise<void>;
        user: undefined | Contact;
        waitForConnectionUpdate: (
            check: (u: Partial<ConnectionState>) => Promise<undefined | boolean>,
            timeoutMs?: number,
        ) => Promise<void>;
        waitForMessage: <T>(
            msgId: string,
            timeoutMs?: number,
        ) => Promise<undefined | T>;
        waitForSocketOpen: () => Promise<void>;
        wamBuffer: BinaryInfo;
        waUploadToServer: WAMediaUploadFunction;
        ws: WebSocketClient;
    }

    Returns {
        addChatLabel: (jid: string, labelId: string) => Promise<void>;
        addLabel: (jid: string, labels: LabelActionBody) => Promise<void>;
        addMessageLabel: (
            jid: string,
            messageId: string,
            labelId: string,
        ) => Promise<void>;
        addOrEditContact: (jid: string, contact: IContactAction) => Promise<void>;
        addOrEditQuickReply: (quickReply: QuickReplyAction) => Promise<void>;
        appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
        assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
        authState: {
            creds: AuthenticationCreds;
            keys: SignalKeyStoreWithTransaction;
        };
        chatModify: (mod: ChatModification, jid: string) => Promise<void>;
        cleanDirtyBits: (
            type: "account_sync" | "groups",
            fromTimestamp?: string | number,
        ) => Promise<void>;
        communityAcceptInvite: (code: string) => Promise<undefined | string>;
        communityAcceptInviteV4: (
            key: string | WAMessageKey,
            inviteMessage: IGroupInviteMessage,
        ) => Promise<any>;
        communityCreate: (
            subject: string,
            body: string,
        ) => Promise<null | GroupMetadata>;
        communityCreateGroup: (
            subject: string,
            participants: string[],
            parentCommunityJid: string,
        ) => Promise<null | GroupMetadata>;
        communityFetchAllParticipating: () => Promise<
            { [_: string]: GroupMetadata },
        >;
        communityFetchLinkedGroups: (
            jid: string,
        ) => Promise<
            {
                communityJid: string;
                isCommunity: boolean;
                linkedGroups: {
                    creation: undefined
                    | number;
                    id: undefined | string;
                    owner: undefined | string;
                    size: undefined | number;
                    subject: string;
                }[];
            },
        >;
        communityGetInviteInfo: (code: string) => Promise<GroupMetadata>;
        communityInviteCode: (jid: string) => Promise<undefined | string>;
        communityJoinApprovalMode: (
            jid: string,
            mode: "on" | "off",
        ) => Promise<void>;
        communityLeave: (id: string) => Promise<void>;
        communityLinkGroup: (
            groupJid: string,
            parentCommunityJid: string,
        ) => Promise<void>;
        communityMemberAddMode: (
            jid: string,
            mode: "admin_add" | "all_member_add",
        ) => Promise<void>;
        communityMetadata: (jid: string) => Promise<GroupMetadata>;
        communityParticipantsUpdate: (
            jid: string,
            participants: string[],
            action: ParticipantAction,
        ) => Promise<
            { content: BinaryNode; jid: undefined
            | string; status: string }[],
        >;
        communityRequestParticipantsList: (
            jid: string,
        ) => Promise<{ [key: string]: string }[]>;
        communityRequestParticipantsUpdate: (
            jid: string,
            participants: string[],
            action: "reject" | "approve",
        ) => Promise<{ jid: undefined | string; status: string }[]>;
        communityRevokeInvite: (jid: string) => Promise<undefined | string>;
        communityRevokeInviteV4: (
            communityJid: string,
            invitedJid: string,
        ) => Promise<boolean>;
        communitySettingUpdate: (
            jid: string,
            setting: "announcement" | "not_announcement" | "locked" | "unlocked",
        ) => Promise<void>;
        communityToggleEphemeral: (
            jid: string,
            ephemeralExpiration: number,
        ) => Promise<void>;
        communityUnlinkGroup: (
            groupJid: string,
            parentCommunityJid: string,
        ) => Promise<void>;
        communityUpdateDescription: (
            jid: string,
            description?: string,
        ) => Promise<void>;
        communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
        createCallLink: (
            type: "audio" | "video",
            event?: { startTime: number },
            timeoutMs?: number,
        ) => Promise<undefined | string>;
        createParticipantNodes: (
            recipientJids: string[],
            message: IMessage,
            extraAttrs?: { [key: string]: string },
            dsmMessage?: IMessage,
        ) => Promise<{ nodes: BinaryNode[]; shouldIncludeDeviceIdentity: boolean }>;
        digestKeyBundle: () => Promise<void>;
        end: (error: undefined | Error) => void;
        ev: BaileysEventEmitter & {
            buffer(): void;
            createBufferedFunction<A extends any[], T>(
                work: (...args: A) => Promise<T>,
            ): (...args: A) => Promise<T>;
            flush(): boolean;
            isBuffering(): boolean;
            process(
                handler: (events: Partial<BaileysEventMap>) => void | Promise<void>,
            ): () => void;
        };
        executeUSyncQuery: (
            usyncQuery: USyncQuery,
        ) => Promise<undefined | USyncQueryResult>;
        fetchBlocklist: () => Promise<(undefined | string)[]>;
        fetchDisappearingDuration: (
            ...jids: string[],
        ) => Promise<undefined | USyncQueryResultList[]>;
        fetchMessageHistory: (
            count: number,
            oldestMsgKey: WAMessageKey,
            oldestMsgTimestamp: any,
        ) => Promise<string>;
        fetchPrivacySettings: (force?: boolean) => Promise<{ [_: string]: string }>;
        fetchStatus: (
            ...jids: string[],
        ) => Promise<undefined | USyncQueryResultList[]>;
        generateMessageTag: () => string;
        getBotListV2: () => Promise<BotListInfo[]>;
        getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>;
        getCatalog: (
            __namedParameters: GetCatalogOptions,
        ) => Promise<{ nextPageCursor: undefined | string; products: Product[] }>;
        getCollections: (
            jid?: string,
            limit?: number,
        ) => Promise<{ collections: CatalogCollection[] }>;
        getOrderDetails: (
            orderId: string,
            tokenBase64: string,
        ) => Promise<OrderDetails>;
        getPrivacyTokens: (jids: string[]) => Promise<any>;
        getUSyncDevices: (
            jids: string[],
            useCache: boolean,
            ignoreZeroDevices: boolean,
        ) => Promise<(JidWithDevice & { jid: string })[]>;
        groupAcceptInvite: (code: string) => Promise<undefined | string>;
        groupAcceptInviteV4: (
            key: string | WAMessageKey,
            inviteMessage: IGroupInviteMessage,
        ) => Promise<any>;
        groupCreate: (
            subject: string,
            participants: string[],
        ) => Promise<GroupMetadata>;
        groupFetchAllParticipating: () => Promise<{ [_: string]: GroupMetadata }>;
        groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
        groupInviteCode: (jid: string) => Promise<undefined | string>;
        groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
        groupLeave: (id: string) => Promise<void>;
        groupMemberAddMode: (
            jid: string,
            mode: "admin_add" | "all_member_add",
        ) => Promise<void>;
        groupMetadata: (jid: string) => Promise<GroupMetadata>;
        groupParticipantsUpdate: (
            jid: string,
            participants: string[],
            action: ParticipantAction,
        ) => Promise<
            { content: BinaryNode; jid: undefined
            | string; status: string }[],
        >;
        groupRequestParticipantsList: (
            jid: string,
        ) => Promise<{ [key: string]: string }[]>;
        groupRequestParticipantsUpdate: (
            jid: string,
            participants: string[],
            action: "reject" | "approve",
        ) => Promise<{ jid: undefined | string; status: string }[]>;
        groupRevokeInvite: (jid: string) => Promise<undefined | string>;
        groupRevokeInviteV4: (
            groupJid: string,
            invitedJid: string,
        ) => Promise<boolean>;
        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>;
        logger: ILogger;
        logout: (msg?: string) => Promise<void>;
        messageRetryManager: null | MessageRetryManager;
        newsletterAdminCount: (jid: string) => Promise<number>;
        newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
        newsletterCreate: (
            name: string,
            description?: string,
        ) => Promise<NewsletterMetadata>;
        newsletterDelete: (jid: string) => Promise<void>;
        newsletterDemote: (jid: string, userJid: string) => Promise<void>;
        newsletterFetchMessages: (
            jid: string,
            count: number,
            since: number,
            after: number,
        ) => Promise<any>;
        newsletterFollow: (jid: string) => Promise<unknown>;
        newsletterMetadata: (
            type: "jid" | "invite",
            key: string,
        ) => Promise<null | NewsletterMetadata>;
        newsletterMute: (jid: string) => Promise<unknown>;
        newsletterReactMessage: (
            jid: string,
            serverId: string,
            reaction?: string,
        ) => Promise<void>;
        newsletterRemovePicture: (jid: string) => Promise<unknown>;
        newsletterSubscribers: (jid: string) => Promise<{ subscribers: number }>;
        newsletterUnfollow: (jid: string) => Promise<unknown>;
        newsletterUnmute: (jid: string) => Promise<unknown>;
        newsletterUpdate: (
            jid: string,
            updates: NewsletterUpdate,
        ) => Promise<unknown>;
        newsletterUpdateDescription: (
            jid: string,
            description: string,
        ) => Promise<unknown>;
        newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
        newsletterUpdatePicture: (
            jid: string,
            content: WAMediaUpload,
        ) => Promise<unknown>;
        onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
        onWhatsApp: (
            ...phoneNumber: string[],
        ) => Promise<undefined | { exists: boolean; jid: string }[]>;
        presenceSubscribe: (
            toJid: string,
            tcToken?: Buffer<ArrayBufferLike>,
        ) => Promise<void>;
        processingMutex: { mutex<T>(code: () => T | Promise<T>): Promise<T> };
        productCreate: (create: ProductCreate) => Promise<Product>;
        productDelete: (productIds: string[]) => Promise<{ deleted: number }>;
        productUpdate: (
            productId: string,
            update: ProductUpdate,
        ) => Promise<Product>;
        profilePictureUrl: (
            jid: string,
            type?: "image" | "preview",
            timeoutMs?: number,
        ) => Promise<undefined | string>;
        query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
        readMessages: (keys: WAMessageKey[]) => Promise<void>;
        refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>;
        rejectCall: (callId: string, callFrom: string) => Promise<void>;
        relayMessage: (
            jid: string,
            message: IMessage,
            __namedParameters: MessageRelayOptions,
        ) => Promise<string>;
        removeChatLabel: (jid: string, labelId: string) => Promise<void>;
        removeContact: (jid: string) => Promise<void>;
        removeCoverPhoto: (id: string) => Promise<any>;
        removeMessageLabel: (
            jid: string,
            messageId: string,
            labelId: string,
        ) => Promise<void>;
        removeProfilePicture: (jid: string) => Promise<void>;
        removeQuickReply: (timestamp: string) => Promise<void>;
        requestPairingCode: (
            phoneNumber: string,
            customPairingCode?: string,
        ) => Promise<string>;
        requestPlaceholderResend: (
            messageKey: WAMessageKey,
        ) => Promise<undefined | string>;
        resyncAppState: (
            collections: readonly (
                | "critical_unblock_low"
                | "regular_high"
                | "regular_low"
                | "critical_block"
                | "regular"
            )[],
            isInitialSync: boolean,
        ) => Promise<void>;
        rotateSignedPreKey: () => Promise<void>;
        sendMessage: (
            jid: string,
            content: AnyMessageContent,
            options?: MiscMessageGenerationOptions,
        ) => Promise<undefined | WAMessage>;
        sendMessageAck: (
            __namedParameters: BinaryNode,
            errorCode?: number,
        ) => Promise<void>;
        sendNode: (frame: BinaryNode) => Promise<void>;
        sendPeerDataOperationMessage: (
            pdoMessage: IPeerDataOperationRequestMessage,
        ) => Promise<string>;
        sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
        sendRawMessage: (
            data: Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>,
        ) => Promise<void>;
        sendReceipt: (
            jid: string,
            participant: undefined | string,
            messageIds: string[],
            type: MessageReceiptType,
        ) => Promise<void>;
        sendReceipts: (
            keys: WAMessageKey[],
            type: MessageReceiptType,
        ) => Promise<void>;
        sendRetryRequest: (
            node: BinaryNode,
            forceIncludeKeys?: boolean,
        ) => Promise<void>;
        sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
        signalRepository: SignalRepositoryWithLIDStore;
        star: (
            jid: string,
            messages: { fromMe?: boolean; id: string }[],
            star: boolean,
        ) => Promise<void>;
        subscribeNewsletterUpdates: (
            jid: string,
        ) => Promise<null | { duration: string }>;
        type: "md";
        updateBlockStatus: (
            jid: string,
            action: "block" | "unblock",
        ) => Promise<void>;
        updateBussinesProfile: (args: UpdateBussinesProfileProps) => Promise<any>;
        updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>;
        updateCoverPhoto: (photo: WAMediaUpload) => Promise<number>;
        updateDefaultDisappearingMode: (duration: number) => Promise<void>;
        updateDisableLinkPreviewsPrivacy: (
            isPreviewsDisabled: boolean,
        ) => Promise<void>;
        updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>;
        updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
        updateMediaMessage: (message: WAMessage) => Promise<WAMessage>;
        updateMessagesPrivacy: (value: WAPrivacyMessagesValue) => Promise<void>;
        updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
        updateProfileName: (name: string) => Promise<void>;
        updateProfilePicture: (
            jid: string,
            content: WAMediaUpload,
            dimensions?: { height: number; width: number },
        ) => Promise<void>;
        updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
        updateProfileStatus: (status: string) => Promise<void>;
        updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>;
        updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>;
        uploadPreKeys: (count?: number, retryCount?: number) => Promise<void>;
        uploadPreKeysToServerIfRequired: () => Promise<void>;
        upsertMessage: (msg: WAMessage, type: MessageUpsertType) => Promise<void>;
        user: undefined | Contact;
        waitForConnectionUpdate: (
            check: (u: Partial<ConnectionState>) => Promise<undefined | boolean>,
            timeoutMs?: number,
        ) => Promise<void>;
        waitForMessage: <T>(
            msgId: string,
            timeoutMs?: number,
        ) => Promise<undefined | T>;
        waitForSocketOpen: () => Promise<void>;
        wamBuffer: BinaryInfo;
        waUploadToServer: WAMediaUploadFunction;
        ws: WebSocketClient;
    }

  • get decodedId(): undefined | null | string

    Get the decoded current JID.

    Returns undefined | null | string

  • get decodedIdAlt(): undefined | null | string

    Get the decoded alternate JID (Phone Number JID) if available.

    Returns undefined | null | string

  • get id(): undefined | null | string

    Get the current JID (Remote JID). In Baileys v7+, this might be a LID.

    Returns undefined | null | string

  • get idAlt(): undefined | null | string

    Get the alternate JID (Phone Number JID) if available. Useful in Baileys v7+ when the primary ID is a LID.

    Returns undefined | null | string

  • get msg(): IMessageInfo & {
        media: {
            toBuffer: () => Promise<null | Buffer<ArrayBufferLike> | Transform>;
            toStream: () => Promise<null | Buffer<ArrayBufferLike> | Transform>;
        };
    }

    Returns IMessageInfo & {
        media: {
            toBuffer: () => Promise<null | Buffer<ArrayBufferLike> | Transform>;
            toStream: () => Promise<null | Buffer<ArrayBufferLike> | Transform>;
        };
    }

  • get quoted(): {
        albumMessage?: null
        | IAlbumMessage;
        associatedChildMessage?: null | IFutureProofMessage;
        audioMessage?: null | IAudioMessage;
        bcallMessage?: null | IBCallMessage;
        botForwardedMessage?: null | IFutureProofMessage;
        botInvokeMessage?: null | IFutureProofMessage;
        botTaskMessage?: null | IFutureProofMessage;
        buttonsMessage?: null | IButtonsMessage;
        buttonsResponseMessage?: null | IButtonsResponseMessage;
        call?: null | ICall;
        callLogMesssage?: null | ICallLogMessage;
        cancelPaymentRequestMessage?: null | ICancelPaymentRequestMessage;
        chat?: null | IChat;
        commentMessage?: null | ICommentMessage;
        contactMessage?: null | IContactMessage;
        contactsArrayMessage?: null | IContactsArrayMessage;
        conversation?: null | string;
        declinePaymentRequestMessage?: null | IDeclinePaymentRequestMessage;
        decodedSenderJid: string;
        deviceSentMessage?: null | IDeviceSentMessage;
        documentMessage?: null | IDocumentMessage;
        documentWithCaptionMessage?: null | IFutureProofMessage;
        editedMessage?: null | IFutureProofMessage;
        encCommentMessage?: null | IEncCommentMessage;
        encEventResponseMessage?: null | IEncEventResponseMessage;
        encReactionMessage?: null | IEncReactionMessage;
        ephemeralMessage?: null | IFutureProofMessage;
        eventCoverImage?: null | IFutureProofMessage;
        eventMessage?: null | IEventMessage;
        extendedTextMessage?: null | IExtendedTextMessage;
        fastRatchetKeySenderKeyDistributionMessage?:
            | null
            | ISenderKeyDistributionMessage;
        groupInviteMessage?: null
        | IGroupInviteMessage;
        groupMentionedMessage?: null | IFutureProofMessage;
        groupStatusMentionMessage?: null | IFutureProofMessage;
        groupStatusMessage?: null | IFutureProofMessage;
        groupStatusMessageV2?: null | IFutureProofMessage;
        highlyStructuredMessage?: null | IHighlyStructuredMessage;
        imageMessage?: null | IImageMessage;
        interactiveMessage?: null | IInteractiveMessage;
        interactiveResponseMessage?: null | IInteractiveResponseMessage;
        invoiceMessage?: null | IInvoiceMessage;
        keepInChatMessage?: null | IKeepInChatMessage;
        limitSharingMessage?: null | IFutureProofMessage;
        listMessage?: null | IListMessage;
        listResponseMessage?: null | IListResponseMessage;
        liveLocationMessage?: null | ILiveLocationMessage;
        locationMessage?: null | ILocationMessage;
        lottieStickerMessage?: null | IFutureProofMessage;
        media: {
            toBuffer: () => Promise<null | Buffer<ArrayBuffer>>;
            toStream: () => Promise<null | Transform>;
        };
        messageContextInfo?: null
        | IMessageContextInfo;
        messageHistoryBundle?: null | IMessageHistoryBundle;
        messageHistoryNotice?: null | IMessageHistoryNotice;
        newsletterAdminInviteMessage?: null | INewsletterAdminInviteMessage;
        newsletterFollowerInviteMessageV2?: null | INewsletterFollowerInviteMessage;
        orderMessage?: null | IOrderMessage;
        paymentInviteMessage?: null | IPaymentInviteMessage;
        pinInChatMessage?: null | IPinInChatMessage;
        placeholderMessage?: null | IPlaceholderMessage;
        pollCreationMessage?: null | IPollCreationMessage;
        pollCreationMessageV2?: null | IPollCreationMessage;
        pollCreationMessageV3?: null | IPollCreationMessage;
        pollCreationMessageV4?: null | IFutureProofMessage;
        pollCreationMessageV5?: null | IPollCreationMessage;
        pollCreationOptionImageMessage?: null | IFutureProofMessage;
        pollResultSnapshotMessage?: null | IPollResultSnapshotMessage;
        pollResultSnapshotMessageV3?: null | IPollResultSnapshotMessage;
        pollUpdateMessage?: null | IPollUpdateMessage;
        productMessage?: null | IProductMessage;
        protocolMessage?: null | IProtocolMessage;
        ptvMessage?: null | IVideoMessage;
        questionMessage?: null | IFutureProofMessage;
        questionReplyMessage?: null | IFutureProofMessage;
        questionResponseMessage?: null | IQuestionResponseMessage;
        reactionMessage?: null | IReactionMessage;
        requestPaymentMessage?: null | IRequestPaymentMessage;
        requestPhoneNumberMessage?: null | IRequestPhoneNumberMessage;
        richResponseMessage?: null | IAIRichResponseMessage;
        scheduledCallCreationMessage?: null | IScheduledCallCreationMessage;
        scheduledCallEditMessage?: null | IScheduledCallEditMessage;
        secretEncryptedMessage?: null | ISecretEncryptedMessage;
        senderJid: undefined | null | string;
        senderKeyDistributionMessage?: null | ISenderKeyDistributionMessage;
        sendPaymentMessage?: null | ISendPaymentMessage;
        statusAddYours?: null | IFutureProofMessage;
        statusMentionMessage?: null | IFutureProofMessage;
        statusNotificationMessage?: null | IStatusNotificationMessage;
        statusQuestionAnswerMessage?: null | IStatusQuestionAnswerMessage;
        statusQuotedMessage?: null | IStatusQuotedMessage;
        statusStickerInteractionMessage?: null | IStatusStickerInteractionMessage;
        stickerMessage?: null | IStickerMessage;
        stickerPackMessage?: null | IStickerPackMessage;
        stickerSyncRmrMessage?: null | IStickerSyncRMRMessage;
        templateButtonReplyMessage?: null | ITemplateButtonReplyMessage;
        templateMessage?: null | ITemplateMessage;
        videoMessage?: null | IVideoMessage;
        viewOnceMessage?: null | IFutureProofMessage;
        viewOnceMessageV2?: null | IFutureProofMessage;
        viewOnceMessageV2Extension?: null | IFutureProofMessage;
    }

    Returns {
        albumMessage?: null | IAlbumMessage;
        associatedChildMessage?: null | IFutureProofMessage;
        audioMessage?: null | IAudioMessage;
        bcallMessage?: null | IBCallMessage;
        botForwardedMessage?: null | IFutureProofMessage;
        botInvokeMessage?: null | IFutureProofMessage;
        botTaskMessage?: null | IFutureProofMessage;
        buttonsMessage?: null | IButtonsMessage;
        buttonsResponseMessage?: null | IButtonsResponseMessage;
        call?: null | ICall;
        callLogMesssage?: null | ICallLogMessage;
        cancelPaymentRequestMessage?: null | ICancelPaymentRequestMessage;
        chat?: null | IChat;
        commentMessage?: null | ICommentMessage;
        contactMessage?: null | IContactMessage;
        contactsArrayMessage?: null | IContactsArrayMessage;
        conversation?: null | string;
        declinePaymentRequestMessage?: null | IDeclinePaymentRequestMessage;
        decodedSenderJid: string;
        deviceSentMessage?: null | IDeviceSentMessage;
        documentMessage?: null | IDocumentMessage;
        documentWithCaptionMessage?: null | IFutureProofMessage;
        editedMessage?: null | IFutureProofMessage;
        encCommentMessage?: null | IEncCommentMessage;
        encEventResponseMessage?: null | IEncEventResponseMessage;
        encReactionMessage?: null | IEncReactionMessage;
        ephemeralMessage?: null | IFutureProofMessage;
        eventCoverImage?: null | IFutureProofMessage;
        eventMessage?: null | IEventMessage;
        extendedTextMessage?: null | IExtendedTextMessage;
        fastRatchetKeySenderKeyDistributionMessage?:
            | null
            | ISenderKeyDistributionMessage;
        groupInviteMessage?: null
        | IGroupInviteMessage;
        groupMentionedMessage?: null | IFutureProofMessage;
        groupStatusMentionMessage?: null | IFutureProofMessage;
        groupStatusMessage?: null | IFutureProofMessage;
        groupStatusMessageV2?: null | IFutureProofMessage;
        highlyStructuredMessage?: null | IHighlyStructuredMessage;
        imageMessage?: null | IImageMessage;
        interactiveMessage?: null | IInteractiveMessage;
        interactiveResponseMessage?: null | IInteractiveResponseMessage;
        invoiceMessage?: null | IInvoiceMessage;
        keepInChatMessage?: null | IKeepInChatMessage;
        limitSharingMessage?: null | IFutureProofMessage;
        listMessage?: null | IListMessage;
        listResponseMessage?: null | IListResponseMessage;
        liveLocationMessage?: null | ILiveLocationMessage;
        locationMessage?: null | ILocationMessage;
        lottieStickerMessage?: null | IFutureProofMessage;
        media: {
            toBuffer: () => Promise<null | Buffer<ArrayBuffer>>;
            toStream: () => Promise<null | Transform>;
        };
        messageContextInfo?: null
        | IMessageContextInfo;
        messageHistoryBundle?: null | IMessageHistoryBundle;
        messageHistoryNotice?: null | IMessageHistoryNotice;
        newsletterAdminInviteMessage?: null | INewsletterAdminInviteMessage;
        newsletterFollowerInviteMessageV2?: null | INewsletterFollowerInviteMessage;
        orderMessage?: null | IOrderMessage;
        paymentInviteMessage?: null | IPaymentInviteMessage;
        pinInChatMessage?: null | IPinInChatMessage;
        placeholderMessage?: null | IPlaceholderMessage;
        pollCreationMessage?: null | IPollCreationMessage;
        pollCreationMessageV2?: null | IPollCreationMessage;
        pollCreationMessageV3?: null | IPollCreationMessage;
        pollCreationMessageV4?: null | IFutureProofMessage;
        pollCreationMessageV5?: null | IPollCreationMessage;
        pollCreationOptionImageMessage?: null | IFutureProofMessage;
        pollResultSnapshotMessage?: null | IPollResultSnapshotMessage;
        pollResultSnapshotMessageV3?: null | IPollResultSnapshotMessage;
        pollUpdateMessage?: null | IPollUpdateMessage;
        productMessage?: null | IProductMessage;
        protocolMessage?: null | IProtocolMessage;
        ptvMessage?: null | IVideoMessage;
        questionMessage?: null | IFutureProofMessage;
        questionReplyMessage?: null | IFutureProofMessage;
        questionResponseMessage?: null | IQuestionResponseMessage;
        reactionMessage?: null | IReactionMessage;
        requestPaymentMessage?: null | IRequestPaymentMessage;
        requestPhoneNumberMessage?: null | IRequestPhoneNumberMessage;
        richResponseMessage?: null | IAIRichResponseMessage;
        scheduledCallCreationMessage?: null | IScheduledCallCreationMessage;
        scheduledCallEditMessage?: null | IScheduledCallEditMessage;
        secretEncryptedMessage?: null | ISecretEncryptedMessage;
        senderJid: undefined | null | string;
        senderKeyDistributionMessage?: null | ISenderKeyDistributionMessage;
        sendPaymentMessage?: null | ISendPaymentMessage;
        statusAddYours?: null | IFutureProofMessage;
        statusMentionMessage?: null | IFutureProofMessage;
        statusNotificationMessage?: null | IStatusNotificationMessage;
        statusQuestionAnswerMessage?: null | IStatusQuestionAnswerMessage;
        statusQuotedMessage?: null | IStatusQuotedMessage;
        statusStickerInteractionMessage?: null | IStatusStickerInteractionMessage;
        stickerMessage?: null | IStickerMessage;
        stickerPackMessage?: null | IStickerPackMessage;
        stickerSyncRmrMessage?: null | IStickerSyncRMRMessage;
        templateButtonReplyMessage?: null | ITemplateButtonReplyMessage;
        templateMessage?: null | ITemplateMessage;
        videoMessage?: null | IVideoMessage;
        viewOnceMessage?: null | IFutureProofMessage;
        viewOnceMessageV2?: null | IFutureProofMessage;
        viewOnceMessageV2Extension?: null | IFutureProofMessage;
    }

  • get sender(): {
        decodedJid: undefined
        | null
        | string;
        decodedJidAlt?: null | string;
        jid: undefined | null | string;
        jidAlt?: null | string;
        pushName: undefined | null | string;
    }

    Get sender details including JID and pushName. In Baileys v7+, jidAlt will contain the Phone Number JID if the primary jid is a LID.

    Returns {
        decodedJid: undefined | null | string;
        decodedJidAlt?: null | string;
        jid: undefined | null | string;
        jidAlt?: null | string;
        pushName: undefined | null | string;
    }

  • get used(): {
        command?: string;
        hears?: any;
        poll?: any;
        pollVote?: any;
        prefix?: string
        | string[];
        reactions?: any;
        upsert?: any;
    }

    Returns {
        command?: string;
        hears?: any;
        poll?: any;
        pollVote?: any;
        prefix?: string | string[];
        reactions?: any;
        upsert?: any;
    }

Methods

  • Parameters

    • Optionaljid: string

    Returns Promise<void>

  • Parameters

    • key: IMessageKey

    Returns Promise<undefined | WAMessage>

  • Parameters

    • downloadable: DownloadableMessage
    • type:
          | "audio"
          | "document"
          | "gif"
          | "image"
          | "ppic"
          | "product"
          | "ptt"
          | "sticker"
          | "video"
          | "thumbnail-document"
          | "thumbnail-image"
          | "thumbnail-video"
          | "thumbnail-link"
          | "md-msg-hist"
          | "md-app-state"
          | "product-catalog-image"
          | "payment-bg-image"
          | "ptv"
          | "biz-cover-photo"
    • Optionalopts: MediaDownloadOptions

    Returns Promise<Transform>

  • Parameters

    • key: IMessageKey
    • newText: string

    Returns Promise<undefined | WAMessage>

  • Parameters

    • content: undefined | IMessage

    Returns undefined | (keyof IMessage)

  • Parameters

    • id: undefined | string

    Returns "web" | "unknown" | "android" | "ios" | "desktop"

  • Parameters

    Returns Promise<null | Buffer<ArrayBufferLike> | Transform>

  • Returns undefined | null | string[]

  • Returns undefined | (keyof IMessage)

  • Parameters

    • message: AnyMediaMessageContent
    • options: MediaGenerationOptions

    Returns Promise<Message>

  • Parameters

    • jid: string
    • emoji: string
    • Optionalkey: IMessageKey

    Returns Promise<undefined | WAMessage>

  • Parameters

    • content: string | AnyMessageContent
    • options: MiscMessageGenerationOptions = {}

    Returns Promise<undefined | WAMessage>

  • Parameters

    • emoji: string

    Returns Promise<undefined | WAMessage>

  • Parameters

    • jid: string
    • content: AnyMessageContent
    • options: MiscMessageGenerationOptions = {}

    Returns Promise<undefined | WAMessage>

  • Parameters

    • jid: string
    • content: AnyMessageContent
    • options: MiscMessageGenerationOptions = {}

    Returns Promise<undefined | WAMessage>

  • Parameters

    • jid: string
    • args: {
          name: string;
          selectableCount?: boolean;
          singleSelect: boolean;
          values: string[];
      }

    Returns Promise<undefined | WAMessage>

  • Parameters

    • Optionaljid: string

    Returns Promise<void>