Toggle navigation
Toggle navigation
This project
Loading...
Sign in
오세헌
/
Ingredient-to-Dish-ChatBot
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
전언석
2022-06-06 17:14:43 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8aadc42ab3a3ec7dd9d31872bf907cb58d6bd1e8
8aadc42a
1 parent
c6692242
EDIT : when you texted more than 2 ingredients
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
I_to_D_chatbot/reply.js
I_to_D_chatbot/reply.js
View file @
8aadc42
...
...
@@ -37,15 +37,18 @@ app.post('/hook', function (req, res) {
if
(
error
)
{
console
.
log
(
error
);
}
var
index
=
0
;
var
istrue
=
false
;
var
input_ingredients_list
=
message
.
text
.
split
(
" "
);
console
.
log
(
"A"
);
console
.
log
(
input_ingredients_list
);
for
(
var
i
=
0
;
i
<
results
.
length
;
i
++
)
{
var
ingredients_list
=
results
[
i
].
ingredients
.
split
(
", "
);
for
(
var
j
=
0
;
j
<
ingredients_list
.
length
;
j
++
)
{
if
(
ingredients_list
[
j
]
===
message
.
text
)
{
index
=
i
;
istrue
=
true
;
}
if
(
ingredients_list
.
filter
(
x
=>
input_ingredients_list
.
includes
(
x
)).
length
===
input_ingredients_list
.
length
)
{
index
=
i
;
istrue
=
true
;
break
;
}
}
if
(
istrue
)
{
...
...
Please
register
or
login
to post a comment