Kreator obiektów CardWithId. Ta klasa jest unikalnym identyfikatorem karty w wiadomości podczas wysyłania wielu kart.
Dostępne tylko w przypadku aplikacji Google Chat. Niedostępne w przypadku dodatków do Google Workspace.
const cardSection = CardService.newCardSection(); cardSection.addWidget( CardService.newTextParagraph().setText('This is a text paragraph widget.'), ); const card = CardService.newCardBuilder() .setHeader(CardService.newCardHeader().setTitle('Card title')) .addSection(cardSection) .build(); const cardWithId = CardService.newCardWithId().setCardId('card_id').setCard(card);
Metody
| Metoda | Zwracany typ | Krótki opis |
|---|---|---|
set | Card | Ustawia kartę card. |
set | Card | Ustawia unikalny identyfikator karty card. |
Szczegółowa dokumentacja
setCard(card)
Ustawia kartę cardWithId.
const cardHeader = CardService.newCardHeader() .setTitle('Card Header Title') .setSubtitle('Card Header Subtitle'); const card = CardService.newCardBuilder().setHeader(cardHeader).build(); const cardWithId = CardService.newCardWithId().setCard(card);
Parametry
| Nazwa | Typ | Opis |
|---|---|---|
card | Card | Card, z którego chcesz korzystać. |
Powrót
CardWithId – ten obiekt do łączenia.
setCardId(id)
Ustawia unikalny identyfikator karty cardWithId.
const cardWithId = CardService.newCardWithId(); // Sets the card ID of the cardWithId. cardWithId.setCardId('card_id');
Parametry
| Nazwa | Typ | Opis |
|---|---|---|
id | String | Tekst, którego chcesz użyć. |
Powrót
CardWithId – ten obiekt do łączenia.