Class 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
 
 
 
  
  
  
    
  
 
  
    
    
      
       
    
    
  
  
  เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
  อัปเดตล่าสุด 2025-07-26 UTC
  
  
  
    
      [null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[],["The `ChatResponse` object, exclusive to Google Chat apps, facilitates the creation of card messages. It is not for Google Workspace add-ons. You can build card messages using methods like `newCardHeader()` and `newCardBuilder()`.  `newChatResponseBuilder()`  builds the ChatResponse by adding text and cards. `printJson()` outputs the JSON representation of the constructed `ChatResponse` object, for debugging purposes.\n"]]