-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmessages.js
148 lines (146 loc) · 3.97 KB
/
messages.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
'use strict'
const messages={
'menu' : {
attachment: {
type: 'template',
payload: {
template_type: 'generic',
elements: [{
title: 'Your awsome bot',
subtitle: 'Click any button to continue',
item_url: 'http://me.shyjal.com/',
image_url: 'http://messengerdemo.parseapp.com/img/rift.png',
buttons: [{
type: 'postback',
title: 'Image',
payload: 'image',
}, {
type: 'postback',
title: 'Generic',
payload: 'generic',
},{
type: 'postback',
title: 'Receipt',
payload: 'receipt',
}],
}]
}
}
},
'default' : {
text: 'Hit the thumbs up button to show menu.'
},
'image' : {
attachment: {
type: 'image',
payload: {
url: 'http://i.imgur.com/zYIlgBl.png'
}
}
},
'button' : {
attachment: {
type: 'template',
payload: {
template_type: 'button',
text: 'This is test text',
buttons:[{
type: 'web_url',
url: 'http://me.shyjal.com/',
title: 'Open Web URL'
}, {
type: 'postback',
title: 'Call Postback',
payload: 'default'
}]
}
}
},
'generic' : {
attachment: {
type: 'template',
payload: {
template_type: 'generic',
elements: [{
title: 'rift',
subtitle: 'Next-generation virtual reality',
item_url: 'http://me.shyjal.com/',
image_url: 'http://messengerdemo.parseapp.com/img/rift.png',
buttons: [{
type: 'web_url',
url: 'http://me.shyjal.com/',
title: 'Open Web URL'
}, {
type: 'postback',
title: 'Call Postback',
payload: 'default',
}],
}, {
title: 'touch',
subtitle: 'Your Hands, Now in VR',
item_url: 'http://me.shyjal.com/',
image_url: 'http://messengerdemo.parseapp.com/img/touch.png',
buttons: [{
type: 'web_url',
url: 'http://me.shyjal.com/',
title: 'Open Web URL'
}, {
type: 'postback',
title: 'Call Postback',
payload: 'default',
}]
}]
}
}
},
'receipt':{
attachment: {
type: 'template',
payload: {
template_type: 'receipt',
recipient_name: 'Peter Chang',
order_number: 'receiptId',
currency: 'USD',
payment_method: 'Visa 1234',
timestamp: '1428444852',
elements: [{
title: 'Oculus Rift',
subtitle: 'Includes: headset, sensor, remote',
quantity: 1,
price: 599.00,
currency: 'USD',
image_url: 'http://messengerdemo.parseapp.com/img/riftsq.png'
}, {
title: 'Samsung Gear VR',
subtitle: 'Frost White',
quantity: 1,
price: 99.99,
currency: 'USD',
image_url: 'http://messengerdemo.parseapp.com/img/gearvrsq.png'
}],
address: {
street_1: '1 Hacker Way',
street_2: '',
city: 'Menlo Park',
postal_code: '94025',
state: 'CA',
country: 'US'
},
summary: {
subtotal: 698.99,
shipping_cost: 20.00,
total_tax: 57.67,
total_cost: 626.66
},
adjustments: [{
name: 'New Customer Discount',
amount: -50
}, {
name: '$100 Off Coupon',
amount: -100
}]
}
}
}
}
module.exports = messages