-
Notifications
You must be signed in to change notification settings - Fork 6
/
types.ts
40 lines (36 loc) · 820 Bytes
/
types.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
export interface IRasaMessage {
sender: string;
message: string;
}
export interface IButton {
title: string;
payload: string;
}
export interface IRadioCheckbox {
template_type: "radio" | "checkbox";
text: string;
payload?: string;
slot: string;
buttons: {
type?: string;
title?: string;
payload?: string;
}[]
}
export interface IRasaResponse {
text?: string;
image?: string;
custom: IButtonTemplate; // this arrives when Rasa sends a json_message
template?: string;
response?: string;
attachment?: string;
buttons?: IButton[];
elements?: object[]
}
// Using as reference Facebook schemas
// https://developers.facebook.com/docs/messenger-platform/send-messages/templates
export interface IButtonTemplate {
type: string;
payload: IRadioCheckbox;
url: string;
}