sckim

id, password

Showing 1 changed file with 6 additions and 4 deletions
......@@ -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
......