venom icon indicating copy to clipboard operation
venom copied to clipboard

getAllChats() returning undefined

Open Divino67 opened this issue 1 year ago • 2 comments

Description

When call the method getAllChats() is returning undefined;

Environment

  • Venom version(s): [e.g. 5.0.17]
  • OS: [e.g. Linux Ubuntu 22.04]
  • Node version: [e.g. Node 16.14.2]

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

For venom-bot >= 5.0.17,

Your Code

My code: async updateContacts(client, companyId) { return await client.getAllChats().then(async resp => { console.log(resp); //undefined if (resp) { const chats = Object.values(resp);

            await ContactModel.updateContacts(chats, companyId);
            
            return true;
        }
        
        return false;
    });
}

Log Output

The client is apparently normal, Here's a console: Whatsapp { browser: CDPBrowser { emitter: { all: [Map], on: [Function: on], off: [Function: off], emit: [Function: emit] }, eventsMap: Map(3) { 'targetcreated' => [Array], 'targetchanged' => [], 'disconnected' => [Array] }, _createPageInContext: [AsyncFunction (anonymous)] }, page: CDPPage { emitter: { all: [Map], on: [Function: on], off: [Function: off], emit: [Function: emit] }, eventsMap: Map(4) { 'pageerror' => [Array], 'close' => [Array], 'load' => [Array], 'dialog' => [Array] } }, session: 'afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4', options: { folderNameToken: 'tokens', mkdirFolderToken: '', headless: true, devtools: false, debug: false, logQR: true, browserWS: '', browserArgs: [ '--no-zygote', '--log-level=3', '--disable-site-isolation-trials', '--no-experiments', '--ignore-gpu-blacklist', '--ignore-certificate-errors', '--ignore-certificate-errors-spki-list', '--disable-gpu', '--disable-extensions', '--disable-default-apps', '--enable-features=NetworkService', '--disable-setuid-sandbox', '--no-sandbox', '--disable-webgl', '--disable-infobars', '--window-position=0,0', '--ignore-certifcate-errors', '--ignore-certifcate-errors-spki-list', '--disable-threaded-animation', '--disable-threaded-scrolling', '--disable-in-process-stack-traces', '--disable-histogram-customizer', '--disable-gl-extensions', '--disable-composited-antialiasing', '--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36', '--disable-background-networking', '--enable-features=NetworkService,NetworkServiceInProcess', '--disable-background-timer-throttling', '--disable-backgrounding-occluded-windows', '--disable-breakpad', '--disable-client-side-phishing-detection', '--disable-component-extensions-with-background-pages', '--disable-dev-shm-usage', '--disable-features=Translate', '--disable-hang-monitor', '--disable-ipc-flooding-protection', '--disable-popup-blocking', '--disable-prompt-on-repost', '--disable-renderer-backgrounding', '--disable-sync', '--force-color-profile=srgb', '--metrics-recording-only', '--no-first-run', '--enable-automation', '--password-store=basic', '--use-mock-keychain', '--enable-blink-features=IdleDetection', '--export-tagged-pdf', 'about:blank', '--user-data-dir=/home/r2-app/r2-whatsapp-api/tokens/afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4' ], addBrowserArgs: [], puppeteerOptions: { userDataDir: '/home/r2-app/r2-whatsapp-api/tokens/afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4', ignoreHTTPSErrors: true }, disableSpins: true, disableWelcome: true, updatesLog: true, autoClose: 120000, createPathFileToken: true, waitForLogin: true, BrowserFetcher: true, forceConnect: false, attemptsForceConnectLoad: 5, forceConnectTime: 5000, addProxy: [], browserPathExecutable: null, session: 'afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4', refreshQR: 15000, useChrome: false }, spinnies: Spinnies { options: { spinnerColor: 'greenBright', succeedColor: 'green', failColor: 'red', spinner: [Object], disableSpins: true, succeedPrefix: '✓', failPrefix: '✖' }, spinners: { 'browser-afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4': [Object], 'browser-Platform-afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4': [Object], 'browser-Version-afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4': [Object], 'whatzapp-afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4': [Object], 'whatzapp-intro-afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4': [Object], 'session-afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4': [Object], 'whatzapp-mode-main-afa2e7c0-e83b-11ec-a3a1-d5e1aca437c4': [Object] }, isCursorHidden: false, currentInterval: null, stream: Socket { connecting: false, _hadError: false, _parent: null, _host: null, _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, _type: 'pipe', fd: 2, _isStdio: true, destroySoon: [Function: destroy], _destroy: [Function: dummyDestroy], [Symbol(async_id_symbol)]: 5, [Symbol(kHandle)]: [Pipe], [Symbol(kSetNoDelay)]: false, [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0 }, lineCount: 0, currentFrameIndex: 0, spin: false }, spinStatus: { apiInject: '', autoCloseRemain: 0, previousText: 'Connected', previousStatus: 'succeed', state: '' }, autoCloseInterval: null, statusFind: [Function (anonymous)], listenerEmitter: EventEmitter { _events: [Object: null prototype] { onInterfaceChange: [AsyncFunction (anonymous)], onStreamChange: [Function (anonymous)], onStateChange: [Array], onMessage: [Function (anonymous)], onAnyMessage: [Function (anonymous)] }, _eventsCount: 5, _maxListeners: undefined, [Symbol(kCapture)]: false } }

Divino67 avatar Aug 15 '23 12:08 Divino67

same here... including all retrieve messages functions. Returning empty array

djmarcosban avatar Sep 15 '23 17:09 djmarcosban

@djmarcosban having the same issues with retrieve messages

apoorvcodes avatar Nov 02 '23 17:11 apoorvcodes

New Release: npm i [email protected] We have support for Venom for just $15 per month, if you are interested, call our support via the link: https://web.whatsapp.com/send?phone=5561985290357

orkestral avatar Apr 03 '24 15:04 orkestral