Class CreateMessageAction

Create Message Action

A builder for Chat Create Message Action objects.

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 
 () 
  
 . 
 setCreateChatMessageAction 
 ( 
 AddOnsResponseService 
 . 
 newCreateMessageAction 
 () 
  
 . 
 setMessage 
 ( 
 message 
 )) 
  
 . 
 build 
 (); 

Methods

Method Return type Brief description
Create 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 
 () 
  
 . 
 setCreateChatMessageAction 
 ( 
 AddOnsResponseService 
 . 
 newCreateMessageAction 
 () 
  
 . 
 setMessage 
 ( 
 message 
 )) 
  
 . 
 build 
 (); 

Parameters

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

Return

Create Message Action — This object, for chaining.

Create a Mobile Website
View Site in Mobile | Classic
Share by: