Toggle navigation
Toggle navigation
This project
Loading...
Sign in
은승우
/
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
은승우
2019-12-02 22:32:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0214d4c7eb6433f483d78835dcac165a213038dc
0214d4c7
1 parent
ce4e638c
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
app.js
app.js
View file @
0214d4c
var
express
=
require
(
"express"
);
var
app
=
express
();
const
line
=
require
(
'@line/bot-sdk'
);
...
...
@@ -97,10 +98,11 @@ function handleEvent(event) {
url
:
translate_api_url
,
// 한국어(source : ko), 영어(target: en), 카톡에서 받는 메시지(text)
form
:
{
'source'
:
source
,
'target'
:
target
,
'text'
:
event
.
message
.
text
},
headers
:
{
'X-Naver-Client-Id'
:
client_id
,
'X-Naver-Client-Secret'
:
client_secret
,
"Content-Type"
:
"application/x-www-form-urlencoded"
}
headers
:
{
'X-Naver-Client-Id'
:
client_id
,
'X-Naver-Client-Secret'
:
client_secret
}
};
console
.
log
(
"?!"
);
// Naver Post API
console
.
log
(
"?!"
);
request
.
post
(
options
,
function
(
error
,
response
,
body
){
// Translate API Sucess
if
(
!
error
&&
response
.
statusCode
==
200
){
...
...
@@ -114,7 +116,6 @@ function handleEvent(event) {
client
.
replyMessage
(
event
.
replyToken
,
result
).
then
(
resolve
).
catch
(
reject
);
}
});
console
.
log
(
"?!"
);
}
// 메시지의 언어가 영어 또는 한국어가 아닐 경우
else
{
...
...
Please
register
or
login
to post a comment