Enum ResponseType
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
响应类型
表示 Chat 应用响应类型的枚举。
仅适用于 Google Chat 应用。不适用于 Google Workspace 插件。
如需调用枚举,您可以调用其父类、名称和属性。例如
CardService.Type.DIALOG
。
属性
属性 | 类型 | 说明 |
TYPE_UNSPECIFIED | Enum | 默认类型,以 NEW_MESSAGE 进行处理。 |
NEW_MESSAGE | Enum | 在主题中发布新消息。 |
UPDATE_MESSAGE | Enum | 更新 Chat 应用的消息。只有在消息发送方类型为 BOT 的 CARD_CLICKED 事件中,才允许执行此操作。 |
UPDATE_USER_MESSAGE_CARDS | Enum | 更新用户邮件中的卡片。仅当响应包含匹配网址的 MESSAGE 事件或消息发件人类型为 HUMAN 的 CARD_CLICKED 事件时,才允许使用此属性。文本会被忽略。 |
REQUEST_CONFIG | Enum | 私下要求用户进行额外的身份验证或配置。 |
DIALOG | Enum | 显示一个对话框。 |
UPDATE_WIDGET | Enum | 微件文本自动补全选项查询。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eResponseType\u003c/code\u003e is an enum used to define the type of response a Google Chat app sends.\u003c/p\u003e\n"],["\u003cp\u003eIt is exclusively for Google Chat apps and is not applicable to Google Workspace Add-ons.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eResponseType\u003c/code\u003e properties specify actions like posting new messages, updating existing ones, requesting user configuration, and displaying dialogs.\u003c/p\u003e\n"],["\u003cp\u003eUpdating cards on user messages or the Chat app's message depends on specific event triggers and sender types.\u003c/p\u003e\n"],["\u003cp\u003eTo call an enum property, use its parent class, name, and the specific property (e.g., \u003ccode\u003eCardService.Type.DIALOG\u003c/code\u003e).\u003c/p\u003e\n"]]],["The `ResponseType` enum defines how a Google Chat app responds. Available responses include `NEW_MESSAGE` (post a new message), `UPDATE_MESSAGE` (update the app's message, only for bot-initiated events), and `UPDATE_USER_MESSAGE_CARDS` (update cards on a user's message for human or URL-matched events). Other options: `REQUEST_CONFIG` (ask for user config), `DIALOG` (present a dialog), `UPDATE_WIDGET` (widget autocomplete query), and the default `TYPE_UNSPECIFIED` which is handled as `NEW_MESSAGE`.\n"],null,["# Enum ResponseType\n\nResponseType\n\nAn enum that represents the type of Chat app response.\n\nOnly available for Google Chat apps. Not available for Google Workspace add-ons.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nCardService.Type.DIALOG`. \n\n### Properties\n\n| Property | Type | Description |\n|-----------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `TYPE_UNSPECIFIED` | `Enum` | Default type that's handled as `NEW_MESSAGE`. |\n| `NEW_MESSAGE` | `Enum` | Post as a new message in the topic. |\n| `UPDATE_MESSAGE` | `Enum` | Update the Chat app's message. This is only permitted on a `CARD_CLICKED` event where the message sender type is `BOT`. |\n| `UPDATE_USER_MESSAGE_CARDS` | `Enum` | Update the cards on a user's message. This is only permitted as a response to a `MESSAGE` event with a matched URL, or a `CARD_CLICKED` event where the message sender type is `HUMAN`. Text is ignored. |\n| `REQUEST_CONFIG` | `Enum` | Privately ask the user for additional authentication or configuration. |\n| `DIALOG` | `Enum` | Presents a dialog. |\n| `UPDATE_WIDGET` | `Enum` | Widget text autocomplete options query. |"]]