Class ChatResponse
    
    
      
    
    
      
      Zadbaj o dobrą organizację dzięki kolekcji
    
    
      
      Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
Czat – odpowiedź
Obiekt odpowiedzi na wiadomość z kartą w Google Chat.
Dostępne tylko w przypadku aplikacji Google Chat. Niedostępne w przypadku dodatków 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());
 
Metody
| Metoda | Zwracany typ | Krótki opis | 
| printJson() | String | Wypisuje reprezentację obiektu w formacie JSON. | 
 
Szczegółowa dokumentacja
printJson()
Wypisuje reprezentację obiektu w formacie JSON. Jest to tylko funkcja debugowania.
Powrót
String
 
 
 
  
  
  
    
  
 
  
    
    
      
       
    
    
  
  
  O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
  Ostatnia aktualizacja: 2025-07-26 UTC.
  
  
  
    
      [null,null,["Ostatnia aktualizacja: 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"]]