Using Google+ Hangouts API
Here's what you're looking:https://developers.google.com/+/hangouts/api/gapi.hangout.data
Here's the event for message recieved: (callback) https://developers.google.com/+/hangouts/api/gapi.hangout.data#gapi.hangout.data.onMessageReceived
And here's the event for sending the message:https://developers.google.com/+/hangouts/api/gapi.hangout.data#gapi.hangout.data.sendMessage