New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It takes a very long time for messages to be sent to large chats #2727
Comments
The client's constant: const client = new Client({
authStrategy: new LocalAuth(),
puppeteer: {
executablePath: process.env.CHROME_EXECUTABLE_PATH,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
headless: 'new',
}
}); |
I can also add that the system is used without a graphical shell (terminal only). If this is important, please let us know |
@thedeaddan |
@alechkos |
@thedeaddan |
The delay is after each message or after you started the script and it is sending to 700 users and you can't use other funtion? |
Do you use the updated pr version? |
@pedroslopez Yes |
There is a delay in sending almost every message. It works in the following mode: It received a message from one chat for 500+ people and forwarded it to another chat for 700+ people. And vice versa |
There is also a problem that if there are a lot of messages in the chat, let's say if it has been working for a long time. Then he just stops receiving them. Either it takes a very long time to receive, and it takes even longer to forward |
@alechkos |
If you currently are using the After it update if you have a problem with forwarding |
@alechkos /root/wapp/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221
throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^
Error: Evaluation failed: TypeError: chat.forwardMessages is not a function
at __puppeteer_evaluation_script__:5:31
at ExecutionContext._evaluateInternal (/root/wapp/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (/root/wapp/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
at async Message.forward (/root/wapp/node_modules/whatsapp-web.js/src/structures/Message.js:441:9)
Node.js v21.6.1 I am sending it using: await msg.forward(target_chat); |
@thedeaddan |
@alechkos |
No, just check it once |
/root/wapp/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221
throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^
Error: Evaluation failed: TypeError: window.Store.Chat.forwardMessagesToChats is not a function
at __puppeteer_evaluation_script__:4:31
at ExecutionContext._evaluateInternal (/root/wapp/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (/root/wapp/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
at async Message.forward (/root/wapp/node_modules/whatsapp-web.js/src/structures/Message.js:441:9)
Node.js v21.6.1 |
@thedeaddan |
@alechkos |
@thedeaddan |
@alechkos |
Yes it works but in the pr |
This is just a branch npm install github:alechkos/whatsapp-web.js#forward-with-caption ? |
@thedeaddan |
@alechkos |
@thedeaddan |
@alechkos And then what can I do? |
You can check the code and fix the implementation or to wait until I'll fix it |
@alechkos const client = new Client({
authStrategy: new LocalAuth(),
puppeteer: {
executablePath: process.env.CHROME_EXECUTABLE_PATH,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
ignoreDefaultArgs: ['--disable-dev-shm-usage'],
ignoreHTTPSErrors: true,
headless: 'new',
}
}); |
@alechkos [2024-02-05 10:41:03] error: Evaluation failed: Error: msg is not a media msg: unknown, isGif=false
at e (https://web.whatsapp.com/:2:4913)
at d (https://web.whatsapp.com/app.f048d8d89717819d6c73.js:269:59333)
at t.getMsgMediaType (https://web.whatsapp.com/app.f048d8d89717819d6c73.js:269:57346)
at https://web.whatsapp.com/app.f048d8d89717819d6c73.js:266:682842
at async Object.window.WWebJS.forwardMediaMessage (__puppeteer_evaluation_script__:308:16)
at async Object.window.WWebJS.forwardMessage (__puppeteer_evaluation_script__:234:28)
at async __puppeteer_evaluation_script__:7:20 |
I have the same problem, is there already a solution to this? |
npm install github:alechkos/whatsapp-web.js#forward-with-caption But the work is still not stable, even on this branch. You have to constantly restart the script |
Did you figure out why? |
Is there an existing issue for this?
Describe the bug
When the bot forwards a message to a chat for ~700 people. That's a very high delay in sending. And an error often occurs:
[2024-01-15 13:32:37] error: Evaluation failed: Error: msg is not a media msg: unknown, isGif=false at e (https://web.whatsapp.com/:2:4911) at d (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:269:59292) at t.getMsgMediaType (https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:269:57305) at https://web.whatsapp.com/app.d61b42d11fedf617d4e8.js:266:676147 at async Object.window.WWebJS.forwardMediaMessage (__puppeteer_evaluation_script__:308:16) at async Object.window.WWebJS.forwardMessage (__puppeteer_evaluation_script__:234:28) at async __puppeteer_evaluation_script__:7:20
Expected behavior
The forwarding speed should be higher
Steps to Reproduce the Bug or Issue
await msg.forward(msg.chat);
Relevant Code
No response
Browser Type
Chromium
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
OS: Debian GNU/Linux 11 (bullseye) x86_64
Phone OS: Android 13
whatsapp-web.js version: v1.23.1-alpha.4
WhatsApp Web version: 2.2402.5
NodeJS ver: v20.9.0
Additional context
No response
The text was updated successfully, but these errors were encountered: