Class ChatResponse

ChatResponse

ออบเจ็กต์การตอบกลับสำหรับข้อความในการ์ดใน Google Chat

ใช้ได้กับแอป Google Chat เท่านั้น ใช้กับส่วนเสริมของ Google Workspace ไม่ได้

// Creates a card message in Chat.
const cardHeader = CardService.newCardHeader()
    .setTitle('Card Header Title')
    .setSubtitle('Card Header Subtitle');

const card = CardService.newCardBuilder()
    .setHeader(cardHeader)
    .build();

const chatResponse = CardService.newChatResponseBuilder()
    .setText('Example text')
    .addCardsV2(CardService.newCardWithId()
       .setCardId('card_id')
       .setCard(card))
    .build();

console.log(chatResponse.printJson());

วิธีการ

วิธีการประเภทการแสดงผลรายละเอียดแบบย่อ
printJson()Stringพิมพ์การแสดงแทน JSON ของออบเจ็กต์นี้

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

printJson()

พิมพ์การแสดงแทน JSON ของออบเจ็กต์นี้ มีไว้สำหรับการแก้ไขข้อบกพร่องเท่านั้น

รีเทิร์น

String