유명현

EDIT: Delete unessential vars & comments

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) => {
......
// 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" });
......
......@@ -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} 매물은 아직 없어요!`,
......
const { daangnMultiSearch } = require("./daangnSearch");
const { bunjangMultiSearch } = require("./bunjangSearch");
const { joongnaMultiSearch } = require("./joongnaSearch");
const setCarouselMessage = require("../message/setCarouselMessage");
const marketMultiSearch = (keyword) => {
const result = [];
......