@japofc/baileys - v2.4.7
    Preparing search index...

    Class AIRich

    AI rich-response builder (Meta AI / GenAI message primitives).

    Hierarchy (View Summary)

    Index
    EXPERIMENTAL_METHODS: Set<string>

    Reverse-engineered primitives — may break after a WhatsApp client update.

    STABLE_METHODS: Set<string>

    Schema-backed primitives — safe to build on.

    • FOABloksPrimitive — raw Bloks payload; most experimental primitive, fields passed through as-is.

      Parameters

      • data: {
            data?: string;
            initial_response?: any;
            textFallback?: boolean;
            type: string;
            uuid?: string;
            versioning_id?: string;
        }

      Returns this

    • Markdown checklist block.

      Parameters

      • items: (string | { done?: boolean; text: string })[]

      Returns this

    • Parameters

      • language: string
      • code: string

      Returns this

    • Add a compact header card (avatar + title + verified + subtitle, tappable). EXPERIMENTAL.

      Parameters

      • Optionaldata: {
            action_type?: string;
            entity_id?: string;
            entity_type?: string;
            entity_url?: string;
            image?: string;
            image_url?: string;
            is_verified?: boolean;
            picture_url?: string;
            secondary_subtitle?: string;
            subtitle?: string;
            title: string;
            url?: string;
            verified?: boolean;
        }
      • Optionaloptions: { resolveUrl?: boolean }

      Returns this

    • Parameters

      • Optionalitems: Record<string, any>[]

      Returns this

    • GenAIFooterActionPrimitive — footer action link chips (e.g. "Join our Group").

      Parameters

      • actions:
            | { text: string; type?: string; url: string }
            | { text: string; type?: string; url: string }[]

      Returns this

    • GenAIImaginePrimitive with status GENERATING — pending-generation placeholder, distinct from addImage()/addVideo()'s READY status.

      Parameters

      • Optionaloptions: {
            estimated_completion_time?: number;
            imagine_type?: "IMAGE" | "ANIMATE";
            textFallback?: boolean;
        }

      Returns this

    • FOATextPrimitive — large heading text, distinct from addText()'s paragraph text.

      Parameters

      • text: string

      Returns this

    • Parameters

      • imageUrl: string
      • Optionaloptions: { instant?: boolean; resolveUrl?: boolean }

      Returns this

    • Two-column key/value table from an object or entries.

      Parameters

      • data: [string, unknown][] | Record<string, unknown>
      • Optionaloptions: { header?: [string, string] }

      Returns this

    • GenAILatexUXPrimitive — has a real AI_RICH_RESPONSE_LATEX submessage (unlike most primitives here).

      Parameters

      • expression: string

      Returns this

    • Parameters

      • Optionallinks: Record<string, any>[]

      Returns this

    • Build a whole card from markdown (headings/code/tables/paragraphs).

      Parameters

      • md: string

      Returns this

    • Parameters

      • Optionaldata: Record<string, any>
      • Optionaloptions: { resolveUrl?: boolean }

      Returns this

    • Parameters

      • Optionaldata: Record<string, any>
      • Optionaloptions: { resolveUrl?: boolean }

      Returns this

    • One-call profile card (compact header + divider + social-entity embed) — the igstalk pattern. EXPERIMENTAL.

      Parameters

      • Optionalprofile: {
            action_url?: string;
            entity_full_name?: string;
            entity_id?: string;
            entity_name?: string;
            entity_type?: string;
            entity_url?: string;
            full_name?: string;
            image?: string;
            is_verified?: boolean;
            label?: string;
            picture_url?: string;
            subtitle?: string;
            title?: string;
            type?: string;
            url?: string;
            username: string;
            verified?: boolean;
        }
      • Optionaloptions: { divider?: boolean; resolveUrl?: boolean }

      Returns this

    • Labelled text progress bar block.

      Parameters

      • label: string
      • value: number
      • Optionalmax: number
      • Optionaloptions: { size?: number }

      Returns this

    • GenAIBotProgressStatusPrimitive — one-shot "searching/working" status chip.

      Parameters

      • title: string
      • Optionaloptions: {
            icon?: string;
            is_in_progress?: boolean;
            target_secondary_screen_id?: string;
            target_secondary_screen_tab_id?: string;
        }

      Returns this

    • GenAIMetaSubsQuotaUpsellPrimitive — subscription-quota-limit upsell card.

      Parameters

      • data: {
            body?: string;
            body_line1?: string;
            body_line2?: string;
            buttons?: { action?: string; deeplink?: string; label: string }[];
            title: string;
        }

      Returns this

    • Push a single raw primitive wrapped in a SingleLayoutViewModel — quickest custom-primitive escape hatch.

      Parameters

      Returns this

    • Parameters

      • OptionalreelsItems: Record<string, any>[]
      • Optionaloptions: { resolveUrl?: boolean }

      Returns this

    • Parameters

      • section: Record<string, any>

      Returns this

    • Add a tappable social-entity embed (IG/FB/etc. profile card). EXPERIMENTAL.

      Parameters

      • Optionaldata: {
            entity_full_name?: string;
            entity_id?: string;
            entity_name?: string;
            entity_picture_url?: string;
            entity_type?: string;
            entity_url?: string;
            full_name?: string;
            heading?: boolean;
            image?: string;
            is_verified?: boolean;
            key?: string;
            label?: string;
            picture_url?: string;
            type?: string;
            url?: string;
            username?: string;
            verified?: boolean;
        }
      • Optionaloptions: { resolveUrl?: boolean }

      Returns this

    • Parameters

      • Optionalsources: Record<string, any>[]
      • Optionaloptions: { resolveUrl?: boolean }

      Returns this

    • GenAISpacerPrimitive — blank vertical spacing.

      Parameters

      • Optionalspacing: number

      Returns this

    • Parameters

      • submessage: Record<string, any>

      Returns this

    • Parameters

      • suggestion: Record<string, any>
      • Optionaloptions: { layout?: string; scroll?: boolean }

      Returns this

    • GenAITaskPrimitive — task/checklist card.

      Parameters

      • data: {
            status?: string;
            subtitle?: string;
            task_id?: string;
            textFallback?: boolean;
            title: string;
        }

      Returns this

    • GenAIBotThinkingStatusPrimitive — one-shot "thinking" status chip.

      Parameters

      • title: string
      • Optionaloptions: {
            icon?: string;
            is_in_progress?: boolean;
            target_secondary_screen_id?: string;
            target_secondary_screen_tab_id?: string;
            textFallback?: boolean;
        }

      Returns this

    • Parameters

      • videoUrl: string
      • Optionaloptions: { autoFill?: boolean; resolveUrl?: boolean }

      Returns this

    • GenAI3PExtWidgetPrimitive — experimental, reverse-engineered; see JSDoc in the .js file for caveats.

      Parameters

      • data: Record<string, any> | Record<string, any>[]
      • Optionaloptions: { layout?: string }

      Returns this

    • Parameters

      • id: string

      Returns { id: string; sections: any[]; submessages: any[] } | null

    • Progressive text reveal ("AI typing" effect): sends once, then patches the same bubble via EDIT protocolMessages until the full text is out. Accepts a plain string (split at word boundaries every ~chunkSize chars) or a pre-split array of chunks. intervalMs (min 300) paces the edits; cursor is shown after partial text while streaming ('' disables).

      Parameters

      • jid: string
      • text: string | string[]
      • Optionaloptions: { chunkSize?: number; cursor?: string; intervalMs?: number; [key: string]: any }

      Returns Promise<{ edits: number; key: any; text: string }>

    • True when name is a reverse-engineered primitive with no public schema backing.

      Parameters

      • name: string

      Returns boolean

    • Parameters

      • name: string
      • data: Record<string, any> | Record<string, any>[]
      • Optionalextra: Record<string, any>

      Returns Record<string, any>

    • Send an image + video as one paired-media unit (messageAssociation).

      Parameters

      • client: any
      • jid: string
      • media: {
            image: string | Buffer<ArrayBufferLike>;
            video: string | Buffer<ArrayBufferLike>;
        }

      Returns Promise<any>

    • Send a support-ticket marker message (messageContextInfo.supportPayload).

      Parameters

      • client: any
      • jid: string
      • text: string
      • Optionaloptions: {
            isAiMessage?: boolean;
            shouldShowSystemMessage?: boolean;
            ticketId?: string;
            version?: number;
        }

      Returns Promise<any>

    • Parameters

      • code: string
      • Optionallang: string

      Returns Record<string, any>