Class ChatResponse

ChatResponse

Đối tượng phản hồi cho tin nhắn dạng thẻ trong Google Chat.

Chỉ dành cho các ứng dụng Google Chat. Không dành cho các tiện ích bổ sung của 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());

Phương thức

Phương thứcKiểu dữ liệu trả vềMô tả ngắn
printJson()StringIn bản trình bày JSON của đối tượng này.

Tài liệu chi tiết

printJson()

In bản trình bày JSON của đối tượng này. Chỉ dùng cho mục đích gỡ lỗi.

Trả về

String