Class ChatMessage

ChatMessage

Un mensaje de Google Chat

Disponible para los complementos de Google Workspace que extienden 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);

Métodos

MétodoTipo de datos que se muestraDescripción breve
addCardWithId(cardWithId)ChatMessageEstablece la tarjeta del mensaje.
setText(text)ChatMessageEstablece el texto del mensaje.

Documentación detallada

addCardWithId(cardWithId)

Establece la tarjeta del mensaje.

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);

Parámetros

NombreTipoDescripción
cardWithIdCardWithIdEs el cardWithId que se establecerá.

Volver

ChatMessage: Este objeto, para encadenar.


setText(text)

Establece el texto del mensaje.

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

Parámetros

NombreTipoDescripción
textStringEs la parte de texto de un mensaje.

Volver

ChatMessage: Este objeto, para encadenar.