Exception.js
2.02 KB
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
//=============================================================
var express = require('express');
const request = require('request');
const config = require('./config.json');
//=============================================================
const LINE_URL = 'https://api.line.me/v2/bot/message';
const TOKEN = config.TOKEN;
//=============================================================
exports.SayIDontKnow = function (replyToken) {
request.post(
{
url: LINE_URL + '/reply',
headers: {
'Authorization': `Bearer ${TOKEN}`
},
json: {
"replyToken": replyToken,
"messages": [
{
"type": "text",
"text": "이해하지 못했습니다."
}
]
}
}, (error, response, body) => {
console.log(body)
});
}
exports.test_1 = function (replyToken) {
request.post(
{
url: LINE_URL + '/reply',
headers: {
'Authorization': `Bearer ${TOKEN}`
},
json: {
"replyToken": replyToken,
"messages": [
{
"type": "text",
"text": "영화 장르를 선택해주세요."
}
]
}
}, (error, response, body) => {
console.log(body)
});
}
exports.test_2 = function (replyToken) {
request.post(
{
url: LINE_URL + '/reply',
headers: {
'Authorization': `Bearer ${TOKEN}`
},
json: {
"replyToken": replyToken,
"messages": [
{
"type": "text",
"text": "검색할 단어를 입력해주세요."
}
]
}
}, (error, response, body) => {
console.log(body)
});
}