Audio API component

Hierarchy (view full)

Constructors

Properties

Constructors

  • Create an Audio object for the API

    Parameters

    • audio: string

      The audio file's link or id

    • isItAnID: boolean = false

      Whether audio is an id (true) or a link (false)

    Returns Audio

    import { Audio } from "whatsapp-api-js/messages";

    const audio_message = new Audio("https://www.example.com/audio.mp3");

    const audio_id_message = new Audio("12345678", true);

Properties

id?: string

The id of the media

link?: string

The link of the media