[X] I have checked and am using the latest version of the library.
What type of session are you experiencing this issue on?
Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag
What type of host account are you experiencing this issue on?
Personal account (normal)
Mode
EASY API/CLI
Current Behavior
Script is unable to read the .length of const LoadedMessages = await Client.getAmountOfLoadedMessages()
It returns this error:
Error [TypeError]: Cannot read properties of undefined (reading 'length')
at window.WAPI.getAmountOfLoadedMessages (evaluate at E:\AmecaCore\node_modules\@open-wa\wa-automate\dist\controllers\browser.js:379:94, :2065:28)
at evaluate (evaluate at Client. (E:\AmecaCore\node_modules\@open-wa\wa-automate\dist\api\Client.js:565:44), :0:12)
at #evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:222:56)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:117:16)
at async IsolatedWorld.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\IsolatedWorld.js:124:16)
at async CdpFrame.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Frame.js:343:20)
at async CdpPage.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Page.js:828:20)
Code:
const LoadedMessages = await Client.getAmountOfLoadedMessages()
conLog(`A total of ${LoadedMessages} messages are in cache. `)
if (LoadedMessages >= 1000) {
announce(`Cutting Message Cache, there were ${LoadedMessages} loaded message in cache.`)
const newLoadedMessages = await Client.cutMsgCache()
announce(`Cutted Message Cache (${LoadedMessages}), amount of loaded message now: ${newLoadedMessages}`)
} else {
announce(`Amount of loaded messages: ${LoadedMessages}`)
}
Expected Behavior
Expected to be able the length.
Steps To Reproduce
Run const LoadedMessages = await Client.getAmountOfLoadedMessages()
Are you using the latest version of the library?
What type of session are you experiencing this issue on?
Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag
What type of host account are you experiencing this issue on?
Personal account (normal)
Mode
EASY API/CLI
Current Behavior
Script is unable to read the .length of
const LoadedMessages = await Client.getAmountOfLoadedMessages()
It returns this error:
Code:
Expected Behavior
Expected to be able the length.
Steps To Reproduce
Run
const LoadedMessages = await Client.getAmountOfLoadedMessages()
create() code OR full CLI command + CONFIG
DEBUG INFO
Environment
Screenshots/Logs
No response
Anything else?
Thanks for the hard work :-)