Class ChatMessage

Tin nhắnChat

Một tin nhắn trong Google Chat.

Dành cho các tiện ích bổ sung của Google Workspace mở rộng Google Chat.

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);

Phương thức

Phương thứcKiểu dữ liệu trả vềMô tả ngắn
addCardWithId(cardWithId)ChatMessageĐặt thẻ của thông báo.
setText(text)ChatMessageĐặt văn bản của thông báo.

Tài liệu chi tiết

addCardWithId(cardWithId)

Đặt thẻ của thông báo.

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);

Thông số

TênLoạiMô tả
cardWithIdCardWithIdcardWithId cần đặt.

Cầu thủ trả bóng

ChatMessage – Đối tượng này, để liên kết.


setText(text)

Đặt văn bản của thông báo.

const message = AddOnsResponseService.newChatMessage().setText("Example text");

Thông số

TênLoạiMô tả
textStringPhần văn bản của một tin nhắn.

Cầu thủ trả bóng

ChatMessage – Đối tượng này, để liên kết.