diff --git a/package.json b/package.json index 10fc789..f45e81d 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "manybot", - "version": "2.3.5", + "version": "2.3.6", "type": "module", "dependencies": { "node-addon-api": "^7", diff --git a/src/handlers/messageHandler.js b/src/handlers/messageHandler.js index 95c780f..95b1a4f 100644 --- a/src/handlers/messageHandler.js +++ b/src/handlers/messageHandler.js @@ -16,7 +16,11 @@ export async function handleMessage(msg) { const chat = await msg.getChat(); const chatId = getChatId(chat); - if (!CHATS.includes(chatId)) return; + // se CHATS estiver vazio, ele pega todos os chats. + // se nao, ele pega os que estão na lista. + if (CHATS.length > 0) { + if (!CHATS.includes(chatId)) return; + } const ctx = await buildMessageContext(msg, chat, BOT_PREFIX); logger.msg(ctx); diff --git a/src/utils/get_id.js b/src/utils/get_id.js index 3da624f..73d0222 100644 --- a/src/utils/get_id.js +++ b/src/utils/get_id.js @@ -17,7 +17,15 @@ if (!arg) { const client = new Client({ authStrategy: new LocalAuth({ clientId: CLIENT_ID }), - puppeteer: { headless: true }, + puppeteer: { + headless: true, + args: [ + '--no-sandbox', + '--disable-setuid-sandbox', + ...(resolvePuppeteerConfig().args || []) + ], + ...resolvePuppeteerConfig() + }, }); client.on("qr", (qr) => {