Toggle navigation
Toggle navigation
This project
Loading...
Sign in
유명현
/
mamuri-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
유명현
2022-05-30 22:22:52 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
95bb45baefbfa0e9ec7a107420de8f98902696b1
95bb45ba
1 parent
037acbdb
EDIT: Delete unessential vars & comments
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
39 deletions
server/chatbot/check/checkMamul.js
server/chatbot/index.js
server/chatbot/message/setCarouselMessage.js
server/chatbot/search/marketSearch.js
server/chatbot/check/checkMamul.js
View file @
95bb45b
const
{
marketMultiSearch
}
=
require
(
"../search/marketSearch"
);
const
setCarouselMessage
=
require
(
"../message/setCarouselMessage"
);
// Database APIs
const
db
=
require
(
"../../apis/database"
);
// API List
// database.addKeyword = async function(keyword, userId)
// database.deleteKeyword = async function(userId, keyword)
// database.getKeywordsByUserId = async function(userId)
// database.getUsersByKeyword = async function(keyword)
// database.getAllUsers = async function()
// database.getAllKeywords = async function()
const
multiCheckMamul
=
(
client
)
=>
{
db
.
getAllKeywords
().
then
((
keywords
)
=>
{
...
...
server/chatbot/index.js
View file @
95bb45b
// Line chatbot + Message generate functions
const
line
=
require
(
"@line/bot-sdk"
);
// const setFlexMessage = require("./message/setFlexMessage");
const
setCarouselMessage
=
require
(
"./message/setCarouselMessage"
);
// const setKeywordsFlexMessage = require("./message/setKeywordsFlexMessage");
// Market Search
// const { daangnSingleSearch } = require("./search/daangnSearch");
// const { daangnMultiSearch } = require("./search/daangnSearch");
// const { joongnaSingleSearch } = require("./search/joongnaSearch");
// const { joongnaMultiSearch } = require("./search/joongnaSearch");
// const { bunjangSingleSearch } = require("./search/bunjangSearch");
// const { bunjangMultiSearch } = require("./search/bunjangSearch");
const
{
marketMultiSearch
}
=
require
(
"./search/marketSearch"
);
// File search
- Will be deleted (Unused)
// File search
const
fs
=
require
(
"fs"
);
// Cron for Mamul Notification
...
...
@@ -24,13 +16,6 @@ const job = schedule.scheduleJob("0 */1 * * *", () => {
// Database APIs
const
db
=
require
(
"../apis/database"
);
// API List
// database.addKeyword = async function(keyword, userId)
// database.deleteKeyword = async function(userId, keyword)
// database.getKeywordsByUserId = async function(userId)
// database.getUsersByKeyword = async function(keyword)
// database.getAllUsers = async function()
// database.getAllKeywords = async function()
// Import credentials for Line chatbot
require
(
"dotenv"
).
config
({
path
:
__dirname
+
"/../config/.env"
});
...
...
server/chatbot/message/setCarouselMessage.js
View file @
95bb45b
...
...
@@ -3,21 +3,7 @@ const setFlexMessage = require("./setFlexMessage");
function
setCarouselMessage
(
mamuls
,
keyword
)
{
let
flexMessages
=
[];
let
flexMessage
=
{};
if
(
mamuls
[
0
]
==
undefined
// &&
// mamuls[1] == undefined &&
// mamuls[2] == undefined &&
// mamuls[3] == undefined &&
// mamuls[4] == undefined &&
// mamuls[5] == undefined &&
// mamuls[6] == undefined &&
// mamuls[7] == undefined &&
// mamuls[8] == undefined &&
// mamuls[9] == undefined &&
// mamuls[10] == undefined &&
// mamuls[11] == undefined
)
{
if
(
mamuls
[
0
]
==
undefined
)
{
let
nonMamulMessage
=
{
type
:
"flex"
,
altText
:
`
${
keyword
}
매물은 아직 없어요!`
,
...
...
server/chatbot/search/marketSearch.js
View file @
95bb45b
const
{
daangnMultiSearch
}
=
require
(
"./daangnSearch"
);
const
{
bunjangMultiSearch
}
=
require
(
"./bunjangSearch"
);
const
{
joongnaMultiSearch
}
=
require
(
"./joongnaSearch"
);
const
setCarouselMessage
=
require
(
"../message/setCarouselMessage"
);
const
marketMultiSearch
=
(
keyword
)
=>
{
const
result
=
[];
...
...
Please
register
or
login
to post a comment