feat: started multiple whatsapps support

This commit is contained in:
canove
2020-09-04 20:18:11 -03:00
parent f7fe3286b8
commit 8786c7ca5e
6 changed files with 72 additions and 36 deletions

View File

@@ -7,7 +7,7 @@ const { getWbot, init } = require("../libs/wbot");
const wbotMonitor = dbSession => {
const io = getIO();
const wbot = getWbot();
const wbot = getWbot(dbSession.name);
try {
wbot.on("change_state", async newState => {
@@ -58,8 +58,8 @@ const wbotMonitor = dbSession => {
setTimeout(
() =>
init()
.then(({ dbSession }) => {
init(dbSession)
.then(() => {
wbotMessageListener();
wbotMonitor(dbSession);
})