PageSourceSearch

https://openclawgithub.cc/assets/index.html-hjLnbjBm.js

js openclawgithub.cc collected 2026-10-08 05:00:29 UTC 12,711 bytes, 1 lines download raw bytes

1import{_ as r,c as t,d as h,a,b as i,w as s,r as p,o,e as l}from"./app-rplj-UlT.js";const d={};function c(g,e){const n=p("VPLink");return o(),t("div",null,[e[4]||(e[4]=h('<h2 id="概述" tabindex="-1"><a class="header-anchor" href="#概述"><span>概述</span></a></h2><p>企业微信(Wecom)是 OpenClaw 支持的重要 IM 渠道之一。通过企业微信智能机器人关联 OpenClaw,可以直接在企业微信中通过对话指挥它,提升工作效率。</p><p>企业微信接入特点:</p><ul><li>操作简单、部署快捷</li><li>不依赖本地设备,服务 7x24 小时运行</li><li>支持主动向用户发送消息</li></ul><h2 id="前置准备" tabindex="-1"><a class="header-anchor" href="#前置准备"><span>前置准备</span></a></h2><h3 id="部署-openclaw" tabindex="-1"><a class="header-anchor" href="#部署-openclaw"><span>部署 OpenClaw</span></a></h3><p>有两种部署方式可选:</p><h4 id="方式一-云厂商部署-推荐" tabindex="-1"><a class="header-anchor" href="#方式一-云厂商部署-推荐"><span>方式一:云厂商部署(推荐)</span></a></h4><p>基于腾讯云轻量应用服务器一键部署 OpenClaw。</p><p><strong>特点</strong>:操作简单、部署快捷,不依赖本地设备,服务 7x24 小时运行。</p><p><strong>适用</strong>:无技术背景的个人,或需要不间断服务的团队。</p><h4 id="方式二-本地设备部署" tabindex="-1"><a class="header-anchor" href="#方式二-本地设备部署"><span>方式二:本地设备部署</span></a></h4><p>访问 <a href="https://openclaw.ai/" target="_blank" rel="noopener noreferrer">OpenClaw 官网</a>,在命令行中输入下载代码并完成部署。</p><p><strong>特点</strong>:可访问本地数据,但部署安装门槛高,且依赖于设备性能和网络。</p><p><strong>适用</strong>:个人开发者,或对数据敏感的团队。</p><h2 id="配置步骤" tabindex="-1"><a class="header-anchor" href="#配置步骤"><span>配置步骤</span></a></h2><h3 id="方式一-接入云厂商的-openclaw-以腾讯云为例" tabindex="-1"><a class="header-anchor" href="#方式一-接入云厂商的-openclaw-以腾讯云为例"><span>方式一:接入云厂商的 OpenClaw(以腾讯云为例)</span></a></h3><h4 id="_1-创建长连接模式机器人" tabindex="-1"><a class="header-anchor" href="#_1-创建长连接模式机器人"><span>1. 创建长连接模式机器人</span></a></h4><p>通过长连接方式创建的智能机器人,支持主动向用户发送消息。</p><ol><li>在企业微信客户端 → 工作台,点击「智能机器人」→「创建机器人」</li><li>选择「API 模式」创建</li><li>选择以「长连接」方式创建</li><li>获取 <strong>Bot ID</strong> 和 <strong>Secret</strong></li></ol><h4 id="_2-配置腾讯云-openclaw" tabindex="-1"><a class="header-anchor" href="#_2-配置腾讯云-openclaw"><span>2. 配置腾讯云 OpenClaw</span></a></h4><ol><li>进入 <a href="https://console.cloud.tencent.com/lighthouse" target="_blank" rel="noopener noreferrer">腾讯云轻量应用服务器</a>,选中已部署 OpenClaw 的轻量应用服务器</li><li>进入「管理实例」→「应用管理」</li><li>在「通道」中选择「企业微信」</li><li>依次输入企业微信机器人的 <strong>Bot ID</strong> 和 <strong>Secret</strong></li><li>点击「添加并应用」按钮,保存并等待服务器重启</li></ol><h4 id="_3-验证配置" tabindex="-1"><a class="header-anchor" href="#_3-验证配置"><span>3. 验证配置</span></a></h4><p>回到企业微信机器人创建页面,保存并创建,随后即可在企业微信中与智能机器人正常对话。</p><hr><h3 id="方式二-接入本地终端的-openclaw" tabindex="-1"><a class="header-anchor" href="#方式二-接入本地终端的-openclaw"><span>方式二:接入本地终端的 OpenClaw</span></a></h3><h4 id="_1-安装企微插件" tabindex="-1"><a class="header-anchor" href="#_1-安装企微插件"><span>1. 安装企微插件</span></a></h4><p>在终端输入以下命令,安装企微插件:</p><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665;">openclaw</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;"> plugins</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;"> install</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;"> @wecom/wecom-openclaw-plugin</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p>安装成功后显示相应页面。</p><h4 id="_2-重启-openclaw" tabindex="-1"><a class="header-anchor" href="#_2-重启-openclaw"><span>2. 重启 OpenClaw</span></a></h4><p>在终端中输入以下命令:</p><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665;">openclaw</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;"> gateway</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;"> start</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h4 id="_3-添加渠道" tabindex="-1"><a class="header-anchor" href="#_3-添加渠道"><span>3. 添加渠道</span></a></h4><p>在终端中输入以下命令:</p><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665;">openclaw</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;"> channels</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;"> add</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p>按照引导完成配置:</p><ol><li>选择 channel 为「企业微信」</li><li>输入企业微信机器人的 <strong>Bot ID</strong></li><li>输入 <strong>Secret</strong></li><li>选择「Finished」完成配置</li></ol><h4 id="_4-配对连接" tabindex="-1"><a class="header-anchor" href="#_4-配对连接"><span>4. 配对连接</span></a></h4><ol><li>选择配对方式,选择「Pairing」</li><li>完成后继续配置,可看到配置渠道成功提示</li><li>在企业微信中,保存机器人,并向它发送消息</li><li>会收到一个配置密钥</li><li>复制此消息最后一行,输入到终端中</li><li>完成配对后,即可在企业微信中与机器人正常对话</li></ol><h2 id="企业微信应用-api" tabindex="-1"><a class="header-anchor" href="#企业微信应用-api"><span>企业微信应用 API</span></a></h2><p>
1如需进一步调用企微应用 API,可在管理后台获取必要信息:</p><h3 id="_1-获取企业-id" tabindex="-1"><a class="header-anchor" href="#_1-获取企业-id"><span>1. 获取企业 ID</span></a></h3><p>在企业管理后台 → 「我的企业」→「企业信息」中获取企业 ID。</p><h3 id="_2-获取应用-secret" tabindex="-1"><a class="header-anchor" href="#_2-获取应用-secret"><span>2. 获取应用 Secret</span></a></h3><ol><li>进入「应用管理」→「自建应用」</li><li>点击「查看」并发送 Secret</li><li>在消息列表中获取对应密钥</li></ol><h3 id="_3-使用-api" tabindex="-1"><a class="header-anchor" href="#_3-使用-api"><span>3. 使用 API</span></a></h3><p>将获取的企业 ID 和应用 Secret 发送给已关联 OpenClaw 的机器人后,即可调用企微 API。</p><p>常用 API:</p><ul><li><a href="https://developer.work.weixin.qq.com/document/path/91039" target="_blank" rel="noopener noreferrer">获取 access token</a></li><li><a href="https://developer.work.weixin.qq.com/document/path/97392" target="_blank" rel="noopener noreferrer">文档 API</a></li></ul><h2 id="智能表格-webhook" tabindex="-1"><a class="header-anchor" href="#智能表格-webhook"><span>智能表格 Webhook</span></a></h2><p>可以使用 OpenClaw 快速接入并写入数据至企业微信智能表格。</p><h3 id="配置方法" tabindex="-1"><a class="header-anchor" href="#配置方法"><span>配置方法</span></a></h3><p>参考:<a href="https://developer.work.weixin.qq.com/document/path/101239" target="_blank" rel="noopener noreferrer">接收外部数据到智能表格</a></p><h3 id="使用场景" tabindex="-1"><a class="header-anchor" href="#使用场景"><span>使用场景</span></a></h3><p>当用户在智能表格中开启「接收外部数据」后,系统会为该表格生成唯一的 Webhook 地址,可通过标准 HTTP POST 请求:</p><ul><li>新增智能表格记录</li><li>更新智能表格记录</li></ul><h2 id="常见问题" tabindex="-1"><a class="header-anchor" href="#常见问题"><span>常见问题</span></a></h2><h3 id="q-机器人无法接收消息" tabindex="-1"><a class="header-anchor" href="#q-机器人无法接收消息"><span>Q: 机器人无法接收消息?</span></a></h3><p>检查以下几点:</p><ol><li>确认企业微信应用已发布并启用</li><li>检查 Bot ID 和 Secret 是否正确</li><li>确认配对是否成功完成</li><li>查看 OpenClaw 日志:<code>openclaw logs</code></li></ol><h3 id="q-如何让机器人主动发送消息" tabindex="-1"><a class="header-anchor" href="#q-如何让机器人主动发送消息"><span>Q: 如何让机器人主动发送消息?</span></a></h3><p>使用长连接模式创建的机器人支持主动向用户发送消息。确保在创建时选择「长连接」方式。</p><h3 id="q-如何获取群聊-id" tabindex="-1"><a class="header-anchor" href="#q-如何获取群聊-id"><span>Q: 如何获取群聊 ID?</span></a></h3><p>在群聊中发送消息后,查看 OpenClaw 日志可以找到群聊 ID。</p><h2 id="相关资源" tabindex="-1"><a class="header-anchor" href="#相关资源"><span>相关资源</span></a></h2>',66)),a("ul",null,[e[2]||(e[2]=a("li",null,[a("a",{href:"https://cloud.tencent.com/developer/article/2625147",target:"_blank",rel:"noopener noreferrer"},"腾讯轻量云接入 OpenClaw")],-1)),e[3]||(e[3]=a("li",null,[a("a",{href:"https://developer.work.weixin.qq.com/",target:"_blank",rel:"noopener noreferrer"},"企业微信开发者后台")],-1)),a("li",null,[i(n,{href:"/guide/agents/"},{default:s(()=>[...e[0]||(e[0]=[l("OpenClaw 多 Agent 配置",-1)])]),_:1})]),a("li",null,[i(n,{href:"/guide/skills/"},{default:s(()=>[...e[1]||(e[1]=[l("OpenClaw Skills 市场",-1)])]),_:1})])])])}const b=r(d,[["render",c]]),f=JSON.parse('{"path":"/guide/channels/wecom/","title":"企业微信(Wecom) | 指南","lang":"zh-CN","frontmatter":{"title":"企业微信(Wecom)","createTime":"2026/03/12 10:00:00","permalink":"/guide/channels/wecom/","description":"接入企业微信作为工作群与团队协作的主要渠道。","head":[["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"企业微信(Wecom)\\",\\"image\\":[\\"/lobster.svg\\"],\\"dateModified\\":null,\\"author\\":[{\\"@type\\":\\"Person\\",\\"name\\":\\"OpenClaw\\"}]}"],["meta",{"property":"og:url","content":"https://openclawgithub.cc/guide/channels/wecom/"}],["meta",{"property":"og:site_name","content":"OpenClaw 中文教程"}],["meta",{"property":"og:title","content":"企业微信(Wecom)"}],["meta",{"property":"og:description","content":"接入企业微信作为工作群与团队协作的主要渠道。"}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"/lobster.svg"}],["meta",{"property":"og:locale","content":"zh-CN"}
1],["meta",{"name":"twitter:creator","content":"openclaw"}],["meta",{"name":"keywords","content":"openclaw 企业微信,wecom openclaw,openclaw wecom"}]]},"readingTime":{"minutes":4.07,"words":1220},"git":{"createdTime":1788971858000},"filePathRelative":"guide/channels-wecom.md","headers":[]}');export{b as comp,f as data};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.