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:01:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8478e7c6d2d6f281fc87840cdaa9cd80f163bc75
8478e7c6
1 parent
acd75208
Update app.js
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
app.js
app.js
View file @
8478e7c
...
...
@@ -82,12 +82,20 @@ 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
,
event
.
message
.
originalContentUrl
).
then
(
resolve
).
catch
(
reject
);
client
.
replyMessage
(
event
.
replyToken
,
chunk
).
then
(
resolve
).
catch
(
reject
);
}
});
stream
.
on
(
'error'
,
(
err
)
=>
{
// error handling
});
});
});
/*console.log("!");
var cheerio = require('cheerio');
...
...
Please
register
or
login
to post a comment