Wapi.js Docs / DocumentMessageEvent
Represents an event that occurs when a document message is received.
new DocumentMessageEvent(
params
):DocumentMessageEvent
Creates a new instance of DocumentMessageEvent.
• params
The parameters for creating the event.
• params.client: Client
The client associated with the event.
• params.data
The data associated with the event.
• params.data.document: DocumentMessage
• 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
packages/wapi.js/src/webhook/events/document/index.ts:35
client:
Client
The client instance associated with the event.
DocumentMessageEventInterface
.client
packages/wapi.js/src/webhook/events/base/index.ts:20
context:
MessageContext
The context of the message.
DocumentMessageEventInterface
.context
packages/wapi.js/src/webhook/events/base/index.ts:37
document:
DocumentMessage
The document message associated with the event.
DocumentMessageEventInterface
.document
packages/wapi.js/src/webhook/events/document/index.ts:19
isForwarded:
boolean
packages/wapi.js/src/webhook/events/base/index.ts:39
mediaId:
string
The ID of the media.
DocumentMessageEventInterface
.mediaId
packages/wapi.js/src/webhook/events/base/index.ts:147
messageId:
string
The ID of the message.
DocumentMessageEventInterface
.messageId
packages/wapi.js/src/webhook/events/base/index.ts:36
mimeType:
string
The MIME type of the media.
DocumentMessageEventInterface
.mimeType
packages/wapi.js/src/webhook/events/base/index.ts:148
sha256:
string
The SHA256 hash of the media.
DocumentMessageEventInterface
.sha256
packages/wapi.js/src/webhook/events/base/index.ts:149
timestamp:
number
The timestamp of the message.
DocumentMessageEventInterface
.timestamp
packages/wapi.js/src/webhook/events/base/index.ts:38
getUrl():
Promise
<string
>
Gets the URL of the media.
Promise
<string
>
DocumentMessageEventInterface
.getUrl
packages/wapi.js/src/webhook/events/base/index.ts:191
react(
params
):Promise
<object
|object
>
Reacts to the message with an emoji.
• params
The parameters for the reaction.
• params.emoji: string
The emoji to react with.
• params.phoneNumber: string
The phone number of the sender.
Promise
<object
| object
>
packages/wapi.js/src/webhook/events/base/index.ts:100
read():
Promise
<object
|object
|object
|object
|object
>
Marks the message as read.
Promise
<object
| object
| object
| object
| object
>
MessageEvent
packages/wapi.js/src/webhook/events/base/index.ts:121
reply<
T
>(props
):Promise
<object
|object
>
Sends a reply to the message.
• T extends BaseMessage
<string
>
• props
The properties for the reply.
• props.message: T
The message to send as a reply.
Promise
<object
| object
>
packages/wapi.js/src/webhook/events/base/index.ts:75
Wapi.js Docs / DocumentMessageEvent
Represents an event that occurs when a document message is received.
new DocumentMessageEvent(
params
):DocumentMessageEvent
Creates a new instance of DocumentMessageEvent.
• params
The parameters for creating the event.
• params.client: Client
The client associated with the event.
• params.data
The data associated with the event.
• params.data.document: DocumentMessage
• 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
packages/wapi.js/src/webhook/events/document/index.ts:35
client:
Client
The client instance associated with the event.
DocumentMessageEventInterface
.client
packages/wapi.js/src/webhook/events/base/index.ts:20
context:
MessageContext
The context of the message.
DocumentMessageEventInterface
.context
packages/wapi.js/src/webhook/events/base/index.ts:37
document:
DocumentMessage
The document message associated with the event.
DocumentMessageEventInterface
.document
packages/wapi.js/src/webhook/events/document/index.ts:19
isForwarded:
boolean
packages/wapi.js/src/webhook/events/base/index.ts:39
mediaId:
string
The ID of the media.
DocumentMessageEventInterface
.mediaId
packages/wapi.js/src/webhook/events/base/index.ts:147
messageId:
string
The ID of the message.
DocumentMessageEventInterface
.messageId
packages/wapi.js/src/webhook/events/base/index.ts:36
mimeType:
string
The MIME type of the media.
DocumentMessageEventInterface
.mimeType
packages/wapi.js/src/webhook/events/base/index.ts:148
sha256:
string
The SHA256 hash of the media.
DocumentMessageEventInterface
.sha256
packages/wapi.js/src/webhook/events/base/index.ts:149
timestamp:
number
The timestamp of the message.
DocumentMessageEventInterface
.timestamp
packages/wapi.js/src/webhook/events/base/index.ts:38
getUrl():
Promise
<string
>
Gets the URL of the media.
Promise
<string
>
DocumentMessageEventInterface
.getUrl
packages/wapi.js/src/webhook/events/base/index.ts:191
react(
params
):Promise
<object
|object
>
Reacts to the message with an emoji.
• params
The parameters for the reaction.
• params.emoji: string
The emoji to react with.
• params.phoneNumber: string
The phone number of the sender.
Promise
<object
| object
>
packages/wapi.js/src/webhook/events/base/index.ts:100
read():
Promise
<object
|object
|object
|object
|object
>
Marks the message as read.
Promise
<object
| object
| object
| object
| object
>
MessageEvent
packages/wapi.js/src/webhook/events/base/index.ts:121
reply<
T
>(props
):Promise
<object
|object
>
Sends a reply to the message.
• T extends BaseMessage
<string
>
• props
The properties for the reply.
• props.message: T
The message to send as a reply.
Promise
<object
| object
>
packages/wapi.js/src/webhook/events/base/index.ts:75