跳转到主要内容

微信消息管理

个微消息管理相关命令,使用 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_usernamestring接收方微信ID(wxid)
contentstring文本内容

示例

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_usernamestring接收方微信ID(wxid)
image_urlstring图片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_usernamestring接收方微信ID(wxid)
video_urlstring视频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_usernamestring接收方微信ID(wxid)
file_urlstring文件URL地址
file_namestring文件名

示例

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_usernamestring接收方微信ID(wxid)
emoji_urlstring表情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_usernamestring接收方微信ID(wxid)
card_usernamestring名片用户ID
nicknamestring名片昵称
head_urlstring头像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_usernamestring接收方微信ID(wxid)
longitudenumber经度
latitudenumber纬度
titlestring位置名称

示例

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_usernamestring接收方微信ID(wxid)
titlestring链接标题
urlstring链接地址
descstring链接描述
image_urlstring封面图片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_usernamestring接收方微信ID(wxid)
appidstring小程序AppID
titlestring小程序标题
urlstring小程序路径

示例

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"}'

参数

参数类型必填说明
usernamestring接收方微信ID(wxid)
msgidstring要撤回的消息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_usernamestring接收方微信ID(wxid)
refer_msgidstring被回复的消息ID
contentstring回复内容

示例

bash
juhe-cli wx msg refer '{"to_username": "wxid_abc123", "refer_msgid": "123", "content": "收到"}'

语音转文字

将语音消息转换为文字。

语法

bash
juhe-cli wx msg voice_to_text '{"msgid": "123456"}'

参数

参数类型必填说明
msgidstring语音消息ID

示例

bash
juhe-cli wx msg voice_to_text '{"msgid": "123456"}'