nikoksr/notify

[BUG] Whatsapp service not usable anymore

matbgn opened this issue ยท 16 comments

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 (Rhymen/go-whatsapp#644 & Rhymen/go-whatsapp#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?

@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.

I can take a crack at it.

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?

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.

@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

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?

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

@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.

@thedarthcoder want me to assign you to the issue?

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

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!

@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.

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

no-1ne commented

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

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

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?