-
Notifications
You must be signed in to change notification settings - Fork 0
/
messageTemplate.js
57 lines (55 loc) · 1.28 KB
/
messageTemplate.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
exports.textMessage = function(text)
{
return {
"type": "text",
"text": text
}
}
exports.imagemapMessage = function (text, url) {
return {
"type": "imagemap",
"baseUrl": url, // input your image path
"altText": "This is an imagemap",
"baseSize": {"height": 1040,"width": 1040},
"actions": [
{
"type": "message",
"text": text[0],
"area": {"x": 0,"y": 360,"width": 520,"height": 340}
},
{
"type": "message",
"text": text[1],
"area": {"x": 520,"y": 360,"width": 520,"height": 340}
},
{
"type": "message",
"text": text[2],
"area": {"x": 0,"y": 700,"width": 520,"height": 340}
},
{
"type": "message",
"text": text[3],
"area": {"x": 520,"y": 700,"width": 520,"height": 340}
}
]
}
}
exports.singleImagemapMessage = function (typeName)
{
if (typeName == "0") {
return {
"type": "imagemap",
"baseUrl": 'https://i.imgur.com/8cbL5dl.jpg', // input your image path
"altText": "altText",
"baseSize": {"width": 1040, "height": 1040},
"actions": [
{
"type": "message",
"text": "text",
"area": {"x": 0,"y": 0,"width": 1040,"height": 1040}
}
]
}
}
}