Chat
Message
A Google Chat message .
Available for Google Workspace add-ons that extend 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 );
Methods
| Method | Return type | Brief description |
|---|---|---|
Chat
|
Sets the card of the message. | |
Chat
|
Sets the text of the message. |
Detailed documentation
add
Card
With
Id(cardWithId)
Sets the card of the message.
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 );
Parameters
| Name | Type | Description |
|---|---|---|
card
|
Card
|
The cardWithId to set. |
Return
Chat
— This object, for chaining.
set
Text(text)
Sets the text of the message.
const message = AddOnsResponseService . newChatMessage () . setText ( "Example text" );
Parameters
| Name | Type | Description |
|---|---|---|
text
|
String
|
The text part of a message. |
Return
Chat
— This object, for chaining.

