Wapi.js Docs / AdInteractionEvent

Class: AdInteractionEvent

Represents an ad interaction event.

Implements

Extends

Implements

Constructors

new AdInteractionEvent()

new AdInteractionEvent(params): AdInteractionEvent

Creates a new instance of AdInteractionEvent.

Parameters

params

The parameters for creating the AdInteractionEvent.

params.client: Client

The client object.

params.data

The data object.

params.data.from: string

params.data.id: string

params.data.isForwarded: boolean

params.data.source

params.data.source.ctwaClid: string

params.data.source.description: string

params.data.source.id: string

params.data.source.mediaType: AdInteractionSourceMediaTypeEnum

params.data.source.mediaUrl?: string

params.data.source.thumbnailUrl: string

params.data.source.title: string

params.data.source.type: AdInteractionSourceTypeEnum

params.data.source.url: string

params.data.text: string

params.data.timestamp: string

Returns

AdInteractionEvent

Overrides

MessageEvent.constructor

Source

packages/wapi.js/src/webhook/events/interaction/index.ts:254

Properties

client

client: Client

The client instance associated with the event.

Implementation of

AdInteractionEventInterface.client

Inherited from

MessageEvent.client

Source

packages/wapi.js/src/webhook/events/base/index.ts:20


context

context: MessageContext

The context of the message.

Implementation of

AdInteractionEventInterface.context

Inherited from

MessageEvent.context

Source

packages/wapi.js/src/webhook/events/base/index.ts:37


isForwarded

isForwarded: boolean

Inherited from

MessageEvent.isForwarded

Source

packages/wapi.js/src/webhook/events/base/index.ts:39


messageId

messageId: string

The ID of the message.

Implementation of

AdInteractionEventInterface.messageId

Inherited from

MessageEvent.messageId

Source

packages/wapi.js/src/webhook/events/base/index.ts:36


source

source: object

ctwaClid

ctwaClid: string

description

description: string

id

id: string

mediaType

mediaType: AdInteractionSourceMediaTypeEnum

mediaUrl?

optional mediaUrl: string

thumbnailUrl

thumbnailUrl: string

title

title: string

type

type: AdInteractionSourceTypeEnum

url

url: string

Implementation of

AdInteractionEventInterface.source

Source

packages/wapi.js/src/webhook/events/interaction/index.ts:221


text

text: string

Implementation of

AdInteractionEventInterface.text

Source

packages/wapi.js/src/webhook/events/interaction/index.ts:220


timestamp

timestamp: number

The timestamp of the message.

Implementation of

AdInteractionEventInterface.timestamp

Inherited from

MessageEvent.timestamp

Source

packages/wapi.js/src/webhook/events/base/index.ts:38

Methods

react()

react(params): Promise<object | object>

Reacts to the message with an emoji.

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

MessageEvent.react

Source

packages/wapi.js/src/webhook/events/base/index.ts:100


read()

read(): Promise<object | object | object | object | object>

Marks the message as read.

Returns

Promise<object | object | object | object | object>

  • A promise that resolves with the read response.

Inherited from

MessageEvent.read

Memberof

MessageEvent

Source

packages/wapi.js/src/webhook/events/base/index.ts:121


reply()

reply<T>(props): Promise<object | object>

Sends a reply to the message.

Type parameters

T extends BaseMessage<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

MessageEvent.reply

Throws

  • If the context message ID is not found.

Source

packages/wapi.js/src/webhook/events/base/index.ts:75