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
yangjisu
2019-06-07 12:13:12 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bb47aa4f266995f0b40802598ce8f55e5fad0650
bb47aa4f
1 parent
b86f0743
Grammar check fixed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
app.js
app.js
View file @
bb47aa4
...
...
@@ -618,7 +618,7 @@ function handleEvent(event) {
if
(
detect_body
.
langCode
=
'en'
)
{
var
grammar
=
{
url
:
EnGrammarCheck_api_url
,
form
:
{
key
:
'9WUGcY6ZayYMphG7'
,
text
:
event
.
message
.
text
},
form
:
{
key
:
config
.
textgear_config
.
key
,
text
:
event
.
message
.
text
},
}
request
.
post
(
grammar
,
function
(
error
,
response
,
body
)
{
if
(
!
error
&&
response
.
statusCode
==
200
)
{
...
...
@@ -640,8 +640,10 @@ function handleEvent(event) {
result
.
text
=
temp
;
var
last_index
=
Object
.
keys
(
objBody
.
errors
).
length
-
1
;
result
.
text
+=
event
.
message
.
text
.
substring
(
objBody
.
errors
[
last_index
][
'offset'
]
+
objBody
.
errors
[
last_index
][
'length'
],
event
.
message
.
text
.
length
);
if
(
last_index
>=
0
)
{
result
.
text
+=
event
.
message
.
text
.
substring
(
objBody
.
errors
[
last_index
][
'offset'
]
+
objBody
.
errors
[
last_index
][
'length'
],
event
.
message
.
text
.
length
);
}
//번역된 문장 보내기
client
.
replyMessage
(
event
.
replyToken
,
result
)
...
...
@@ -704,4 +706,4 @@ function handleEvent(event) {
app
.
listen
(
3000
,
function
()
{
console
.
log
(
"Linebot listening on port 3000!"
);
});
\ No newline at end of file
});
...
...
Please
register
or
login
to post a comment