我能够通过应用脚本通过webhooks将消息发送到聊天室,但是我如何发送对该消息的回复。这是一种单向聊天。我如何能够通过webhooks进行对话。
您可以提供threadKey
作为查询参数。您可以自己生成此密钥。具有相同threadKey
的消息被分组在一起。
curl -H 'Content-Type: application/json' -X POST https://chat.googleapis.com/v1/spaces/<space>/messages?key=<key>\&token=<token>\&threadKey=this-thread-rocks --data '{"text": "hi there"}'
请参见https://developers.google.com/hangouts/chat/reference/rest/v1/spaces.messages/create以获取文档。