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 16:27:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
131e268d9a7e47b5edd67f90453f7b9968e494ce
131e268d
1 parent
9fbf81db
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
app.js
app.js
View file @
131e268
...
...
@@ -85,11 +85,12 @@ async function handleEvent(event) {
}
else
if
(
event
.
type
==
'message'
&&
event
.
message
.
type
==
'image'
)
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
var
file
;
client
.
getMessageContent
(
event
.
message
.
id
)
.
then
((
stream
)
=>
{
stream
.
on
(
'data'
,
(
chunk
)
=>
{
fs
.
writeFileSync
(
'./photo/1.png'
,
chunk
);
fs
.
writeFileSync
(
'/photo/1.png'
,
chunk
);
file
=
chunk
;
});
});
...
...
@@ -106,7 +107,7 @@ async function handleEvent(event) {
'Content-Type'
:
'application/json'
,
'Ocp-Apim-Subscription-Key'
:
'979dc5d63344438fa4701c62feebb7dc'
},
body
:
chunk
body
:
file
};
console
.
log
(
body
);
request
.
post
(
options
,
function
(
error
,
response
,
body
)
{
...
...
Please
register
or
login
to post a comment