我已按照谷歌提供的文档https://developers.google.com/chat/how-tos/bot-dialogs但无法弄清楚如何正确响应“REQUEST_DIALOG”事件。这是我到目前为止所做的:
这会按预期产生一个请求对话事件:
"type": "MESSAGE",
"eventTime": "2021-07-27T11:34:55.036447Z",
"message": {
"name": "***",
"sender": {
"name": "***",
"displayName": "***",
"avatarUrl": "***",
"email": "***",
"type": "HUMAN",
"domainId": "***"
},
..."slashCommand": {
"commandId": "17"
},
"lastUpdateTime": "2021-07-27T11:34:55.036447Z"
},
.."configCompleteRedirectUrl": "https://chat.google.com/api/bot_config_complete?token\u003dAAJCfVWmnk9F9-p3tLQJcUN0lhskjka74V3SMYvZ5dQ_l4Ft1VkCG7JDybLxvLEc7WRwK05c768H6UO3d_EPzehsb2hnt1faOJsgSI6xUIZshjA2PNj1iWCyzp5JmtJtfDOzbmPjlUR7lW2bcOT5",
"isDialogEvent": true,
"dialogEventType": "REQUEST_DIALOG"
}
但我不知道如何正确回应。卡片、ok 响应或后续对话框(如示例中所示)似乎不起作用。
有人可以提供一个应该有效的简单示例吗?