Class AccessoryWidget

Accessory Widget

A builder for Chat Accessory Widget objects. Accessory widgets are interactive widgets that appear at the bottom of a message.

Available for Google Workspace add-ons that extend Google Chat.

 const 
  
 widget 
  
 = 
  
 CardService 
 . 
 newButtonSet 
 () 
  
 . 
 addButton 
 ( 
 CardService 
 . 
 newImageButton 
 () 
  
 . 
 setIcon 
 ( 
 CardService 
 . 
 Icon 
 . 
 PHONE 
 ) 
  
 . 
 setOnClickAction 
 ( 
 CardService 
 . 
 newAction 
 () 
  
 . 
 setFunctionName 
 ( 
 "phone" 
 ))) 
  
 . 
 addButton 
 ( 
 CardService 
 . 
 newTextButton 
 () 
  
 . 
 setText 
 ( 
 "Robot" 
 ) 
  
 . 
 setIconUrl 
 ( 
 "https://developers.google.com/chat/images/quickstart-app-avatar.png" 
 ) 
  
 . 
 setOnClickAction 
 ( 
 CardService 
 . 
 newAction 
 () 
  
 . 
 setFunctionName 
 ( 
 "robot" 
 ))); 
 const 
  
 accessoryWidget 
  
 = 
  
 AddOnsResponseService 
 . 
 newAccessoryWidget 
 () 
  
 . 
 addWidget 
 ( 
 widget 
 ); 

Methods

Method Return type Brief description
Accessory Widget Sets the widget for this action.

Detailed documentation

add Widget(widget)

Sets the widget for this action.

Parameters

Name Type Description
widget
Widget The widget to set.

Return

Accessory Widget — This object, for chaining.

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