Create a Document object for the API
The document file's link or id
Whether document is an id (true) or a link (false)
Optionalcaption: stringDescribes the specified document media
Optionalfilename: stringDescribes the filename for the specific document
import { Document } from "whatsapp-api-js/messages";
const document_message = new Document("https://www.example.com/document.pdf");
const document_id_message = new Document("12345678", true);
const document_caption_message = new Document(
    "https://www.example.com/document.pdf",
    false,
    "Hello world!"
);
const document_filename_message = new Document(
    "https://www.example.com/document.pdf",
    false,
    undefined,
    "a weird filename.pdf"
);
Document API component