Class CardWithId

CardWithId

CardWithId nesne için oluşturucu. Bu sınıf, birden fazla kart gönderirken kullanılan, mesajdaki bir kartın benzersiz tanımlayıcısıdır.

Yalnızca Google Chat uygulamalarında kullanılabilir. Google Workspace Eklentileri için kullanılamaz.

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);

Yöntemler

YöntemDönüş türüKısa açıklama
setCard(card)CardWithIdcardWithId kartını ayarlar.
setCardId(id)CardWithIdcardWithId öğesinin benzersiz kart kimliğini ayarlar.

Ayrıntılı belgeler

setCard(card)

cardWithId kartını ayarlar.

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);

Parametreler

AdTürAçıklama
cardCardKullanılacak Card.

Return

CardWithId: Zincirleme için kullanılan bu nesne.


setCardId(id)

cardWithId öğesinin benzersiz kart kimliğini ayarlar.

const cardWithId = CardService.newCardWithId();

// Sets the card ID of the cardWithId.
cardWithId.setCardId('card_id');

Parametreler

AdTürAçıklama
idStringKullanılacak metin.

Return

CardWithId: Zincirleme için kullanılan bu nesne.