Asking for help with copy imessage message

I’ve never done any automation in OSX before, but i do a lot of automation at work. But that’s mostly python and Go.
What i want to do is to have a job triggering on incoming iMessage from specific number. and then copy an 6 digit integer in the incoming message.

reason, i got shitty internet at home that breaks my Company VPN several times per day. And with FortiClient i need my username/password plus SMS token. So instead of opening the iMessage to copy the token. i’d like to try to make the process automatic.

I know there’s libs for both Go and Python for this. But i think it’s a bit ugly to have a cron job scheduler instead of maybe a trigger. also, i want to do more things with automator / apple script in the future.

tl;dr, want help to automate trigger for incoming iMessage from one contact, regex filter the content and copy to clipboard.