Skip to content
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

Evento "onAnyMessage" gera SELF incorreto #885

Closed
mvac1991 opened this issue Feb 15, 2022 · 1 comment
Closed

Evento "onAnyMessage" gera SELF incorreto #885

mvac1991 opened this issue Feb 15, 2022 · 1 comment
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@mvac1991
Copy link

mvac1991 commented Feb 15, 2022

Description

Ao ENVIAR mensagens do CELULAR o evento "onAnyMessage" vem com SELF = 'IN', o ID da mensagem vem correto, só o SELF que está errado, deveria ser 'OUT'.

image

Environment

  • Wppconnect version(s): [1.12.5]
  • Browser: [Google Chrome 96.0.4664.45]
  • OS: [WINDOWS 10]
  • Node version: [Node 14]
  • WhatsApp version: [2.2149.4]
  • MultiDevice (BETA): NO
  • WhatsApp APP (BETA, Business ou Comum): Comum

Steps to Reproduce

  1. "Ligue" o evento "onAnyMessage"
  2. Coloque o console.log no resultado do "onAnyMessage"
  3. Envie uma mensagem pelo CELULAR

Your Code

client.onAnyMessage(async (message) => {

            console.log('message', message);

            (...)

Solution (in my code)

ack.self = message.id.includes('true_') ? 'out' : 'in';

@mvac1991 mvac1991 added bug Something isn't working needs triage labels Feb 15, 2022
@edgardmessias edgardmessias added wontfix This will not be worked on and removed needs triage labels Feb 16, 2022
@edgardmessias
Copy link
Contributor

Isso não é um BUG, na verdade isso representa a direção da mensagem dentro do WhatsApp Web, ou seja, como você descreveu, a mensagem foi enviada pelo celular, mas no WhatsApp WEB, essa mensagem foi "recebida" na interface.

Fez correto em usar o ID da mensagem para saber quem fez o envio, existe, esse atributo representa o "fromMe" no código, ou seja, ele de fato indica quem enviou a mensagem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants