Class UpdateMessageAction

Update Message Action

The Chat app updates text or cards in a message. For details, see Send Google Chat messages .

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 
 ); 
 const 
  
 chatDataAction 
  
 = 
  
 AddOnsResponseService 
 . 
 newChatDataActionBuilder 
 () 
  
 . 
 setUpdateChatMessageAction 
 ( 
 AddOnsResponseService 
 . 
 newUpdateMessageAction 
 () 
  
 . 
 setMessage 
 ( 
 message 
 )) 
  
 . 
 build 
 (); 

Methods

Method Return type Brief description
Update Message Action Sets the message for this action.

Detailed documentation

set Message(message)

Sets the message for this action.

 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 
 ); 
 const 
  
 chatDataAction 
  
 = 
  
 AddOnsResponseService 
 . 
 newChatDataActionBuilder 
 () 
  
 . 
 setUpdateChatMessageAction 
 ( 
 AddOnsResponseService 
 . 
 newUpdateMessageAction 
 () 
  
 . 
 setMessage 
 ( 
 message 
 )) 
  
 . 
 build 
 (); 

Parameters

Name Type Description
message
Chat Message The chat message to update.

Return

Update Message Action — This object, for chaining.

Design a Mobile Site
View Site in Mobile | Classic
Share by: