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:41:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bd5211708ecad1a9fea8b87da2f235ee82ba3934
bd521170
1 parent
42c930aa
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
app.js
app.js
View file @
bd52117
...
...
@@ -73,7 +73,7 @@ app.post('/webhook', line.middleware(config), (req, res) => {
// event handler
async
function
handleEvent
(
event
)
{
console
.
log
(
event
.
type
);
console
.
log
(
event
.
message
.
image
);
console
.
log
(
event
.
message
);
if
(
event
.
type
!==
'message'
&&
(
event
.
message
.
type
!==
'text'
||
event
.
message
.
type
!==
'image'
))
{
...
...
@@ -82,7 +82,15 @@ async function handleEvent(event) {
}
else
if
(
event
.
type
==
'message'
&&
event
.
message
.
type
==
'image'
)
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
console
.
log
(
"!"
);
client
.
getMessageContent
(
event
.
message
.
id
)
.
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'
];
...
...
Please
register
or
login
to post a comment