-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrichmenu.sh
93 lines (89 loc) · 1.97 KB
/
richmenu.sh
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
#!/bin/bash
source ./.env.local
RES=$(curl -v -X POST https://api.line.me/v2/bot/richmenu \
-H "Authorization: Bearer $NEXT_PUBLIC_LINE_CHANNEL_ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d \
'{
"size":{
"width":800,
"height":540
},
"selected": false,
"name": "LINE Developers Info",
"chatBarText": "メニュー",
"areas": [
{
"bounds": {
"x": 0,
"y": 0,
"width": 533,
"height": 270
},
"action": {
"type": "message",
"label": "ゲームスタート",
"text": "小倉駅に到着"
}
},
{
"bounds": {
"x": 534,
"y": 0,
"width": 266,
"height": 270
},
"action": {
"type": "message",
"label": "あそびかた",
"text": "あそびかた"
}
},
{
"bounds": {
"x": 0,
"y": 270,
"width": 266,
"height": 270
},
"action": {
"type": "message",
"label": "マップ",
"text": "マップ"
}
},
{
"bounds": {
"x": 266,
"y": 270,
"width": 266,
"height": 270
},
"action": {
"type": "uri",
"label": "駅図鑑",
"uri": "https://liff.line.me/2000511797-WMOglq88"
}
},
{
"bounds": {
"x": 534,
"y": 270,
"width": 266,
"height": 270
},
"action": {
"type": "uri",
"label": "シナリオリスト",
"uri": "https://liff.line.me/2000511797-WMOglq88/scenario"
}
}
]
}')
richMenuId=$(echo $RES | jq -r '.richMenuId')
curl -v -X POST https://api-data.line.me/v2/bot/richmenu/$richMenuId/content \
-H "Authorization: Bearer $NEXT_PUBLIC_LINE_CHANNEL_ACCESS_TOKEN" \
-H "Content-Type: image/jpeg" \
-T ./public/richmenu.png
curl -v -X POST https://api.line.me/v2/bot/user/all/richmenu/$richMenuId \
-H "Authorization: Bearer $NEXT_PUBLIC_LINE_CHANNEL_ACCESS_TOKEN"