Files
whaticket-community/backend/src/services/WbotServices/StartWhatsAppSession.ts
2020-10-26 19:55:07 -03:00

17 lines
438 B
TypeScript

import { initWbot } from "../../libs/wbot";
import Whatsapp from "../../models/Whatsapp";
import wbotMessageListener from "./wbotMessageListener";
import wbotMonitor from "./wbotMonitor";
export const StartWhatsAppSession = async (
whatsapp: Whatsapp
): Promise<void> => {
try {
const wbot = await initWbot(whatsapp);
wbotMessageListener(wbot);
wbotMonitor(wbot, whatsapp);
} catch (err) {
console.log(err);
}
};