Wiadomość w Google Chat.
Dostępne w przypadku dodatków do Google Workspace, które rozszerzają 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);
Metody
| Metoda | Zwracany typ | Krótki opis |
|---|---|---|
add | Chat | Ustawia kartę wiadomości. |
set | Chat | Ustawia tekst wiadomości. |
Szczegółowa dokumentacja
add Card With Id(cardWithId)
Ustawia kartę wiadomości.
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);
Parametry
| Nazwa | Typ | Opis |
|---|---|---|
card | Card | Karta cardWithId do ustawienia. |
Powrót
Chat – ten obiekt do łączenia.
set Text(text)
Ustawia tekst wiadomości.
const message = AddOnsResponseService.newChatMessage().setText("Example text");
Parametry
| Nazwa | Typ | Opis |
|---|---|---|
text | String | Tekstowa część wiadomości. |
Powrót
Chat – ten obiekt do łączenia.