mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 20:29:17 +00:00
feat: added routes to handle whatsapp session
This commit is contained in:
16
backend/src/services/WbotServices/StartWhatsAppSession.ts
Normal file
16
backend/src/services/WbotServices/StartWhatsAppSession.ts
Normal 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);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user