使用 Google Chat API 操作聊天室、成员、消息、附件和线程对话,适用于列出聊天室等需求。
Google Chat : 通过 OAuth 认证的 Google Chat API 访问 Google 聊天是一项面向实际任务的技能,主要用于管理空间、 成员、 信件、 附件和线性对话;此技能使用 ClawLink 进行主机运行。
从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;
若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
通过 Google Chat API(使用 OAuth 认证)访问 Google Chat。可管理空间、成员、消息、附件及线程化对话。
本技能使用 ClawLink 提供托管连接流程与凭据,因此您无需自行配置 Google Chat API 访问权限。
| 步骤 1:安装 | 步骤 2:配对账户 | 步骤 3:连接 Google Chat |
|---|---|---|
| 应用专属连接动图即将上线 | ||
| 在 OpenClaw 中运行安装命令 | 登录并批准设备 | 打开控制台并连接 Google Chat |
┌─────────────────┐ ┌──────────────┐ ┌──────────────────┐
│ OpenClaw │────▶│ ClawLink │────▶│ Google Chat API │
│ (用户聊天) │ │ (OAuth) │ │ (REST) │
└─────────────────┘ └──────────────┘ └──────────────────┘
│ │ │
│ 1. 安装插件 │ │
│ 2. 配对设备 │ │
│ 3. 连接 Google Chat │
│ │ 4. 获取安全令牌 │
│ │ 5. 代理请求 │
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ SKILL │ │ 控制台 │ │ Google │
│ 文件 │ │ 认证 │ │ Chat │
└──────────┘ └──────────┘ └──────────┘
从 ClawHub 安装已验证的 ClawLink 插件。用户确认后,请完成全部设置流程,使 ClawLink 工具在下一次 OpenClaw 聊天中可见。
openclaw plugins install clawhub:clawlink-plugin
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart
随后告知用户:“OpenClaw 已重启。请单独发送 /new 消息以开启全新会话,然后再次请求 Google Chat。”
# 列出用户所属的所有空间
clawlink_call_tool --tool "google_chat_list_spaces" --params '{}'
# 列出某空间中的所有成员
clawlink_call_tool --tool "google_chat_list_members" --params '{"parent": "spaces/space-id"}'
# 向某空间发送消息
clawlink_call_tool --tool "google_chat_create_message" --params '{"parent": "spaces/space-id", "text": "Hello from OpenClaw!"}'
所有 Google Chat 工具调用均由 ClawLink 自动完成认证,使用的是用户已连接的 Google 账户。
聊天中无需提供 API 密钥。 ClawLink 安全地存储 OAuth 令牌,并代表用户将该令牌注入每一次 Google Chat API 请求中。
clawlink_begin_pairing 命令完成插件配对。clawlink_list_integrations 验证连接是否已生效。clawlink_list_integrations
响应:返回当前所有已连接的集成项。请在列表中查找 google-chat。
clawlink_list_tools --integration google-chat
响应:返回 Google Chat 的实时工具目录。
若 Google Chat 工具缺失或连接显示错误,请执行以下操作:
clawlink_list_integrations 验证连接状态clawlink_list_tools --integration google-chat| 工具 | 描述 | 模式 |
|---|---|---|
google_chat_list_spaces |
列出已认证用户所加入的所有空间 | 读取 |
google_chat_get_space |
获取指定空间的详细信息 | 读取 |
google_chat_create_space |
创建新空间 | 写入 |
google_chat_update_space |
更新空间名称、描述或设置 | 写入 |
google_chat_delete_space |
删除空间 | 写入 |
| 工具 | 描述 | 模式 |
|---|---|---|
google_chat_list_members |
列出某空间中的所有成员 | 读取 |
google_chat_get_member |
获取指定成员的详细信息 | 读取 |
google_chat_create_membership |
将用户或群组添加至某空间 | 写入 |
google_chat_delete_membership |
将成员从某空间中移除 | 写入 |
| 工具 | 描述 | 模式 |
|---|---|---|
google_chat_list_messages |
列出某空间中的所有消息 | 读取 |
google_chat_get_message |
获取指定消息 | 读取 |
google_chat_create_message |
向某空间发送消息(支持线程回复) | 写入 |
google_chat_update_message |
更新消息文本或内容 | 写入 |
google_chat_delete_message |
删除消息 | 写入 |
| 工具 | 描述 | 模式 |
|---|---|---|
google_chat_list_reactions |
列出某消息下的所有反应 | 读取 |
google_chat_create_reaction |
为某消息添加表情符号反应 | 写入 |
google_chat_delete_reaction |
移除某消息的表情符号反应 | 写入 |
| 工具 | 描述 | 模式 |
|---|---|---|
google_chat_list_attachments |
列出某空间中的所有附件 | 读取 |
google_chat_create_custom_emoji |
为组织创建自定义表情符号 | 写入 |
| 工具 | 描述 | 模式 |
|---|---|---|
google_chat_create_section |
在某空间中创建自定义分区 | 写入 |
clawlink_call_tool --tool "google_chat_list_spaces"
--params '{}'
clawlink_call_tool --tool "google_chat_create_message"
--params '{
"parent": "spaces/space-id",
"text": "Hello team! Just wanted to share an update on the project status."
}'
clawlink_call_tool --tool "google_chat_create_message"
--params '{
"parent": "spaces/space-id",
"text": "Thanks for the update!",
"thread": {
"thread_key": "original-message-id"
}
}'
clawlink_call_tool --tool "google_chat_create_reaction"
--params '{
"parent": "spaces/space-id/messages/message-id",
"emoji_unicode": "👍"
}'
clawlink_list_integrations 确认 Google Chat 是否已连接。clawlink_list_tools --integration google-chat 查看实时工具目录。google-chat 调用 clawlink_search_tools。┌─────────────────────────────────────────────────────────────┐
│ 读取操作(安全) │
│ list → get → search → describe → call │
│ │
│ 示例:列出空间 → 获取空间 → 展示成员 │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 写入操作(需用户确认) │
│ list → get → describe → preview → confirm → call │
│ │
│ 示例:预览消息 → 用户确认 → 执行发送 │
└─────────────────────────────────────────────────────────────┘
clawlink_describe_tool。whenToUse、askBefore、safeDefaults、examples 和 followups 构建调用请求。clawlink_preview_tool。clawlink_call_tool 执行操作,并传入确认标识。spaces/space-id。thread_key 实现对已有线程的回复。| 状态 / 错误 | 含义 |
|---|---|
| 工具未找到 | 该工具名在当前工具目录中不存在。请使用 clawlink_list_tools --integration google-chat 进行验证。 |
| 缺少连接 | Google Chat 尚未连接。请引导用户访问 https://claw-link.dev/dashboard?add=google-chat。 |
404 Not Found |
空间、消息或成员不存在。请核实 ID 是否正确。 |
403 Forbidden |
权限不足,或该空间需要 Bot 认证。 |
| 写入被拒绝 | 用户未确认写入操作。所有写入操作执行前必须获得用户确认。 |
openclaw plugins list
/new 消息以重新加载工具目录。openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart
/new 并重试。google-chat。clawlink_describe_tool 核实参数名称与类型。clawlink_preview_tool。由 ClawLink 提供支持 — OpenClaw 的集成中心
