question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Heroku] Client is Ready, But not detecting/sending new messages

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hello There! Till yesterday, everything was working fine. But from today morning, I can’t use whatsapp-web.js. Whenever, I run the project, It generates QR Code as normally and then I login. Everything gone fine, but then the bot cannot send message nor can detect any new messages.

image

photo_2022-10-21_08-38-42

Buildpacks Used:

Workers:

  • node index.js

Expected behavior

I expected on triggering !ping, the bot will reply for pong

Steps to Reproduce the Bug or Issue

  1. node index.js
  2. Login with QR Code
  3. Issue Occurred Here

Relevant Code

Main Code:

const qrcode = require('qrcode-terminal');
const { Client } = require('whatsapp-web.js');
const { exec } = require("child_process");

const client = new Client({
	puppeteer: {
		args: ['--no-sandbox'],
	}
});

client.on('qr', qr => {
    qrcode.generate(qr, {small: true});
});

client.on('ready', () => {
    console.log('Client is ready!');
});

client.on('message', message => {
	console.log(message.body);
});

client.on('message', message => {
	if(message.body === '!ping') {
		message.reply('pong');
	}
});

client.initialize()

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Platform: Heroku OS: Linux Phone OS: Android whatsapp-web.js version: v1.17.1 Node.js Version: v10.19.0

Additional context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ninegrafhcommented, Oct 21, 2022

same issues,any solution?

1reaction
rochimupscommented, Oct 21, 2022

same issues,help solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I seeing "Application Error"?
There are some errors which only occur when the app is rebooting so you will need to restart the app to see these...
Read more >
sendGrid not working when I deploy on Heroku
I found the problem, I followed this https://devcenter.heroku.com/articles/sendgrid#provisioning-the-add-on from the documentation and ...
Read more >
Heroku Logs - The Complete Guide
Here's a summary of CLI commands that are relevant for Heroku ... an app are separated from messages about the deployment of new...
Read more >
Deploying a Flask Application to Heroku
Today you are about to learn how to make an API using Flask as a case ... if user sent a name at...
Read more >
Twitch Chat Bot Tutorial - Create & Deploy with node.js, tmi.js ...
Learn how to create and deploy a Twitch chat bot using node.js and Heroku. ... Authenticating a Twitch account to send messages with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found