pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.05k stars 3.58k forks source link

Clicking the replied message will send the user to dm yourself channel #2797

Closed joaosilva1987 closed 6 months ago

joaosilva1987 commented 6 months ago

Is there an existing issue for this?

Describe the bug

The bug happens when the recipient clicks on the replied message, he is redirected to a conversation with himself. The detail is that when I click on the answer from my connected number the functionality works normally. In short, the problem is only with the Recipient's WhatsApp.

Expected behavior

As a recipient, when I click on a replied message, I am directed to the message correctly.

Steps to Reproduce the Bug or Issue

1 - Get the message from a event or from a chat 2 - Reply the message

Relevant Code

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

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS: Windows or Linux Phone: Samsung Galaxy s10 plus whatsapp-web.js version: v1.23.0 (But tried on all alphas too) WhatsApp Web version: 2.2409.2 Node.js Version: v16.13.0

Additional context

No response

alechkos commented 6 months ago

@joaosilva1987 Show the code you are using

joaosilva1987 commented 6 months ago

@joaosilva1987 Show the code you are using

Hello, The code I used was exactly what is in the documentation example

let wppClient;

wppClient = new Client({
    authStrategy: localAuth,
    takeoverOnConflict: false,
    qrMaxRetries: 5,
    authTimeoutMs: 30000,
    timeout: 30000,
    takeoverTimeoutMs: 10,
    puppeteer: {
        headless: true,
        args: [
            '--no-sandbox',
            '--disable-setuid-sandbox',
            '--disable-dev-shm-usage',
            '--disable-accelerated-2d-canvas',
            '--no-first-run',
            '--no-zygote',
            '--single-process',
            '--disable-gpu'],
    }
});

wppClient.on(Events.MESSAGE_CREATE, async (message) => { if (message.body === '!ping') { await message.reply('pong'); } }

When I click on the "pong" reply, instead of going to the message, an empty conversation with myself opens.

alechkos commented 6 months ago

use client.on('message', ...)

wppClient.on(Events.MESSAGE, async (message) => {
  if (message.body === '!ping') {
    await message.reply('pong');
  }
}
joaosilva1987 commented 6 months ago

use client.on('message', ...)

wppClient.on(Events.MESSAGE, async (message) => {
  if (message.body === '!ping') {
    await message.reply('pong');
  }
}

I've used too, same problem. In WhatsAppWeb, he opens an empty message with myself. On the phone, clicking on the replied message simply does nothing... instead of moving the cursor to the message. Remembering that this is on the number of the person who receives the message and not on the person who has the number connected. For the person who is connected, the functionality works normally.

Andre-Luiz-Braatz commented 3 months ago

Any solution ?