Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이유혁
/
OSS_Project_Chatbot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
이유혁
2019-11-19 14:10:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6db8e150c8cb7f3e80c53e6e551203c39f2fd0d3
6db8e150
1 parent
926e4faa
slicing error fixed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
QR.PNG
app.js
캡처.PNG
QR.PNG
0 → 100644
View file @
6db8e15
7.33 KB
app.js
View file @
6db8e15
...
...
@@ -83,6 +83,7 @@ const option_maker = (api_connector, event) => {
// 8.th : 태국어
// 9.id : 인도네시아어
let
target
=
''
;
let
checker
=
true
;
if
(
detect_body
.
langCode
==
'ko'
)
{
target
=
'en'
;
switch
(
event
.
message
.
text
.
slice
(
-
3
))
{
...
...
@@ -108,17 +109,30 @@ const option_maker = (api_connector, event) => {
target
=
'id'
;
break
;
default
:
checker
=
false
;
break
;
}
}
else
{
checker
=
false
;
target
=
'ko'
;
}
var
options
=
{
url
:
translate_api_url
,
form
:
{
'source'
:
detect_body
.
langCode
,
'target'
:
target
,
'text'
:
event
.
message
.
text
.
slice
(
0
,
-
3
)},
headers
:
{
'X-Naver-Client-Id'
:
client_id
,
'X-Naver-Client-Secret'
:
client_secret
}
};
let
options
=
{}
if
(
checker
)
{
options
=
{
url
:
translate_api_url
,
form
:
{
'source'
:
detect_body
.
langCode
,
'target'
:
target
,
'text'
:
event
.
message
.
text
.
slice
(
0
,
-
3
)},
headers
:
{
'X-Naver-Client-Id'
:
client_id
,
'X-Naver-Client-Secret'
:
client_secret
}
};
}
else
{
options
=
{
url
:
translate_api_url
,
form
:
{
'source'
:
detect_body
.
langCode
,
'target'
:
target
,
'text'
:
event
.
message
.
text
},
headers
:
{
'X-Naver-Client-Id'
:
client_id
,
'X-Naver-Client-Secret'
:
client_secret
}
}
}
resolve
(
options
);
}
else
{
...
...
@@ -157,3 +171,5 @@ const receive_result = (options, event) => {
app
.
listen
(
3000
,
function
()
{
console
.
log
(
'Linebot listening on port 3000!'
);
});
// 무조건 3글자 자르면 짧은글 씹힌다
\ No newline at end of file
...
...
캡처.PNG
0 → 100644
View file @
6db8e15
20.3 KB
Please
register
or
login
to post a comment