回呼函式 (例如表單回覆處理常式) 可能會傳回回應物件,以便在用戶端執行一或多項動作。系統不支援某些動作組合。
// An action that opens a link const actionResponse = CardService.newActionResponseBuilder() .setOpenLink(CardService.newOpenLink().setUrl('https://www.google.com')) .build(); // An action that shows a notification. const notificationActionResponse = CardService.newActionResponseBuilder() .setNotification( CardService.newNotification().setText( 'Some info to display to user'), ) .build(); // An action that shows an additional card. It also sets a flag to indicate that // the original state data has changed. const cardBuilder = CardService.newCardBuilder(); // Build card ... const navigationActionResponse = CardService.newActionResponseBuilder() .setNavigation(CardService.newNavigation().pushCard( cardBuilder.build())) .setStateChanged(true) .build();
方法
| 方法 | 傳回類型 | 簡短說明 |
|---|---|---|
print | String | 列印這個物件的 JSON 表示法。 |
內容詳盡的說明文件
printJson()
列印這個物件的 JSON 表示法。這項設定僅適用於偵錯。
回攻員
String