Using Google+ Hangouts API

2020-07-01 02:21发布

问题:

If someone adds bot@mydomain.com to his Google Hangout contacts and sends it a Google+ Hangout Chat message, I want to set up an automatic reply to his chat from my server. Is there a way to do that??

I think Its possible using the Google+ Hangouts API but I cannot figure out how.

(mydomain.com uses Google Apps for Business)

回答1:

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