Closed ricdim4 closed 9 months ago
why run "npm start"?
here the error
client.on('message', message => {
if(message.body === 'hola'||'Hola'||'buenas'||'Buenas'||'hello'||'Hello') {
message.reply('test'
'test.'
'test');
}
});
you want a new line? try this.
client.on('message', message => {
if(message.body === 'hola'||'Hola'||'buenas'||'Buenas'||'hello'||'Hello') {
message.reply("test\ntest.\ntest");
}
});
Yeah, thank you. Now the bot works correctly, but I got the same error. I don't know if that error will be a problem later.
Is there an existing issue for this?
Describe the bug
When I run, I get this error:
Then I do
node index.js
in the terminal and I get the QR, but the bot doesn't work.I tried changing scripts and modified line 17 in Injected.js but it doesn't work.
Expected behavior
I expected a message saying it ran correctly.
Steps to Reproduce the Bug or Issue
npm start
Relevant Code
const qrcode = require('qrcode-terminal');
const { Client } = require('whatsapp-web.js'); const client = new Client();
client.on('qr', qr => { qrcode.generate(qr, {small: true}); });
client.on('ready', () => { console.log('Client is ready!'); });
client.on('message', message => { if(message.body === 'hola'||'Hola'||'buenas'||'Buenas'||'hello'||'Hello') { message.reply('test'
'test.'
'test'); } });
client.initialize();
Browser Type
Other (please write in Additional Context)
WhatsApp Account Type
WhatsApp Business
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
OS: Windows 10 Phone OS: Android whatsapp-web.js version 1.18.3 Node.js Version v12.13.0
Additional context
Browser: Microsoft Edge