Comments (3)
I'm trying to receive approximately 50 unread messages with getUnreadMessages(), but it doesn't end up loading and it outputs this error:
ProtocolError: Runtime.callFunctionOn timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
What should I do? Again, is there any function I can use that returns messages inside a specific time window?
from venom.
This is how I use getAllMessagesInChat() and loadEalierMessages() in a loop to retrieve all messages back to a specific date.
let lastMessageCount;
do {
lastMessageCount = allMessages.length;
await sleep(1000);
allMessages = await client.getAllMessagesInChat(id, true, false);
await client.loadEarlierMessages(id);
log.info(' Message count: ' + allMessages.length);
} while (lastMessageCount !== allMessages.length && allMessages[0].t >= fromDate);
loadEarlierMessages() seems to load a batch of 50 messages.
getAllMessagesInChat() then reports more messages in each loop until we get the same number of messages twice in a row (all messages retrieved) or a specific date is reached.
However, the call to loadEalierMessages takes longer and longer and will eventually hit the Puppeteer protocolTimeout value which is 180 seconds by default. In my implementation this evaluates to about 800 messages (per chat room)
from venom.
Related Issues (20)
- Unable to Find Venom Documentation HOT 5
- Session is not presisted after client.close() HOT 1
- typing stops after few seconds
- Error ESM HOT 3
- Message sending time for each number HOT 1
- Update Copyright at Footer HOT 11
- documentation issue HOT 3
- Pair code HOT 1
- Error in install HOT 3
- Media FIles with attached text messages HOT 1
- whatsapp does not seem to be injected in version 2.3 HOT 10
- Javascript error:webpackChunkwhatsapp_web_client is not defined error after whatsapp business 2.3 version update HOT 7
- sendLinkPreview Error HOT 2
- problem in the getNumberProfile function HOT 1
- WhatsApp will soon disallow 'unsafe-inline' and 'unsafe-eval' HOT 6
- Can't install last version (5.0.22) HOT 5
- Feature req: Please integrate apipie.ai
- Whatsapp venom-bot is not responding on 5.0.21 yesterday its working code but today is not working resolve the issue HOT 1
- WAPI is not defined issue found again and again [when sending message to other number to bot & bot is not responding] HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from venom.