Grok Bot runs existing tools and workflows from WeChat via ClawBot iLink and a webhook
Overview
The author had search tools, writing Skills, scheduled Routines and external models in Grok Bot but still had to open the app when an idea came up away from the desk, so the author put the entry point in WeChat, which was already in daily use.
Workflow
Trigger: The configured toolchain was stuck inside Grok Bot and inconvenient to use while out. The author already used Grok Bot for more than chat, with search tools, writing Skills, scheduled Routines and external models set up so repeated work just follows an existing workflow. All of it was inside Grok Bot. A story idea or quick lookup while out still meant opening the app. The author first sets a boundary: Grok Bot has an app and WeChat has Yuanbao, so if you only want chat, a quick search or a news summary, use whichever is convenient. The author used WeChat every day anyway and connected Grok Bot to it. Once connected, a WeChat message to Grok Bot can assign work.
The author's setup steps use the original numbering, steps 1–4.
- Bot: Create the WeChat entry point. Open Grok Bot and send this prompt:
Meaning: The prompt the author actually sent asks Grok Bot to connect personal WeChat through WeChat ClawBot's iLink interface, create a Webhook Routine and deploy a relay so the author can use the bot's existing tools and workflows in WeChat. Ask the bot to guide the setup step by step.
帮我通过微信 ClawBot 的 iLink 接口接入个人微信,创建 Webhook Routine,并部署消息转发程序,让我可以在微信里调用你现有的工具和工作流。请逐步引导我完成。
- By hand: Configure the webhook. In Routines, find the new WeChat entry point, copy the Webhook URL and Key, and submit them in the separate encrypted input boxes the bot opens.
- By hand: Scan the QR code to link WeChat. Open Me → Settings → Plugins → ClawBot in WeChat and enable the plugin. Have Grok Bot finish setting up the bridge and generate a QR code, then scan it with WeChat to authorize.
- Bot: Upgrade the same relay to send and receive images, files and videos. At this point chatting with Grok Bot works in WeChat, but only for text. More functionality is needed for it to send generated images directly in WeChat or pass along prepared documents and videos. The author says there is no need to reconnect WeChat. Ask Grok Bot to upgrade the relay from the previous steps. Open Grok Bot and send the upgrade prompt. The original code block has 6 parts: (1) research the official package source, (2) the shared upload flow for all three media types, (3) send.py arguments, exit codes and success criteria, (4) security constraints, (5) three tests, and (6) updated instructions for the incoming WeChat message routine.
Meaning: The original code block below contains the prompt the author actually sent. Tell the bot WeChat is already connected through WeChat ClawBot (iLink), the relay is in grokbot-wechat on its computer, and send.py currently sends only text. Have it add image, file and video sending in one pass and report back after successful tests. Part 1: Use npm pack to download and unpack the official Tencent package, read the specified files, and follow official source code without guessing. Part 2: The shared upload flow for all three media types calculates the original size and md5, generates random filekey and aeskey values, calls the endpoint for an upload address, encrypts with AES-128-ECB and uploads to the WeChat CDN, then sends the corresponding message item. It also lists pitfalls. Part 3: Add three mutually exclusive media arguments to send.py, define four exit codes, use ret/errcode in the returned JSON to determine success (HTTP 200 alone is insufficient), and log success in history.log. Part 4: Use only the two official addresses and never print the credentials file, bot_token, context_token, webhook address or key in any output. Keep text sending working and avoid restarting the relay. Part 5: Send the author's WeChat an image labeled Image test, a txt file, an MP4 of about 3 seconds (made with ffmpeg, installing it first if needed), and then a message saying All three tests have been sent. Part 6: Update the incoming WeChat message routine to say it can use the three media arguments to send the author images, files and videos.
我的微信已经通过「微信ClawBot」(iLink) 接到你这里,转发程序在你电脑的 grokbot-wechat 目录里,现在 send.py 只能发文字。请一次性给它加上发图片、文件、视频三种功能,测通后告诉我结果。 1、先调研:用 npm pack 下载腾讯官方包 @tencent-weixin/openclaw-weixin(2.4.10 或最新稳定版)并解压,重点读 src/api/types.ts、src/cdn/upload.ts、src/cdn/cdn-upload.ts、src/messaging/send.ts,以官方源码为准,不要靠猜。 2、三种媒体共用的上传流程:
- 读文件,算原大小和 md5,随机生成 16 字节的 filekey 和 aeskey(hex)
- 调 ilink/bot/getuploadurl,media_type 图片=1、视频=2、文件=3,带 no_need_thumb: true
- 用 AES-128-ECB + PKCS7 加密,把密文上传到微信 CDN,从响应头 x-encrypted-param 拿下载参数
- 调 sendmessage 发对应 item:图片 type=2 image_item,文件 type=4 file_item,视频 type=5 video_item
- 容易错的地方:media.aes_key 是「hex 字符串」的 base64;file_item.len 是原文件大小,要写成字符串;image_item.mid_size 和 video_item.video_size 填密文大小;视频按官方做法不传封面
3、send.py 加 --image、--file、--video 三个参数(不能同时用),可以附一句说明文字(先作为文字发出)。退出码:0 成功,1 媒体发送失败(不进排队),3 文字已排队,4 用户发了新消息、什么都不发。判断成功要看返回 JSON 里的 ret/errcode,不能只看 HTTP 200。发成功后在 history.log 记「[图片]/[文件]/[视频] 文件名」。 4、安全:只用 ilinkai.weixin.qq.com 和微信 CDN 这两个官方地址;不要在任何输出里打印 credentials.json、bot_token、context_token、webhook 地址和 key;不要改坏发文字的功能,不用重启转发程序。 5、测试:依次往我微信发一张写着「图片测试」的图片、一个 txt 文件、一段 3 秒左右的 MP4 视频(用 ffmpeg 做,没有就先装),最后发一句「三项测试发完了」。 6、把微信消息入口那个 routine 的指令也更新一下,告诉它以后可以用 --image / --file / --video 给我发图片、文件和视频。
Check: The author's check in step 3 is to send a test message after scanning the QR code and confirm that the task runs and gets a normal reply. The step 4 prompt gives the check to the bot: send all three test items in order, send the closing message, and report back after testing successfully. The article contains no check by the author showing whether all three arrived.
Key points and results
- The author says when the work of connecting is warranted. Grok Bot already has an app and WeChat has Yuanbao. For chat, quick research or news summaries, the author says to use whichever is convenient. The author connected WeChat because Grok Bot already had search tools, writing Skills, scheduled Routines and external models. Moving the entry point to the app used daily saved opening a separate app for content ideas or quick lookups while out.
- How it compares with running OpenClaw locally. This is the author's claim; the source gives no comparison figures. The author says many people previously connected OpenClaw to WeChat, but it ran on their computer and stopped responding if it was turned off, offline or asleep. A cloud assistant like Grok Bot has an always-on computer, so the local device can be off and WeChat messages can still trigger tasks and get replies.
- Upgrade the existing relay and keep keys out of chat. Adding images, files and videos requires upgrading the same relay instead of reconnecting WeChat (step 4). Enter the Webhook URL and Key separately in the encrypted input boxes the bot shows (step 2).
- The author's closing reaction. The author was happy that bringing it into WeChat was another step toward an ideal life and quipped that ClawBot still had its old name, a relic of its time.
- The source gives no results for the three media tests. The prompt asks the bot to send an image, a txt file and an MP4 of about 3 seconds in order, send a closing message, and report after the tests pass. The article gives no results for the three tests or other figures on the effect.
Source
- Platform
- X Article
- Author
- bit_sister
- Published
- Categories
- Getting started
What this evidence label means
Source read in full
We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.