Toggle navigation
学院首页
企业微信AI SCRM
企微管家Claw
企业微信服务商
行业方案
合规wetool
私域
微盛·企微管家动态
企业管理
企业微信运营
加入收藏
联系我们
会员
中心
登录
注册
首页
营销裂变
企业微信的机器人如何每天定时发送内容到群里面?
6462815 阅读
0 评论
1538766 点赞
<p><span style="font-size: 12pt; color: rgb(31, 35, 41);"><img alt="Image" src="/uploads/20251106/80ce7e1813188ab37a33d5795fbd0073.jpg" width="2804" height="1280">企业微信的群机器人是企业内部沟通的重要工具,通过接口可实现消息的主动推送。但</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">群机器人本身不支持内置定时发送功能</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">,需结合</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">Webhook接口</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">与</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">外部定时工具</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">(如Cron、云函数、第三方自动化平台),才能实现每天定时向群内发送内容的需求。本文将分步骤讲解具体实现方法,覆盖群机器人创建、内容准备、定时任务设置等关键环节。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h2><span style="font-size: 16pt; color: rgb(26, 26, 26);">一、前提准备:创建群机器人并获取Webhook地址</span></h2><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">要使用群机器人发送消息,首先需要在企业微信的内部群中创建机器人,并获取其专属的Webhook URL(接口地址)。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h3><span style="font-size: 14pt; color: rgb(26, 26, 26);">1. 群机器人添加入口</span></h3><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">电脑端</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:进入</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">内部群聊</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">→ 点击右上方</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">三个点</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">→ 选择</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">添加群机器人</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">→ 新建机器人(或选择已发布到公司的机器人)。 </span><img src="https://wdcdn.qpic.cn/MTMxMDI3MDMzMDgzNjI3MjM_968433_PdcPEzKJogwgM5St_1754574915?w=792&h=504" width="558.333" height="355.303"></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">手机端</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:进入</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">内部群聊</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">→ 点击右上角</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">三个点</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">→ 选择</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">添加群机器人</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">→ 新建机器人。 </span><img src="https://wdcdn.qpic.cn/MTMxMDI3MDMzMDgzNjI3MjM_33081_q1-8TJ59MqvLVBTq_1754574916?w=1221&h=860" width="558.333" height="393.257"></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">注意</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:</span></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);"> 仅</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">内部群聊</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">支持添加机器人(外部群暂不支持);</span></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);"> 若群聊开启“仅群主管理”,则只有群主有添加机器人的权限; </span><img src="https://wdcdn.qpic.cn/MTMxMDI3MDMzMDgzNjI3MjM_236579_53nmsNypl0FUIN3c_1754574917?w=2354&h=1422" width="604.7333333333333" height="365.30624671916013"></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);"> 机器人创建后,需</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">发布到公司</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">(电脑端右键机器人→ 查看资料→ 发布到公司),才能被其他群聊添加。</span><img src="https://wdcdn.qpic.cn/MTMxMDI3MDMzMDgzNjI3MjM_13587_YBIVky0rC8DVud6J_1754574916?w=792&h=504" width="604.7333333333333" height="384.8303412073491"></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h3><span style="font-size: 14pt; color: rgb(26, 26, 26);">2. 获取Webhook地址</span></h3><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">机器人的创建人可通过以下方式获取Webhook URL:</span></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">电脑端</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:进入群聊→ 群成员列表→ 右键对应机器人→ 查看资料→ 复制</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">Webhook地址</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">; </span><img src="https://wdcdn.qpic.cn/MTMxMDI3MDMzMDgzNjI3MjM_959004_MWDZf-TJIe97mkt1_1754574915?w=792&h=504" width="604.7333333333333" height="384.8303412073491"></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">手机端</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:进入群聊→ 右上角三个点→ 群机器人→ 点击对应机器人→ 复制</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">Webhook地址</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">。 </span><img src="https://wdcdn.qpic.cn/MTMxMDI3MDMzMDgzNjI3MjM_1559_wKH8vlr9XFOuncm6_1754574916?w=1616&h=860" width="558.333" height="297.133"></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h2><span style="font-size: 16pt; color: rgb(26, 26, 26);">二、准备要发送的内容:支持多种消息类型</span></h2><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">群机器人支持发送</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">文本、markdown、图片、文件、图文</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">等多种类型的消息,需根据需求选择合适的格式,并遵循企业微信的消息规范。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h3><span style="font-size: 14pt; color: rgb(26, 26, 26);">1. 常见消息类型及格式</span></h3><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">文本消息</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:支持`@all`或`@具体成员`(需使用成员ID),示例:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span><img src="https://wdcdn.qpic.cn/MTY4ODg1MTY2MjkwMzk2Mg_860738_x5mEjjSSHjMOLTo4_1760424617?w=530&h=238&type=image/png" width="530" height="238"></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);">markdown消息:</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">支持标题、加粗、链接、引用等语法(不支持字体颜色),示例:</span></p><p><img src="https://wdcdn.qpic.cn/MTY4ODg1MTY2MjkwMzk2Mg_271937_71uoz8Be-XDuG0b5_1760424669?w=531&h=194&type=image/png" width="531" height="194"></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">图片/文件消息</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:需先通过</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">文件上传接口</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">获取`media_id`(3天内有效),再发送消息。示例(图片):</span></p><p><img src="https://wdcdn.qpic.cn/MTY4ODg1MTY2MjkwMzk2Mg_79372_mcWaJrm9wloLU2Z__1760424716?w=527&h=215&type=image/png" width="527" height="215"></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h3><span style="font-size: 14pt; color: rgb(26, 26, 26);">2. 注意事项</span></h3><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);">消息内容需为UTF-8编码,文本消息最长不超过2048字节,markdown最长不超过4096字节;</span></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);">图片(base64编码前)最大不超过2M,支持JPG、PNG格式;</span></p><p>● <span style="font-size: 12pt; color: rgb(31, 35, 41);">文件大小不超过20M,语音文件不超过2M(仅支持AMR格式)。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h2><span style="font-size: 16pt; color: rgb(26, 26, 26);">三、实现定时发送:结合外部工具调用Webhook</span></h2><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">企业微信的群机器人没有内置定时功能,需通过</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">外部定时工具</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">触发HTTP POST请求,调用Webhook接口发送消息。以下是三种常见实现方式:</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h3><span style="font-size: 14pt; color: rgb(26, 26, 26);">1. 方式一:使用Linux Cron(适合技术人员)</span></h3><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">Cron是Linux系统自带的定时任务工具,可通过编写脚本实现定时调用Webhook。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">操作步骤:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">(1)编写发送消息的脚本</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">(如send_message.sh):</span></p><p><img src="https://wdcdn.qpic.cn/MTY4ODg1MTY2MjkwMzk2Mg_387077_-XiThbdUipw4V_ac_1760424762?w=555&h=218&type=image/png" width="555" height="218"></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">(2)添加Cron任务:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">运行crontab -e命令,添加以下内容(每天8:00执行脚本):</span></p><p><img src="https://wdcdn.qpic.cn/MTY4ODg1MTY2MjkwMzk2Mg_226326_1JJmru2lUW4orP28_1760424819?w=543&h=87&type=image/png" width="543" height="87"></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">(3)验证任务:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">运行crontab -l查看任务是否添加成功,等待定时执行。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h3><span style="font-size: 14pt; color: rgb(26, 26, 26);">2. 方式二:使用云函数(适合企业级应用)</span></h3><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">云函数(如阿里云FC、腾讯云SCF)是无服务器计算服务,可通过配置定时触发器实现定时调用,无需维护服务器。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">操作步骤(以腾讯云SCF为例):</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">(1)</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">创建云函数</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">登录腾讯云控制台→ 选择</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">云函数SCF</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">→ 新建函数→ 选择“事件函数”→ 编写代码(使用Python发送POST请求):</span></p><p><img src="https://wdcdn.qpic.cn/MTY4ODg1MTY2MjkwMzk2Mg_99955_6uCv-fvLIa4QRy82_1760424862?w=546&h=428&type=image/png" width="546" height="428"></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">(2)</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">配置定时触发器</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">在函数详情页→ 选择“触发器”→ 新建触发器→ 选择“定时触发”→ 设置触发时间(如每天9:00)。</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">(3)</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">测试与部署</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">点击“测试”按钮验证函数是否正常运行,部署后等待定时触发。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h3><span style="font-size: 14pt; color: rgb(26, 26, 26);">3. 方式三:使用第三方自动化平台(适合非技术人员)</span></h3><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">第三方自动化平台(如Zapier、IFTTT、腾讯云HiFlow)提供可视化界面,无需编写代码即可实现定时发送。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h4><span style="font-size: 12pt; color: rgb(26, 26, 26);">操作步骤(以腾讯云HiFlow为例):</span></h4><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">(1)</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">创建流程</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">登录HiFlow控制台→ 新建流程→ 选择“定时触发”作为触发条件(设置每天10:00触发)。</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">(2)</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">添加“企业微信-发送群机器人消息”动作</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">选择“企业微信”应用→ 选择“发送群机器人消息”动作→ 填写Webhook地址和消息内容(支持可视化编辑markdown)。</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">(3)</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">保存并启用流程</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">点击“保存”→ “启用”流程,等待定时执行。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h2><span style="font-size: 16pt; color: rgb(26, 26, 26);">四、注意事项:避免踩坑</span></h2><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">1. </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">Webhook地址安全</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:Webhook地址包含`key`,需严格保密,避免泄漏给无关人员(否则可能被滥用发送垃圾消息)。</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">2. </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">发送频率限制</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:每个群机器人每分钟最多发送20条消息,避免高频发送导致接口被限流。</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">3. </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">群聊设置检查</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:若群聊开启了“全员禁言”,机器人消息将无法推送,需联系群主关闭禁言。</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">4. </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">定时任务排查</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">:若定时任务未执行,需检查工具配置(如Cron表达式是否正确、云函数触发器是否启用)。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><h2><span style="font-size: 16pt; color: rgb(26, 26, 26);">五、常见问题解答</span></h2><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">1. </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">问:群机器人定时发送的消息没有显示?</span><span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">答:检查群聊是否开启“全员禁言”,或消息内容是否符合企业微信的格式要求(如markdown语法错误)。</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">2. </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">问:使用Cron脚本发送消息失败?</span><span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">答:检查脚本中的Webhook地址是否正确,或服务器是否能访问企业微信API(需确保网络畅通)。</span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">3. </span><span style="font-size: 12pt; color: rgb(31, 35, 41);">问:群机器人能否@具体成员?</span><span style="font-size: 12pt; color: rgb(31, 35, 41);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">答:支持@成员,需在消息内容中添加mentioned_list(成员ID)或mentioned_mobile_list(手机号),但</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">暂不支持@客服号/员工服务账号</span><span style="font-size: 12pt; color: rgb(31, 35, 41);">。</span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 11pt; color: rgb(51, 51, 51);"> </span></p><p><span style="font-size: 12pt; color: rgb(31, 35, 41);">通过以上步骤,企业可实现群机器人每天定时发送内容到群里,提升内部沟通效率。需根据企业的技术能力选择合适的实现方式,也可以选择专业的企业微信服务商(如微盛AI·企微管家)协助企业微信AI落地,确保定时任务的稳定性和安全性。</span></p><p><img alt="Image" src="/uploads/20251106/aef2c540a119f7f38717f39a9c8414c9.png" width="1200" height="500"><br></p>
点赞(
1538766
)
本文分类:
营销裂变
本文标签:
浏览次数:
6462815
次浏览
发布日期:2025-11-26 11:42:17
本文链接:
https://college.wshoto.com/a/307754.html
上一篇 >
金融期货机构如何用企业微信提升客户服务与运营效率
下一篇 >
企业微信会话存档怎么用?官方教程+避坑指南
收藏
分享
从SCRM到AI Agent:微盛·企微管家助力用好企业微信
AI工具买了一堆,为什么用不起来?
AI不是万能的:企业微信AI Agent的能力边界
AI写完文案就结束了?你的运营流程还停留在"手动时代"
评论列表
共有
0
条评论
暂无评论
发表评论
取消回复
登录
注册新账号
微信公众账号
微信扫一扫加关注
发表
评论
返回
顶部
发表评论 取消回复