mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 11:49:19 +00:00
code cleanup
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Request, Response } from "express";
|
||||
// import { getIO } from "../libs/socket";
|
||||
|
||||
import { Message as WbotMessage } from "whatsapp-web.js";
|
||||
import SetTicketMessagesAsRead from "../helpers/SetTicketMessagesAsRead";
|
||||
@@ -11,16 +10,6 @@ import ShowTicketService from "../services/TicketServices/ShowTicketService";
|
||||
import SendWhatsAppMedia from "../services/WbotServices/SendWhatsAppMedia";
|
||||
import SendWhatsAppMessage from "../services/WbotServices/SendWhatsAppMessage";
|
||||
|
||||
// import Sequelize from "sequelize";
|
||||
// import { MessageMedia } from "whatsapp-web.js";
|
||||
// import Message from "../models/Message";
|
||||
// import Contact from "../models/Contact";
|
||||
// import User from "../models/User";
|
||||
// import Whatsapp from "../models/Whatsapp";
|
||||
|
||||
// import Ticket from "../models/Ticket";
|
||||
// import { getWbot } from "../libs/wbot";
|
||||
|
||||
type IndexQuery = {
|
||||
searchParam: string;
|
||||
pageNumber: string;
|
||||
|
||||
@@ -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", {
|
||||
|
||||
Reference in New Issue
Block a user