微信消息管理
个微消息管理相关命令,使用 wx 前缀。注意:个微消息使用 to_username 参数(wxid 格式),不同于企微的 conversation_id
SKILL 名称
| SKILL 名称 | 说明 |
|---|---|
juhecli-wx-msg | 个微消息管理 - 发送文本/图片/视频/文件/表情/名片/位置/链接/小程序/视频号,撤回/引用/标记已读/语音转文字 |
发送文本消息
向指定用户发送文本消息。
语法
bash
juhe-cli wx msg send_text '{"to_username": "wxid_xxx", "content": "hello"}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| content | string | 是 | 文本内容 |
示例
bash
juhe-cli wx msg send_text '{"to_username": "wxid_abc123", "content": "你好"}'发送图片消息
向指定用户发送图片消息。
语法
bash
juhe-cli wx msg send_image '{"to_username": "wxid_xxx", "image_url": "https://..."}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| image_url | string | 是 | 图片URL地址 |
示例
bash
juhe-cli wx msg send_image '{"to_username": "wxid_abc123", "image_url": "https://example.com/image.jpg"}'发送视频消息
向指定用户发送视频消息。
语法
bash
juhe-cli wx msg send_video '{"to_username": "wxid_xxx", "video_url": "https://..."}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| video_url | string | 是 | 视频URL地址 |
示例
bash
juhe-cli wx msg send_video '{"to_username": "wxid_abc123", "video_url": "https://example.com/video.mp4"}'发送文件消息
向指定用户发送文件消息。
语法
bash
juhe-cli wx msg send_file '{"to_username": "wxid_xxx", "file_url": "https://...", "file_name": "doc.pdf"}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| file_url | string | 是 | 文件URL地址 |
| file_name | string | 是 | 文件名 |
示例
bash
juhe-cli wx msg send_file '{"to_username": "wxid_abc123", "file_url": "https://example.com/file.pdf", "file_name": "文档.pdf"}'发送表情消息
向指定用户发送表情消息。
语法
bash
juhe-cli wx msg send_emoji '{"to_username": "wxid_xxx", "emoji_url": "https://..."}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| emoji_url | string | 是 | 表情URL地址 |
示例
bash
juhe-cli wx msg send_emoji '{"to_username": "wxid_abc123", "emoji_url": "https://example.com/emoji.png"}'发送名片消息
向指定用户发送名片消息。
语法
bash
juhe-cli wx msg send_card '{"to_username": "wxid_xxx", "card_username": "wxid_yyy", "nickname": "名片", "head_url": ""}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| card_username | string | 是 | 名片用户ID |
| nickname | string | 是 | 名片昵称 |
| head_url | string | 否 | 头像URL |
示例
bash
juhe-cli wx msg send_card '{"to_username": "wxid_abc123", "card_username": "wxid_def456", "nickname": "张三", "head_url": ""}'发送位置消息
向指定用户发送位置消息。
语法
bash
juhe-cli wx msg send_location '{"to_username": "wxid_xxx", "longitude": 116.397, "latitude": 39.909, "title": "位置"}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| longitude | number | 是 | 经度 |
| latitude | number | 是 | 纬度 |
| title | string | 是 | 位置名称 |
示例
bash
juhe-cli wx msg send_location '{"to_username": "wxid_abc123", "longitude": 116.397, "latitude": 39.909, "title": "北京市朝阳区"}'发送链接消息
向指定用户发送链接消息。
语法
bash
juhe-cli wx msg send_link '{"to_username": "wxid_xxx", "title": "标题", "url": "https://...", "desc": "描述", "image_url": ""}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| title | string | 是 | 链接标题 |
| url | string | 是 | 链接地址 |
| desc | string | 否 | 链接描述 |
| image_url | string | 否 | 封面图片URL |
示例
bash
juhe-cli wx msg send_link '{"to_username": "wxid_abc123", "title": "聚合数据", "url": "https://juhebot.com", "desc": "智能客服解决方案", "image_url": "https://example.com/thumb.jpg"}'发送小程序消息
向指定用户发送小程序消息。
语法
bash
juhe-cli wx msg send_mini_app '{"to_username": "wxid_xxx", "appid": "...", "title": "小程序", "url": "..."}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| appid | string | 是 | 小程序AppID |
| title | string | 是 | 小程序标题 |
| url | string | 是 | 小程序路径 |
示例
bash
juhe-cli wx msg send_mini_app '{"to_username": "wxid_abc123", "appid": "wx1234567890", "title": "我的小程序", "url": "pages/index"}'撤回消息
撤回已发送的消息。
语法
bash
juhe-cli wx msg revoke '{"username": "wxid_xxx", "msgid": "123456"}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| username | string | 是 | 接收方微信ID(wxid) |
| msgid | string | 是 | 要撤回的消息ID |
示例
bash
juhe-cli wx msg revoke '{"username": "wxid_abc123", "msgid": "123456"}'回复消息
回复某条消息。
语法
bash
juhe-cli wx msg refer '{"to_username": "wxid_xxx", "refer_msgid": "123", "content": "回复内容"}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| to_username | string | 是 | 接收方微信ID(wxid) |
| refer_msgid | string | 是 | 被回复的消息ID |
| content | string | 是 | 回复内容 |
示例
bash
juhe-cli wx msg refer '{"to_username": "wxid_abc123", "refer_msgid": "123", "content": "收到"}'语音转文字
将语音消息转换为文字。
语法
bash
juhe-cli wx msg voice_to_text '{"msgid": "123456"}'参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| msgid | string | 是 | 语音消息ID |
示例
bash
juhe-cli wx msg voice_to_text '{"msgid": "123456"}'