we have done similar,
we can split by 3 thing.
sync contact to distinguish number between whatsapp and non whatsapp,
sendLastSeen method to check when are last seen, if still active then send message.
everything is demoable, we will provide screenshots or demo.