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-04 23:13:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eb71bd9a73c36464f2f994924402875294fed02b
eb71bd9a
1 parent
4380c0cb
image
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
app.js
app.js
View file @
eb71bd9
...
...
@@ -82,10 +82,18 @@ app.post('/webhook', line.middleware(config), (req, res) => {
// event handler
function
handleEvent
(
event
)
{
console
.
log
(
event
.
message
);
if
(
event
.
type
!==
'message'
||
event
.
message
.
type
!==
'text'
)
{
if
(
event
.
type
!==
'message'
&&
event
.
message
.
type
!==
'text'
)
{
// ignore non-text-message event
return
Promise
.
resolve
(
null
);
}
if
(
event
.
type
==
'message'
&&
event
.
message
.
type
==
'image'
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
var
upload
=
multer
({
dest
:
'photo/'
})
upload
.
single
(
event
.
message
.
image
);
})
}
if
(
event
.
type
==
'message'
&&
event
.
message
.
type
==
'text'
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
//언어 감지 option
var
detect_options
=
{
...
...
@@ -152,6 +160,7 @@ function handleEvent(event) {
});
}
}
app
.
get
(
'/'
,(
req
,
res
)
=>
{
res
.
send
(
"hellow"
);
})
...
...
Please
register
or
login
to post a comment