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-03 21:57:43 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
310397d7409c0c458faab87d861d8558b6752eda
310397d7
1 parent
79702b9a
webhook plus
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
app.js
app.js
View file @
310397d
...
...
@@ -16,7 +16,7 @@ const client = new line.Client(config);
// register a webhook handler with middleware
// about the middleware, please refer to doc
app
.
post
(
'/webhook'
,
line
.
middleware
(
config
),
(
req
,
res
)
=>
{
app
.
post
(
'
https://bots.dialogflow.com/line/d1584d25-0e52-48da-b6cc-20e021dc5e70
/webhook'
,
line
.
middleware
(
config
),
(
req
,
res
)
=>
{
Promise
.
all
(
req
.
body
.
events
.
map
(
handleEvent
))
.
then
((
result
)
=>
res
.
json
(
result
))
...
...
@@ -63,13 +63,13 @@ function handleEvent(event) {
if
(
dateObj
.
getHours
()
>
12
)
{
formatted
=
dateObj
.
getHours
()
-
12
;
pm
=
true
;
}
}
else
if
(
dateObj
.
getHours
()
<
12
&&
dateObj
.
getHours
()
!=
0
)
{
formatted
=
dateObj
.
getHours
();
}
}
else
if
(
dateObj
.
getHours
()
==
0
)
{
formatted
=
"12"
;
}
}
else
if
(
dateObj
.
getHours
()
==
12
)
{
formatted
=
"12"
;
pm
=
true
;
...
...
@@ -77,14 +77,14 @@ function handleEvent(event) {
if
(
dateObj
.
getMinutes
()
<
10
)
{
formatted
=
formatted
+
":0"
+
dateObj
.
getMinutes
();
}
}
else
{
formatted
=
formatted
+
":"
+
dateObj
.
getMinutes
();
}
if
(
pm
==
true
)
{
formatted
=
formatted
+
" PM"
;
}
}
else
{
formatted
=
formatted
+
" AM"
;
}
...
...
@@ -151,7 +151,7 @@ function sleep(ghour, gmin, ampm) {
console
.
log
(
String
(
retDate
(
res4
)));
console
.
log
(
String
(
retDate
(
res5
)));
console
.
log
(
String
(
retDate
(
res6
)));
$
(
'#resultsNow'
).
fadeIn
();
$
(
'#feedback'
).
fadeIn
();
$
(
'#ad'
).
fadeIn
();
...
...
@@ -215,7 +215,7 @@ function sleep(ghour, gmin, ampm) {
});
*/
app
.
listen
(
3000
,
function
()
{
console
.
log
(
'Linebot listening on port 3000!'
);
...
...
Please
register
or
login
to post a comment