nikoksr / notify

A dead simple Go library for sending notifications to various messaging services.
MIT License
2.76k stars 203 forks source link

[BUG] Whatsapp service not usable anymore #274

Open matbgn opened 2 years ago

matbgn commented 2 years ago

Describe the bug

Regarding the official documentation of the Rhymen/go-whatsapp API

Warning This package is not being actively maintained currently and will soon be unusuable as WhatsApp updates to multi-device. Please look at tulir/whatsmeow for a Go WhatsApp Web API that is actively maintained and supports WhatsApp multi-device.

And the issues opened on it (https://github.com/Rhymen/go-whatsapp/issues/644 & https://github.com/Rhymen/go-whatsapp/issues/651), it seems that this API is no more usable.

Is there a plan to integrate the one proposed (whatsmeow) into Notify in the future?

nikoksr commented 2 years ago

@matbgn thank you very much for the report! And sorry for the inconvenience. I definitely want to keep the WhatsApp service alive, so I or someone else will take care of it as soon as possible.

slowmanchan commented 2 years ago

I can take a crack at it.

slowmanchan commented 2 years ago

Seems like a DB needs to be hooked up for the new package. A default sqlite implementation is provided. Do we want to go this route or keep lookin?

matbgn commented 2 years ago

This is just my personnal opinion, but IF there could be a solution (i.e. with a reasonable amount of research) to avoid an additional SQL DB (even a lite one), I will be more than glad.

nikoksr commented 1 year ago

@slowmanchan appreciate your efforts and sorry for the late response. This one just kinda got lost in the wild for me.

Just in case that you're still interested in implementing this, I'd prefer the WhatsApp service to have a "bring it yourself" solution for the storage. Meaning, the service should expose a way for the user to set and provide their own storage solution via an interface or object. An additional default and minimalistic in-memory solution would be okay with me, too!

Let me know what you think and if you need any help with this. Sorry again for letting you wait for that long.

matbgn commented 1 year ago

Hi there!

Any news @slowmanchan?

Il the mean time it seems that there is a new up-to-date library for WhatsApp written in Go:

https://github.com/tulir/whatsmeow

Any of you want to take a look?

bytesizedwizard commented 1 year ago

@nikoksr Is this being worked on at the moment? If not, I would love to give this a try!

nikoksr commented 1 year ago

@thedarthcoder appreciate your interest in helping the project! The issue is indeed still free, so if you want to tackle, we all would greatly appreciate that.

Watch out tho, the WhatsApp service is structured differently than most other services. We'll need interfaces etc to allow for user provided storages etc. Please let me know if you need any help.

nikoksr commented 1 year ago

@thedarthcoder want me to assign you to the issue?

bytesizedwizard commented 1 year ago

@nikoksr Thanks a lot. It would be great if you could assign me this issue. Would surely love to work on it.

bytesizedwizard commented 1 year ago

Thanks @nikoksr. An update on this, as @slowmanchan mentioned I think this will indeed need an additional database setup like sqlite. But I'm working to find a generic solution to expose a service where users can specify their own storage solution.

I'm also researching on ways to avoid the db integration entirely or at least make it as minimalistic as possible.

More updates will follow soon. Cheers!

nikoksr commented 1 year ago

@thedarthcoder that would be amazing. We appreciate it so much. Let me know if there's anything I can do, to help you out.

We have discussed in the past to add a in-memory store as a default solution. I don't like the idea that someone can't just play around with the WhatsApp service, but has to write a store implementation first. If that puts too much on your plate, let me also know and I'll implement it as soon as you got a draft out.

nikoksr commented 1 year ago

@thedarthcoder hope you're doing well. Anything we can do to push this forward? Any help we can offer you?

no-1ne commented 1 year ago

https://github.com/febriliankr/whatsapp-cloud-api official api has been launched, no more risky reverse engineering business

matbgn commented 6 months ago

Friendly reminder @bytesizedwizard but maybe @nikoksr you have read some stuff and maybe have another idea or perspective to address Whatsapp's API?

ppmdo commented 2 months ago

Hi @nikoksr , after looking at the wrapper for the cloud API, it seems this could be simple implement. Here's a basic example implementation I drafted: https://github.com/ppmdo/notify/blob/dev-ppm/service/whatsapp/whatsapp.go.

Is it going in the right direction?

I'm not super familiar with WhatsApp Business, but from the API Docs it seems there are two types of messages: template message and simple text messages. Shall we support both? Or what would be the idea?