Class CardWithId

CardWithId

أداة إنشاء لعناصر CardWithId هذه الفئة هي معرّف فريد لبطاقة في رسالة عند إرسال بطاقات متعددة.

هذه الميزة متاحة فقط لتطبيقات Google Chat. غير متاحة لإضافات 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);

الطُرق

الطريقةنوع القيمة التي يتم إرجاعهاوصف قصير
setCard(card)CardWithIdلضبط بطاقة cardWithId.
setCardId(id)CardWithIdلضبط رقم تعريف بطاقة cardWithId الفريد.

الوثائق التفصيلية

setCard(card)

لضبط بطاقة 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);

المَعلمات

الاسمالنوعالوصف
cardCardCard التي سيتم استخدامها.

استرجاع الكرة

CardWithId: هذا الكائن، للتسلسل.


setCardId(id)

لضبط رقم تعريف بطاقة cardWithId الفريد.

const cardWithId = CardService.newCardWithId();

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

المَعلمات

الاسمالنوعالوصف
idStringالنص المطلوب استخدامه.

استرجاع الكرة

CardWithId: هذا الكائن، للتسلسل.