用于构建聊天 Accessory 对象的构建器。
配件 widget 是显示在消息底部的互动式 widget。
适用于扩展 Google Chat 的 Google Workspace 加载项。
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);
方法
| 方法 | 返回类型 | 简介 |
|---|---|---|
add | Accessory | 为此操作设置 widget。 |