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:43:20 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
338031bc2c4db2af8959a7fcb51c3d7cf5a3b898
338031bc
1 parent
bd521170
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
app.js
app.js
View file @
338031b
...
...
@@ -86,11 +86,6 @@ async function handleEvent(event) {
.
then
((
stream
)
=>
{
stream
.
on
(
'data'
,
(
chunk
)
=>
{
console
.
log
(
chunk
);
});
stream
.
on
(
'error'
,
(
err
)
=>
{
// error handling
});
});
var
cheerio
=
require
(
'cheerio'
);
let
subscriptionKey
=
process
.
env
[
'COMPUTER_VISION_SUBSCRIPTION_KEY'
];
...
...
@@ -108,7 +103,7 @@ async function handleEvent(event) {
'Content-Type'
:
'application/octet-stream'
,
'Ocp-Apim-Subscription-Key'
:
subscriptionKey
},
body
:
event
.
message
.
image
body
:
chunk
};
await
request
.
post
(
options
,
function
(
error
,
response
,
body
)
{
...
...
@@ -148,6 +143,12 @@ async function handleEvent(event) {
client
.
replyMessage
(
event
.
replyToken
,
result
).
then
(
resolve
).
catch
(
reject
);
});
});
});
stream
.
on
(
'error'
,
(
err
)
=>
{
// error handling
});
});
})
}
else
if
(
event
.
type
==
'message'
&&
event
.
message
.
type
==
'text'
)
...
...
Please
register
or
login
to post a comment