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
은승우
2019-12-05 12:04:27 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ada6edd300801ee99bf94bda01791b9492805fc8
ada6edd3
1 parent
8478e7c6
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
16 deletions
app.js
app.js
View file @
ada6edd
...
...
@@ -82,21 +82,7 @@ function handleEvent(event) {
}
else
if
(
event
.
type
==
'message'
&&
event
.
message
.
type
==
'image'
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
client
.
getMessageContent
(
event
.
message
.
id
).
then
((
stream
)
=>
{
stream
.
on
(
'data'
,
(
chunk
)
=>
{
request
.
post
(
function
(
error
,
response
,
body
){
// Translate API Sucess
if
(
!
error
&&
response
.
statusCode
==
200
){
client
.
replyMessage
(
event
.
replyToken
,
chunk
).
then
(
resolve
).
catch
(
reject
);
}
});
stream
.
on
(
'error'
,
(
err
)
=>
{
// error handling
});
});
});
/*console.log("!");
console
.
log
(
"!"
);
var
cheerio
=
require
(
'cheerio'
);
let
subscriptionKey
=
process
.
env
[
'COMPUTER_VISION_SUBSCRIPTION_KEY'
];
...
...
@@ -151,7 +137,7 @@ function handleEvent(event) {
}
client
.
replyMessage
(
event
.
replyToken
,
result
).
then
(
resolve
).
catch
(
reject
);
});
});
*/
});
})
}
else
if
(
event
.
type
==
'message'
&&
event
.
message
.
type
==
'text'
)
...
...
Please
register
or
login
to post a comment