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

Venom Connected, but not receiving messages #2733

Open
matheusbsant opened this issue May 3, 2024 · 6 comments
Open

Venom Connected, but not receiving messages #2733

matheusbsant opened this issue May 3, 2024 · 6 comments
Labels
bug Something isn't working needs triage Needs avaliation

Comments

@matheusbsant
Copy link

matheusbsant commented May 3, 2024

I'm having a problem where I can connect to Venom. But when it's time to read the messages it doesn't do it, anyone with the same problem? Would someone have any idea how to solve it?

Version: 5.1.0

Even with this basic code, it does not recognize messages:

`import { Message, Whatsapp, create } from "venom-bot"

create({
session: "venom-bot",
disableWelcome: true,
})
.then(async (client: Whatsapp) => await start(client))
.catch((err) => {
console.log(err)
})

async function start(client: Whatsapp) {
client.onMessage(async (message: Message) => {
if (!message.body || message.isGroupMsg) return

    const response = `Hello!`

    await client.sendText(message.from, response)
})

}`

@matheusbsant matheusbsant added bug Something isn't working needs triage Needs avaliation labels May 3, 2024
@ghayman
Copy link
Contributor

ghayman commented May 3, 2024

Have you tried onAnyMessage() ?

Are you sure your if clause is matching? (sorry, have to ask)

@argordmel
Copy link

argordmel commented May 4, 2024

i've the same problem

Node: 18
Venom: 5.1.0

wapi

@matheusbsant
Copy link
Author

Are you sure your if clause is matching? (sorry, have to ask)

Even with onAnyMessage, it connects but does not recognize the message. Yes, with the "if" everything is fine.

@ghayman
Copy link
Contributor

ghayman commented May 6, 2024

There have been a number of updates committed to the repo that have not been officially released yet.

You could try installing directly from the repo
...
"venom-bot: "github:orkestral/venoml#master"
...

@carnei-ro
Copy link

same here

@carnei-ro
Copy link

carnei-ro commented May 20, 2024

@matheusbsant, maybe it is just on my machine, but it has been working since I added this line:

  venom
    .create({
      session: 'carneiro-wpp-bot1',
+     defaultOptions: { ...defaultOptions },
    })
    .then((client) => start(client))
    .catch((erro) => {
      console.log(erro);
    });

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

4 participants