feat: added routes to handle whatsapp session

This commit is contained in:
canove
2020-10-26 19:55:07 -03:00
parent 4e9d9f7d15
commit 73cb08a557
13 changed files with 118 additions and 96 deletions

View File

@@ -0,0 +1,16 @@
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);
}
};