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