-
Notifications
You must be signed in to change notification settings - Fork 181
/
ViberVideo.ts
48 lines (46 loc) · 1.2 KB
/
ViberVideo.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { AbstractVideoMessage } from '../AbstractVideoMessage';
import { ViberVideoParams } from '../../types';
/**
* Represents a video message for the Viber Service channel.
*
* @group Viber
*/
export class ViberVideo
extends AbstractVideoMessage
implements ViberVideoParams
{
public channel: 'viber_service';
public viberService;
/**
* Send a video message using the Viber Service channel.
*
* @param {ViberVideoParams} params - The parameters for the ViberVideo message.
* @example
* ```ts
* import { ViberVideo } from '@vonage/messages';
*
* const { messageUUID } = await messagesClient.send(new ViberVideo({
* to: TO_NUMBER,
* from: FROM_NUMBER,
* text: 'Hello world',
* video: {
* url: 'https://my-host.com/my-video.mp4',
* },
* viberService: {
* action: {
* url: 'https://my-host.com/my-path',
* text: 'My button text',
* },
* },
* clientRef: 'my-personal-reference',
* }));
*
* console.log(`Message sent successfully with UUID ${messageUUID}`);
* ```
*/
constructor(params: ViberVideoParams) {
super(params);
this.viberService = params.viberService;
this.channel = 'viber_service';
}
}