我想通过python中的实现通过JSON响应向用户发送三个基本卡作为响应。那么有什么办法可以做到吗?
附言
基本上,我想向用户显示三个按钮call
,mail
和call on office
,但是由于基本卡只显示一个链接,我认为是否可以显示多个包含按钮的卡!
这是我发送的回复。
{
"payload": {
"google": {
"expectUserResponse": "true",
"richResponse": {
"items": [{
"simpleResponse": {
"textToSpeech": "Here is the information of " + user_name
}
},
{
"basicCard": {
"title": name,
"subtitle": subtitle,
"image": {
"url": picture_url,
"accessibilityText": "Picture of " + name
},
"formattedText": msg,
"buttons": [{
"title": "Call " + user_name,
"openUrlAction": {
"url": "tel:+" + contact
if contact is not None
else "",
"androidApp": {
"packageName": "com.android.phone"
},
"versions": []
}
}
if contact is not None
else {
"title": "Send Mail to " + user_name,
"openUrlAction": {
"url": "mailto:" + email,
"androidApp": {
"packageName": "android.intent.extra.EMAIL"
},
"versions": []
}
},
{
"title": "Call on extention",
"openUrlAction": {
"url": "tel:+" + extension
if extension is not None
else "",
"androidApp": {
"packageName": "com.android.phone"
},
"versions": []
}
}
],
"imageDisplayOptions": "WHITE"
}
}
],
"suggestions": [{
"title": "Info of " + manager
if manager is not None
else ""
},
{
"title": "Info of " + hr_manager
if hr_manager is not None
else ""
}
]
}
}
}
}