Class ChatResponse
Chat응답
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()
이 객체의 JSON 표현을 출력합니다. 디버깅 전용입니다.
리턴
String
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-01-30(UTC)
[null,null,["최종 업데이트: 2025-01-30(UTC)"],[[["`ChatResponse` is an object used for card messages specifically within Google Chat apps, not add-ons."],["It facilitates building responses containing text and cards with customizable headers and content using methods like `addCardsV2()`."],["Developers can utilize the `printJson()` method to debug and view the JSON structure of the constructed response for verification."]]],["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"]]