Class AccessoryWidget

Tiện íchPhụ kiện

Trình tạo cho các đối tượng Chat AccessoryWidget. Tiện ích phụ kiện là những tiện ích có thể tương tác và xuất hiện ở cuối thư.

Dành cho các tiện ích bổ sung của Google Workspace mở rộng 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);

Phương thức

Phương thứcKiểu dữ liệu trả vềMô tả ngắn
addWidget(widget)AccessoryWidgetĐặt tiện ích cho thao tác này.

Tài liệu chi tiết

addWidget(widget)

Đặt tiện ích cho thao tác này.

Thông số

TênLoạiMô tả
widgetWidgetTiện ích cần đặt.

Cầu thủ trả bóng

AccessoryWidget – Đối tượng này, để liên kết.