Class UpdateInlinePreviewAction

อัปเดตการแสดงตัวอย่างในบรรทัด

แอป Chat จะแสดงตัวอย่างลิงก์ในข้อความโดยการเพิ่มหรืออัปเดตการ์ดอย่างน้อย 1 ใบ ดูรายละเอียดได้ที่แสดงตัวอย่าง ลิงก์ในข้อความ Google Chat

พร้อมให้บริการสำหรับส่วนเสริมของ Google Workspace ที่ขยาย Google Chat

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Unfurl Card!"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("url"))
      .addWidget(CardService.newButtonSet()
        .addButton(CardService.newTextButton()
          .setText("Open URL!")
          .setOpenLink(CardService.newOpenLink().setUrl("https://www.google.com")))))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setUpdateInlinePreviewAction(AddOnsResponseService.newUpdateInlinePreviewAction()
    .addCardWithId(cardWithId)).build();

เมธอด

วิธีการประเภทการแสดงผลรายละเอียดแบบย่อ
addCardWithId(cardWithId)UpdateInlinePreviewActionเพิ่มการ์ดสำหรับการดำเนินการนี้
addExpiration(ttl)UpdateInlinePreviewActionเพิ่มวันหมดอายุสำหรับการดำเนินการนี้

เอกสารโดยละเอียด

addCardWithId(cardWithId)

เพิ่มการ์ดสำหรับการดำเนินการนี้

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Unfurl Card!"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("url"))
      .addWidget(CardService.newButtonSet()
        .addButton(CardService.newTextButton()
          .setText("Open URL!")
          .setOpenLink(CardService.newOpenLink().setUrl("https://www.google.com")))))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setUpdateInlinePreviewAction(AddOnsResponseService.newUpdateInlinePreviewAction()
    .addCardWithId(cardWithId)).build();

พารามิเตอร์

ชื่อประเภทคำอธิบาย
cardWithIdCardWithIdบัตรที่จะตั้งค่า

รีเทิร์น

UpdateInlinePreviewAction - ออบเจ็กต์นี้สำหรับการเชื่อมโยง


addExpiration(ttl)

เพิ่มวันหมดอายุสำหรับการดำเนินการนี้

พารามิเตอร์

ชื่อประเภทคำอธิบาย
ttlDurationระยะเวลาการหมดอายุที่จะตั้ง

รีเทิร์น

UpdateInlinePreviewAction - ออบเจ็กต์นี้สำหรับการเชื่อมโยง