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
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sckim
2019-11-16 20:26:41 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
94c7aa5e6faf9828dc0341e41262641b545ef8eb
94c7aa5e
1 parent
23ffc2a4
del id, password
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
app.js
app.js
View file @
94c7aa5
...
...
@@ -16,10 +16,8 @@ var languagedetect_api_url = 'https://openapi.naver.com/v1/papago/detectLangs'
// Naver Auth Key
//새로 발급받은 naver papago api id, pw 입력
var
detect_client_id
=
process
.
env
.
detect_client_id
;
var
detect_client_secret
=
process
.
env
.
detect_client_secret
;
var
papago_client_id
=
process
.
env
.
papago_client_id
;
var
papago_client_secret
=
process
.
env
.
papago_client_secret
;
var
client_id
=
process
.
env
.
client_id
;
var
client_secret
=
process
.
env
.
client_secret
;
const
config
=
{
channelAccessToken
:
process
.
env
.
channelAccessToken
,
channelSecret
:
process
.
env
.
channelSecret
,
...
...
@@ -55,7 +53,7 @@ function handleEvent(event) {
var
detect_options
=
{
url
:
languagedetect_api_url
,
form
:
{
'query'
:
event
.
message
.
text
},
headers
:
{
'X-Naver-Client-Id'
:
detect_client_id
,
'X-Naver-Client-Secret'
:
detect_
client_secret
}
headers
:
{
'X-Naver-Client-Id'
:
client_id
,
'X-Naver-Client-Secret'
:
client_secret
}
};
//papago 언어 감지
...
...
@@ -80,7 +78,7 @@ 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'
:
papago_client_id
,
'X-Naver-Client-Secret'
:
papago_
client_secret
}
headers
:
{
'X-Naver-Client-Id'
:
client_id
,
'X-Naver-Client-Secret'
:
client_secret
}
};
// Naver Post API
...
...
Please
register
or
login
to post a comment