-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuttons.js
50 lines (45 loc) · 932 Bytes
/
buttons.js
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
49
50
function Buttons() {
this.buttons = [];
}
Buttons.prototype.addUrlButton = function(title,url)
{
let button = {
"type":"web_url",
"url":url,
"title":title
};
this.buttons.push(button);
}
Buttons.prototype.addPostbackButton = function(title,payload)
{
let button = {
"type":"postback",
"payload":payload,
"title":title
};
this.buttons.push(button);
}
Buttons.prototype.addCallButton = function(title,payload)
{
let button = {
"type":"phone_number",
"payload":payload,
"title":title
};
this.buttons.push(button);
}
Buttons.prototype.addLogInButton = function(url)
{
let button = {
"type": "account_link",
"url": url
};
this.buttons.push(button);
}
Buttons.prototype.addLogOutButton = function()
{
let button = {
"type": "account_unlink"
};
this.buttons.push(button);
}