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());
Methods
שיטה | סוג הערך המוחזר | תיאור קצר |
printJson() | String | הדפסת הייצוג של האובייקט הזה ב-JSON. |
מסמכים מפורטים
printJson()
הדפסת הייצוג של האובייקט הזה ב-JSON. האפשרות הזו מיועדת לניפוי באגים בלבד.
חזרה
String
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת 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"]]