With
Accessibility services you can easily integrate with Whatsapp, automate most things such as reading incoming messages, replying to them, sending messages to users or groups, with or without attachments, creating a bot etc.
Wrote some automation stuff for another user here on the forum and it works fine
Just study the code and only the sky is the limit. Just be careful to use the code and your actions in a proper way or else you will likely see your phone number be banned either temporarily or definitely by Whatsapp