Toggle navigation
Toggle navigation
This project
Loading...
Sign in
MotherProject
/
LINEBOT
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
강수인
2018-12-07 00:45:37 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
79fd85ef754be5f1973e142b9a6e5a25ca7c06a6
79fd85ef
1 parent
9f63dc50
카카오에서 라인으로 변경
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
routes/line.js
routes/line.js
0 → 100644
View file @
79fd85e
const
bodyParser
=
require
(
'body-parser'
);
app
.
use
(
bodyParser
.
json
());
app
.
post
(
'/webhook'
,
function
(
request
,
response
)
{
var
eventObj
=
request
.
body
.
events
[
0
];
var
source
=
eventObj
.
source
;
var
message
=
eventObj
.
message
;
// request log
console
.
log
(
'======================'
,
new
Date
()
,
'======================'
);
console
.
log
(
'[request]'
,
request
.
body
);
console
.
log
(
'[request source] '
,
eventObj
.
source
);
console
.
log
(
'[request message]'
,
eventObj
.
message
);
if
(
message
.
type
==
"text"
){
reply
.
send
(
config
.
CHANNEL_ACCESS_TOKEN
,
eventObj
.
replyToken
,
'welcome sooinzzang.com'
);
}
/*
if(message.type = "text" && message.text.indexOf("@momo") != -1){
reply.send(config.CHANNEL_ACCESS_TOKEN, eventObj.replyToken, actionBasic.getBasicExpress());
}
else if(message.type = "text" && /^@.+/g.test(message.text)){
var cmd = message.text.split('@')[1];
console.log('[command]', cmd);
if(typeof cmd !== "undefined" && cmd != ""){
if(cmd == "h" || cmd == "help"){
reply.send(config.CHANNEL_ACCESS_TOKEN, eventObj.replyToken, actionHelp.getHelpExpress());
}
else if(/^r\[.+\]/g.test(cmd)){
reply.send(config.CHANNEL_ACCESS_TOKEN, eventObj.replyToken, actionEnjoy.getRandomExpress(cmd));
}
else if(cmd == "food" || cmd == "밥집"){
reply.send(config.CHANNEL_ACCESS_TOKEN, eventObj.replyToken, actionEnjoy.getFoodExpress());
}
else if(cmd == "contact" || cmd == "ct"){
reply.send(config.CHANNEL_ACCESS_TOKEN, eventObj.replyToken, actionHelp.getContactExpress());
}
}
}
*/
response
.
sendStatus
(
200
);
});
Please
register
or
login
to post a comment