Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Chat_Bot
/
KaKao_ChatBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
윤준현
2018-11-27 02:34:04 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6743b6ba87fa60c580f1a0f65f5a702115f66a20
6743b6ba
1 parent
ae031aca
TestPromise
Failed
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
app.js
app.js
View file @
6743b6b
...
...
@@ -34,42 +34,47 @@ app.post('/message', function(req,res){
var
send
=
{};
function
delay
(){
switch
(
msg
){
case
'일본'
:
return
new
Promise
(
function
(
resolve
,
reject
){
switch
(
msg
)
{
case
'일본'
:
send
=
{
'message'
:
{
'text'
:
'등록된 가수 목록입니다.'
'message'
:
{
'text'
:
'등록된 가수 목록입니다.'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol'
,
'米津玄師'
,
'yanaginagi'
,
'ヨルシカ'
,
'ダズビ'
,
'Polkadot Stingray'
,
'Aimyong'
]
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'Reol'
,
'米津玄師'
,
'yanaginagi'
,
'ヨルシカ'
,
'ダズビ'
,
'Polkadot Stingray'
,
'Aimyong'
]
}
};
break
;
case
'한국'
:
case
'한국'
:
send
=
{
'message'
:
{
'text'
:
'등록된 가수 목록입니다.'
'message'
:
{
'text'
:
'등록된 가수 목록입니다.'
},
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'볼빨간 사춘기'
,
'MOT'
,
'Gukkasten'
,
'ZICO'
,
'DEAN'
,
'IU'
,
'Heize'
]
keyboard
:
{
'type'
:
'buttons'
,
'buttons'
:
[
'볼빨간 사춘기'
,
'MOT'
,
'Gukkasten'
,
'ZICO'
,
'DEAN'
,
'IU'
,
'Heize'
]
}
};
break
;
default
:
singer
.
jpSinger
(
msg
).
then
(
function
(
result
)
{
singer
.
jpSinger
(
msg
).
then
(
function
(
result
)
{
send
=
result
;
})
if
(
send
==
''
)
if
(
send
==
''
)
send
=
singer
.
krSinger
(
msg
);
break
;
}
if
(
send
){
resolve
(
send
)
}
delay
().
then
(
function
(){
console
.
log
(
send
);
res
.
json
(
send
);
reject
(
new
Error
(
"Request is failed"
));
});
}
delay
().
then
(
function
(
result
){
console
.
log
(
result
);
res
.
json
(
result
);
})
})
\ No newline at end of file
...
...
Please
register
or
login
to post a comment