Class ChatResponse

ChatResponse

Obiekt odpowiedzi na wiadomość karty w Google Chat.

Dostępne tylko w aplikacjach Google Chat. Opcja niedostępna w przypadku dodatków do 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

MetodaTyp zwracanej wartościKrótki opis
printJson()StringDrukuje reprezentację tego obiektu w formacie JSON.

Szczegółowa dokumentacja

printJson()

Drukuje reprezentację tego obiektu w formacie JSON. Służy tylko do debugowania.

Powroty

String