Class ChatMessage

ข้อความแชท

ข้อความ Google Chat

พร้อมให้บริการสำหรับส่วนเสริมของ Google Workspace ที่ขยาย 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);

เมธอด

วิธีการประเภทการแสดงผลรายละเอียดแบบย่อ
addCardWithId(cardWithId)ChatMessageตั้งค่าการ์ดของข้อความ
setText(text)ChatMessageตั้งค่าข้อความ

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

addCardWithId(cardWithId)

ตั้งค่าการ์ดของข้อความ

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

พารามิเตอร์

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

รีเทิร์น

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


setText(text)

ตั้งค่าข้อความ

const message = AddOnsResponseService.newChatMessage().setText("Example text");

พารามิเตอร์

ชื่อประเภทคำอธิบาย
textStringส่วนข้อความของข้อความ

รีเทิร์น

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