Class: AudioMessageEvent
Represents an event for an audio message.Implements
Extends
Implements
Constructors
new AudioMessageEvent()
new AudioMessageEvent(Creates a new instance of AudioMessageEvent.params
):AudioMessageEvent
Parameters
• params The parameters for creating the AudioMessageEvent. • params.client:Client
The client associated with the event.
• params.data
The data associated with the event.
• params.data.audio: AudioMessage
• params.data.from: string
• params.data.isForwarded: boolean
• params.data.mediaId: string
• params.data.messageId: string
• params.data.mimeType: string
• params.data.sha256: string
• params.data.timestamp: string
Returns
AudioMessageEvent
Overrides
MediaMessageEvent
.constructor
Memberof
AudioMessageEventSource
packages/wapi.js/src/webhook/events/audio/index.ts:34Properties
audio
audio: AudioMessage
The audio message associated with the event.
Implementation of
AudioMessageEventInterface
.audio
Source
packages/wapi.js/src/webhook/events/audio/index.ts:16client
client: Client
The client instance associated with the event.
Implementation of
AudioMessageEventInterface
.client
Inherited from
MediaMessageEvent
.client
Source
packages/wapi.js/src/webhook/events/base/index.ts:20context
context: MessageContext
The context of the message.
Implementation of
AudioMessageEventInterface
.context
Inherited from
MediaMessageEvent
.context
Source
packages/wapi.js/src/webhook/events/base/index.ts:37isForwarded
isForwarded: boolean
Inherited from
MediaMessageEvent
.isForwarded
Source
packages/wapi.js/src/webhook/events/base/index.ts:39mediaId
mediaId: string
The ID of the media.
Implementation of
AudioMessageEventInterface
.mediaId
Inherited from
MediaMessageEvent
.mediaId
Source
packages/wapi.js/src/webhook/events/base/index.ts:147messageId
messageId: string
The ID of the message.
Implementation of
AudioMessageEventInterface
.messageId
Inherited from
MediaMessageEvent
.messageId
Source
packages/wapi.js/src/webhook/events/base/index.ts:36mimeType
mimeType: string
The MIME type of the media.
Implementation of
AudioMessageEventInterface
.mimeType
Inherited from
MediaMessageEvent
.mimeType
Source
packages/wapi.js/src/webhook/events/base/index.ts:148sha256
sha256: string
The SHA256 hash of the media.
Implementation of
AudioMessageEventInterface
.sha256
Inherited from
MediaMessageEvent
.sha256
Source
packages/wapi.js/src/webhook/events/base/index.ts:149timestamp
timestamp: number
The timestamp of the message.
Implementation of
AudioMessageEventInterface
.timestamp
Inherited from
MediaMessageEvent
.timestamp
Source
packages/wapi.js/src/webhook/events/base/index.ts:38Methods
getUrl()
getUrl():Gets the URL of the media.Promise
<string
>
Returns
Promise
<string
>
- A promise that resolves with the URL of the media.
Implementation of
AudioMessageEventInterface
.getUrl
Inherited from
MediaMessageEvent
.getUrl
Source
packages/wapi.js/src/webhook/events/base/index.ts:191react()
react(Reacts to the message with an emoji.params
):Promise
<object
|object
>
Parameters
• params The parameters for the reaction. • params.emoji:string
The emoji to react with.
• params.phoneNumber: string
The phone number of the sender.
Returns
Promise
<object
| object
>
- A promise that resolves with the reaction response.
Inherited from
MediaMessageEvent
.react
Source
packages/wapi.js/src/webhook/events/base/index.ts:100read()
read():Marks the message as read.Promise
<object
|object
|object
|object
|object
>
Returns
Promise
<object
| object
| object
| object
| object
>
- A promise that resolves with the read response.
Inherited from
MediaMessageEvent
.read
Memberof
MessageEventSource
packages/wapi.js/src/webhook/events/base/index.ts:121reply()
reply<Sends a reply to the message.T
>(props
):Promise
<object
|object
>
Type parameters
• T extendsBaseMessage
<string
>
Parameters
• props The properties for the reply. • props.message:T
The message to send as a reply.
Returns
Promise
<object
| object
>
- A promise that resolves when the reply is sent.
Inherited from
MediaMessageEvent
.reply
Throws
- If the context message ID is not found.