Google Chat 訊息。
適用於擴充 Google Chat 的 Google Workspace 外掛程式。
const card = CardService.newCardBuilder() .setHeader(CardService.newCardHeader().setTitle("Card Title")) .addSection(CardService.newCardSection() .addWidget(CardService.newTextParagraph().setText("Text paragraph"))) .build(); const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card); const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);
方法
| 方法 | 傳回類型 | 簡短說明 |
|---|---|---|
add | Chat | 設定訊息的卡片。 |
set | Chat | 設定訊息文字。 |
內容詳盡的說明文件
add Card With Id(cardWithId)
設定訊息的資訊卡。
const card = CardService.newCardBuilder() .setHeader(CardService.newCardHeader().setTitle("Card Title")) .addSection(CardService.newCardSection() .addWidget(CardService.newTextParagraph().setText("Text paragraph"))) .build(); const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card); const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
card | Card | 要設定的 cardWithId。 |
回攻員
Chat - 這個物件,用於鏈結。
set Text(text)
設定訊息文字。
const message = AddOnsResponseService.newChatMessage().setText("Example text");
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
text | String | 訊息的文字部分。 |
回攻員
Chat - 這個物件,用於鏈結。