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.

New and reply messages not call .onMessage

See original GitHub issue

Description

I develop a large automation bot and after a few versions I notice that new messages do not call the .onMessage method.

Run a test with the code from README.md and I confirmed that it is something related to venom.

I started to investigate, but I’ve been reading the source code for 4 hours and I haven’t found where the possible error could be.

Environment

  • Venom version(s): 4.3.5
  • Browser: Firefox 107, Chrome 107
  • OS: OSX 12.14, Ubuntu 20
  • Node version: Node 16, Node 18

Your Code

As the README.MD

const venom = require("venom-bot");

venom
  .create({
    session: "dev", //name of session
    multidevice: true, // for version not multidevice use false.(default: true)
  })
  .then((client) => start(client))
  .catch((erro) => {
    console.log(erro);
  });

function start(client) {
  client.onMessage((message) => {
    console.log({ message });
  });
}

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:4
  • Comments:30 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
guh0rzdcommented, Nov 30, 2022

Same onMessage method not working on message reply

try this file… replace wapi.js e run again new wapi.txt

How to use that?

(version 4.3.6), replace the content in wapi.js file. The txt file is a wapi.js with the changes wich work fine for me… just CTRL+A then CTRL+C in txt file and CTRL+A then CTRL+V in wapi.js file. try and run again.

Where´s “wapi.js”?

in your project, go to: node_modules/venom-bot/dist/lib/wapi/wapi.js

worked!! thanks

de nada man

kkkkkkkkkkk é brasileiro tbm e eu escrevendo em ingles kkkkk

Read more comments on GitHub >

github_iconTop Results From Across the Web

onMessage of MessageListener class is not called in groovy
I got this fixed, i was importing the wrong library. I had to use JMS Listerner library import javax.jms.MessageListener instead of Groovy Message...
Read more >
OnMessage() - Syntax & Usage - AutoHotkey
The OnMessage function specifies a function or function object to call automatically when the script receives the specified message.
Read more >
runtime.onMessage - Mozilla - MDN Web Docs
A function to call, at most once, to send a response to the message . The function takes a single argument, which may...
Read more >
If you have an issue with Messages or FaceTime after setting ...
After setting up your iPhone, you might experience one or more of the following issues: You can't receive iMessages or FaceTime calls.
Read more >
What does "Call- No answer" on message history mean?
This message means that the account owner made an outbound call but the receiver did not respond or get the call.
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