whatsapp-api-js - v6.2.2
    Preparing search index...

    Type Alias OnStatusArgs

    type OnStatusArgs = {
        biz_opaque_callback_data?: string;
        contact: ServerContacts;
        conversation?: ServerConversation;
        error?: ServerError;
        id: string;
        offload: typeof offload;
        phone?: string;
        phoneID: string;
        pricing?: ServerPricing;
        raw: PostData;
        recipient: ClientRecipientIdentifier;
        status: string;
        timestamp: string;
        type: "individual" | "group";
        Whatsapp: InstanceType<typeof WhatsAppAPI>;
    }
    Index

    Properties

    biz_opaque_callback_data?: string

    Arbitrary string included in sent messages

    The client's contact info

    conversation?: ServerConversation

    The conversation object

    error?: ServerError

    The error object

    id: string

    The message ID

    offload: typeof offload

    Utility function for offloading code from the main thread, useful for long running tasks such as AI generation

    phone?: string

    The user's phone number (wa_id), with fallback to parent_user_id and user_id

    Prefer using contact.wa_id

    phoneID: string

    The bot's phoneID

    pricing?: ServerPricing

    The pricing object

    The raw data from the API

    A client recipient identifier, provided as a helper for replying messages using sendMessage.

    The code prioritize the parent_user_id over user_id, as it is the recommended way to use it based on the API docs.

    whatsapp.on.message = async ({ phoneID, recipient, reply }) => {
    await whatsapp.sendMessage(phoneID, recipient, new Text("Hi!"));
    // Equivalent to
    await reply(new Text("Hi!"));
    }
    status: string

    The message status

    timestamp: string

    The message timestamp

    type: "individual" | "group"

    The recipient type

    Whatsapp: InstanceType<typeof WhatsAppAPI>

    The WhatsAppAPI instance that emitted the event