Toggle navigation
Toggle navigation
This project
Loading...
Sign in
방승일
/
find_mbti_bot
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
Minkyung Ko
2022-06-02 02:09:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5ed7725267e07150b1f7e9bbbdb9c6f14a63b7e6
5ed77252
1 parent
3a2052ce
Add question14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
app/app.js
app/app.js
View file @
5ed7725
...
...
@@ -283,6 +283,47 @@ apiRouter.post('/question13', (req, res) => {
res
.
status
(
200
).
send
(
responseBody
);
});
apiRouter
.
post
(
'/question14'
,
(
req
,
res
)
=>
{
var
mesg
=
req
.
body
.
userRequest
.
utterance
;
var
userId
=
req
.
body
.
userRequest
.
user
.
id
;
var
mbti
=
''
;
if
(
mesg
==
"네"
){
mbti
=
'I'
;
}
else
if
(
mesg
==
"아니오"
)
{
mbti
=
'E'
;
}
userDB
[
userId
][
0
]
+=
mbti
;
console
.
log
(
userDB
);
const
responseBody
=
{
version
:
"2.0"
,
template
:
{
outputs
:
[
{
simpleText
:
{
text
:
'[question14]\n공부하기 싫을 때 공부는 왜 해야 하는 것인지 고민에 빠질 때가 있습니다.'
}
}
],
quickReplies
:
[
{
action
:
"block"
,
label
:
"네"
,
message
:
"네"
,
blockId
:
"62979c9ce7a0253c7662ccd4"
},
{
action
:
"block"
,
label
:
"아니오"
,
message
:
"아니오"
,
blockId
:
"62979c9ce7a0253c7662ccd4"
}
]
}
}
res
.
status
(
200
).
send
(
responseBody
);
});
app
.
listen
((
process
.
env
.
PORT
||
3000
),
function
()
{
console
.
log
(
'Example skill server listening on port 3000!'
);
});
\ No newline at end of file
...
...
Please
register
or
login
to post a comment