You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Connect the account and wait for SuccessChat status]
[Disconnect WhatsApp account on phone]
[Venom should execute onStateChange but it doesn't]
Log Output
nothing in the log
Your Code
venom
.create(
sessionName,
async (base64Qrimg/*, asciiQR, attempts, urlCode*/) => {
console.log(base64Qrimg)
},
async (statusSession/*, session*/) => {
//statusSession return isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || desconnectedMobile || deleteToken || chatsAvailable || deviceNotConnected || serverWssNotConnected || noOpenBrowser || initBrowser || openBrowser || connectBrowserWs || initWhatsapp || erroPageWhatsapp || successPageWhatsapp || waitForLogin || waitChat || successChat
console.log(statusSession)
},
{
multidevice: false, //true,//nao achei na documentacao, mas foi testado e da diferença (se mandar true ou false funciona, se nao mandar nada ai da problema)
browserPathExecutable: '/usr/bin/thorium-shell', //'/usr/bin/thorium-shell', //'/usr/bin/chromium-browser', //'/usr/bin/google-chrome-stable', //'', // browser executable path
folderNameToken: tokenFolder, //folder name when saving tokens
// mkdirFolderToken: '', //folder directory tokens, just inside the venom folder, example: { mkdirFolderToken: '/node_modules', } //will save the tokens folder in the node_modules directory
headless: 'new', // you should no longer use boolean false or true, now use false, true or 'new' learn more https://developer.chrome.com/articles/new-headless/
devtools: false, // Open devtools by default
debug: false, // Opens a debug session
logQR: false, //true, // Logs QR automatically in terminal
// browserWS: '', // If u want to use browserWSEndpoint
browserArgs: ['--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--disable-gpu',
'--window-size=640,480',
'--disable-infobars',
'--disable-extensions',
], // Original parameters ---Parameters to be added into the chrome browser instance
// addBrowserArgs: [''], // Add broserArgs without overwriting the project's original
// puppeteerOptions: {}, // Will be passed to puppeteer.launch
disableSpins: true, // Will disable Spinnies animation, useful for containers (docker) for a better log
disableWelcome: true, // Will disable the welcoming message which appears in the beginning
updatesLog: false, //true, // Logs info updates automatically in terminal
autoClose: 60000, //60000, // Automatically closes the venom-bot only when scanning the QR code (default 60 seconds, if you want to turn it off, assign 0 or false)
// createPathFileToken: true, //false, // creates a folder when inserting an object in the client's browser, to work it is necessary to pass the parameters in the function create browserSessionToken
// addProxy: [''], // Add proxy server exemple : [e1.p.webshare.io:01, e1.p.webshare.io:01]
// userProxy: '', // Proxy login username
// userPass: '' // Proxy password
},
// BrowserInstance
(browser, waPage) => {
// console.log('Browser PID:', browser.process().pid);
// waPage.screenshot({ path: 'screenshot.png' });
}
)
.then((client) => {
start(client, sessionName);
})
.catch(async (erro) => {
console.error(erro)
});
start = (client, sessionName) => {
client.onStateChange((state) => {
console.log('State changed: ', state);
});
}
Detail: statusSession also does not trigger console.log
The text was updated successfully, but these errors were encountered:
Description
When disconnected on Whatsapp, Venom does not trigger onStateChange
Environment
Steps to Reproduce
Log Output
nothing in the log
Your Code
Detail: statusSession also does not trigger console.log
The text was updated successfully, but these errors were encountered: