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étodo | Tipo de datos que se muestra | Descripción breve |
|---|---|---|
add | Chat | Establece la tarjeta del mensaje. |
set | Chat | Establece el texto del mensaje. |
Documentación detallada
add Card With Id(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
| Nombre | Tipo | Descripción |
|---|---|---|
card | Card | Es el cardWithId que se establecerá. |
Volver
Chat: Este objeto, para encadenar.
set Text(text)
Establece el texto del mensaje.
const message = AddOnsResponseService.newChatMessage().setText("Example text");
Parámetros
| Nombre | Tipo | Descripción |
|---|---|---|
text | String | Es la parte de texto de un mensaje. |
Volver
Chat: Este objeto, para encadenar.