Showing
1 changed file
with
71 additions
and
0 deletions
1 | +//============================================================= | ||
2 | +var express = require('express'); | ||
3 | +const request = require('request'); | ||
4 | +const config = require('../config.json'); | ||
5 | +//============================================================= | ||
6 | +const LINE_URL = 'https://api.line.me/v2/bot/message'; | ||
7 | +const TOKEN = config.TOKEN; | ||
8 | +//============================================================= | ||
9 | + | ||
10 | +exports.SayIDontKnow = function (replyToken) { | ||
11 | + request.post( | ||
12 | + { | ||
13 | + url: LINE_URL + '/reply', | ||
14 | + headers: { | ||
15 | + 'Authorization': `Bearer ${TOKEN}` | ||
16 | + }, | ||
17 | + json: { | ||
18 | + "replyToken": replyToken, | ||
19 | + "messages": [ | ||
20 | + { | ||
21 | + "type": "text", | ||
22 | + "text": "이해하지 못했습니다." | ||
23 | + } | ||
24 | + ] | ||
25 | + } | ||
26 | + }, (error, response, body) => { | ||
27 | + console.log(body) | ||
28 | + }); | ||
29 | +} | ||
30 | + | ||
31 | +exports.test_1 = function (replyToken) { | ||
32 | + request.post( | ||
33 | + { | ||
34 | + url: LINE_URL + '/reply', | ||
35 | + headers: { | ||
36 | + 'Authorization': `Bearer ${TOKEN}` | ||
37 | + }, | ||
38 | + json: { | ||
39 | + "replyToken": replyToken, | ||
40 | + "messages": [ | ||
41 | + { | ||
42 | + "type": "text", | ||
43 | + "text": "영화 장르를 선택해주세요." | ||
44 | + } | ||
45 | + ] | ||
46 | + } | ||
47 | + }, (error, response, body) => { | ||
48 | + console.log(body) | ||
49 | + }); | ||
50 | +} | ||
51 | + | ||
52 | +exports.test_2 = function (replyToken) { | ||
53 | + request.post( | ||
54 | + { | ||
55 | + url: LINE_URL + '/reply', | ||
56 | + headers: { | ||
57 | + 'Authorization': `Bearer ${TOKEN}` | ||
58 | + }, | ||
59 | + json: { | ||
60 | + "replyToken": replyToken, | ||
61 | + "messages": [ | ||
62 | + { | ||
63 | + "type": "text", | ||
64 | + "text": "검색할 단어를 입력해주세요." | ||
65 | + } | ||
66 | + ] | ||
67 | + } | ||
68 | + }, (error, response, body) => { | ||
69 | + console.log(body) | ||
70 | + }); | ||
71 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment