code cleanup

This commit is contained in:
canove
2020-09-22 10:18:38 -03:00
parent 48dbf7e859
commit 6bc3b216c8
21 changed files with 12 additions and 1276 deletions

View File

@@ -1,5 +1,7 @@
import { Request, Response } from "express";
import { getIO } from "../libs/socket";
import { initWbot } from "../libs/wbot";
import wbotMessageListener from "../services/WbotServices/wbotMessageListener";
import CreateWhatsAppService from "../services/WhatsappService/CreateWhatsAppService";
import DeleteWhatsAppService from "../services/WhatsappService/DeleteWhatsAppService";
@@ -34,12 +36,12 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
// return res.status(400).json({ error: "Cannot create whatsapp session." });
// }
// initWbot(whatsapp)
// .then(() => {
// wbotMessageListener(whatsapp);
// wbotMonitor(whatsapp);
// })
// .catch(err => console.log(err));
initWbot(whatsapp)
.then(() => {
wbotMessageListener(whatsapp);
// wbotMonitor(whatsapp);
})
.catch(err => console.log(err));
const io = getIO();
io.emit("whatsapp", {