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

Split in WhatsAppUpdate and WhatsAppClient #32

Open
soerenetler opened this issue Oct 5, 2022 · 5 comments
Open

Split in WhatsAppUpdate and WhatsAppClient #32

soerenetler opened this issue Oct 5, 2022 · 5 comments

Comments

@soerenetler
Copy link
Collaborator

Hi,
i think it would make sense to split the WhatsApp class into a WhatsAppUpdate and WhatsAppClient class. Many of the functions lower in the file like get_location don't actually need the Client. This would make the library easier to handle. One could create a WhatsAppUpdate object from the data and call the get_location on that Only sending messages would need the WhatsAppClient object.
I would be happy to contribute to the project. Let me know what you think about this proposal.

@Kalebu
Copy link
Contributor

Kalebu commented Oct 6, 2022

Hi @soerenetler

I like the idea, how are we going to ensure that this update is not going to break code of people who already created it using a version with only WhatsApp class ?

@soerenetler
Copy link
Collaborator Author

@Kalebu,
I didn't think it through yet. The functions could still exist inside WhatsApp and forward with a DeprecationWarning. I think in version 0.0.6 it is still fine to introduce breaking changes.
Are there automated tests for this library?

@Kalebu
Copy link
Contributor

Kalebu commented Oct 6, 2022

We don't have automated testing yet but you're welcome to contribute and create a PR for it`

@soerenetler

@Kalebu
Copy link
Contributor

Kalebu commented Oct 9, 2022

Also regarding the breaking changes problem I think we can create a WhatsAppUpdate as a different class inherited by the WhatsApp class so that it works in both ways, making it easier to maintain without breaking any existing code base.

@soerenetler
Copy link
Collaborator Author

We don't have automated testing yet but you're welcome to contribute and create a PR for it`

@soerenetler

I just created a new PR for automated testing. #38
Looking forward to your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants