wwebjs / wwebjs.dev Goto Github PK
View Code? Open in Web Editor NEWHome to the wwebjs.dev site and official whatsapp-web.js guide
Home Page: https://wwebjs.dev
License: MIT License
Home to the wwebjs.dev site and official whatsapp-web.js guide
Home Page: https://wwebjs.dev
License: MIT License
iam tried to add button with message. but its not working
Location Message Not working
Hi
I installed packet
npm i whatsapp-web.js
I add example code first line to my project
const { Client } = require('whatsapp-web.js');
but while this line is active, the project does not compile.
while this line is passive, the project is compile.
Error messages
**BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }**
**My modules versions**
Angular CLI: 13.3.10
Node: 14.16.0
Package Manager: npm 6.14.11
OS: win32 x64
Angular: 13.3.12
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1303.10
@angular-devkit/build-angular 13.3.10
@angular-devkit/core 12.2.18
@angular-devkit/schematics 12.2.18
@angular/cdk 8.2.3
@angular/cli 13.3.10
@schematics/angular 12.2.18
rxjs 6.5.5
typescript 4.6.4
webpack 5.83.1
![SS](https://github.com/wwebjs/wwebjs.dev/assets/123541143/81f4ae13-ff87-4fc9-8fa6-6c2e177dac8a)
Aplicação rodando na porta *: 8001 . Acesse no link: http://localhost:8001
C:\chatbot_mcbc\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34
const version = indexHtml.match(/manifest-([\d\.]+).json/)[1];
^
TypeError: Cannot read properties of null (reading '1')
at LocalWebCache.persist (C:\chatbot_mcbc\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69)
at C:\chatbot_mcbc\node_modules\whatsapp-web.js\src\Client.js:771:36
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
I have gotten banned on more than 5 numbers and yes is 3 where physically sims and i set all those arg on puppeteer
So i decided to replicate my code with just text and no list or button
Now the bot has been running for 2 days straight now without getting banned and i even setup another bot to message the other bot and they are ping each othere every 5secs yet still no ban because i didn't use list and button
But building bot without button and list is bad for user experience and bad for the kind of stuff i am building i will be glad if this can be looked into and fixed thanks
When you copy a code sample like for installing the module, the $ sign gets copied also. Example when you copy the install command and paste in your console, what you get will be $ npm i whatsapp-web.js
D:\Web Developement\UDEMY\Whatsapp Bot\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: Cannot read properties of undefined (reading 'default')
at puppeteer_evaluation_script:5:95
at ExecutionContext._evaluateInternal (D:\Web Developement\UDEMY\Whatsapp Bot\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 (D:\Web Developement\UDEMY\Whatsapp Bot\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16)
at async Client.initialize (D:\Web Developement\UDEMY\Whatsapp Bot\node_modules\whatsapp-web.js\src\Client.js:323:9)
Node.js v20.11.1
this error is thrown by this
after generating qr even if qr scaned then its not going in readyness means client is not getting ready after qr scan
below is the code I have:
const { Client, LegacySessionAuth } = require('whatsapp-web.js');
const qrcode = require('qrcode-terminal');
try {
let client = new Client();
client.on('qr', (qr) => {
qrcode.generate(qr, { small: true });
console.log('QR RECEIVED', qr);
});
// Save session values to the file upon successful auth
client.on('authenticated', (session) => {
console.log(session, typeof session);
});
client.on('ready', () => {
console.log('Client is ready!');
});
client.on('message', msg => {
console.log('Message received:', msg);
});
client.initialize();
} catch (e) {
console.log(e);
throw new Error(e);
}
in result, everything is working fine just the session after authentication is not getting console logged, instead undefined is loged
as per: https://wwebjs.dev/guide/authentication.html#the-authenticated-event
C:\Visual Studio Code\whatsappbot>node whatsappbot.js
C:\Visual Studio Code\whatsappbot\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34
const version = indexHtml.match(/manifest-([\d\.]+).json/)[1];
^
TypeError: Cannot read properties of null (reading '1')
at LocalWebCache.persist (C:\Visual Studio Code\whatsappbot\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34:69)
at C:\Visual Studio Code\whatsappbot\node_modules\whatsapp-web.js\src\Client.js:786:36
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
wwebjs-bot\node_modules\whatsapp-web.js\src\webCache\LocalWebCache.js:34
const version = indexHtml.match(/manifest-([\d\.]+).json/)[1];
\wwebjs-bot\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: Cannot read properties of undefined (reading 'default')
at puppeteer_evaluation_script:5:95
erroors
The RemoteAuth strategy is not documented in our guide https://wwebjs.dev/guide/authentication.html
D:\Web Developement\UDEMY\Whatsapp Bot\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: Cannot read properties of undefined (reading 'default')
at puppeteer_evaluation_script:5:95
at ExecutionContext._evaluateInternal (D:\Web Developement\UDEMY\Whatsapp Bot\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 (D:\Web Developement\UDEMY\Whatsapp Bot\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16)
at async Client.initialize (D:\Web Developement\UDEMY\Whatsapp Bot\node_modules\whatsapp-web.js\src\Client.js:323:9)
Node.js v20.11.1
this error is thrown by this
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.