I wish it mentioned how safe this is. Some years ago I got banned for just logging in with a third-party client, without sending any messages. Given how critical WhatsApp is for some people, and how permanent the bans are, that's a big risk.
You should use a separate WhatsApp account for bot purposes.
Recently, I used a separate WhatsApp account to interact with a group chat that I have with my friends. After about a week, they disabled the account, with no way to re-enable it.
Since WhatsApp accounts are bound to phone numbers, getting a new phone number is a significant hurdle in many legislations.
An easier solution is to just not use WhatsApp at all and look for the alternatives for bot purposes. Telegram explicitly encourages bot usage with no risk of bans.
In my case I did, but it's still wasted time and money. And when breaking TOS there's always a chance of getting related accounts also banned, though I don't know if that has already happened with WhatsApp or not.
Happened to me on Telegram with their official app. Just because I opened it once when travelling. I got the account back, after 2 years. That's apparently the period to clean banned accounts. Tried to restore it by all means, just to see if that's possible. It wasn't. Though I didn't have anything important, I actually never sent a message. Now I use it for Openclaw :D