Một tin nhắn trong Google Chat.
Dành cho các tiện ích bổ sung của Google Workspace mở rộng Google Chat.
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);
Phương thức
| Phương thức | Kiểu dữ liệu trả về | Mô tả ngắn |
|---|---|---|
add | Chat | Đặt thẻ của thông báo. |
set | Chat | Đặt văn bản của thông báo. |
Tài liệu chi tiết
add Card With Id(cardWithId)
Đặt thẻ của thông báo.
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);
Thông số
| Tên | Loại | Mô tả |
|---|---|---|
card | Card | cardWithId cần đặt. |
Cầu thủ trả bóng
Chat – Đối tượng này, để liên kết.
set Text(text)
Đặt văn bản của thông báo.
const message = AddOnsResponseService.newChatMessage().setText("Example text");
Thông số
| Tên | Loại | Mô tả |
|---|---|---|
text | String | Phần văn bản của một tin nhắn. |
Cầu thủ trả bóng
Chat – Đối tượng này, để liên kết.