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

Duplicate messages | onAnyMessage() #2748

Open
ivaancruzz opened this issue May 27, 2024 · 0 comments
Open

Duplicate messages | onAnyMessage() #2748

ivaancruzz opened this issue May 27, 2024 · 0 comments
Labels
bug Something isn't working needs triage Needs avaliation

Comments

@ivaancruzz
Copy link

Description

This behavior happened to me when I logged back into an active session.

When I receive a message, the onAnyMessage() function sends the duplicate response.

Note: I use this function to record the messages you send from your cell phone.

Environment

  • Venom version(s): 5.1.0
  • Browser: Chrome 125.0.6422.77
  • OS: Windows 11
  • Node version: 18

Steps to Reproduce

  1. Link your account once
  2. Restart the server to automatically log in with the active session
  3. Recive a message

Your Code

venom
  .create({
    session: 'session-name', //name of session
  })
  .then((client) => start(client))
  .catch((erro) => {
    console.log(erro);
  });

function start(client) {
  client.onAnyMessage((message) => {
      if (message.isGroupMsg === false ) {
      client
        .sendText(message.from, 'Welcome Venom 🕷')
        .then((result) => {
          console.log('Result: ', result); //return object success
        })
        .catch((erro) => {
          console.error('Error when sending: ', erro); //return object error
        });
    }
  });
}

Additional context / Screenshot

image

@ivaancruzz ivaancruzz added bug Something isn't working needs triage Needs avaliation labels May 27, 2024
@ivaancruzz ivaancruzz changed the title Duplicate messages used in onAnMessage() Duplicate messages | onAnMessage() May 27, 2024
@ivaancruzz ivaancruzz changed the title Duplicate messages | onAnMessage() Duplicate messages | onAnyMessage() Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Needs avaliation
Projects
None yet
Development

No branches or pull requests

1 participant