Skip to content

Latest commit

 

History

History
305 lines (294 loc) · 8.72 KB

WeeBot.md

File metadata and controls

305 lines (294 loc) · 8.72 KB

:::info WeeBot提供最基本的WeChat消息收发功能,帮助你实现简单的自动化操作 :::

下载和启动

  1. 下载程序包 WeeBot-3.9.10.27-0.6.0.zip
  2. 登录WeChat客户端,确认当前版本为3.9.10.27(下载WeChat客户端
  3. 解压缩后启动WeeBot程序,点击【Start】启动服务,点击【Stop】取消程序挂接

a024aae6eec40d8ddebe01cd52916ffc.png

接收消息

协议:websoket 连接地址:ws://127.0.0.1:19099 使用任意编程语言启动一个ws client即可实时接收消息推送 接收消息示例:

{
  "id": "1264199305822102857",
  "filename": "",
  "text": "Jim",
  "timestamp": 1718391525,
  "type": 1,
  "talkerId": "luyc",
  "roomId": "21341182572@chatroom",
  "mentionIds": [],
  "listenerId": "",
  "isSelf": false
}

WeeBot API说明

协议:http API地址: http://127.0.0.1:19088 同时支持GET/POST的接口,在使用POST方法请求时body设置为{}

获取联系人列表 GET /api/contacts

{
    "code": 1,
    "data": [
        {
            "id": "wang9935226",
            "gender": 1,
            "type": 3,
            "name": "青牛踏雪御苍穹",
            "friend": true,
            "star": false,
            "coworker": false,
            "address": null,
            "weixin": "cya89",
            "corporation": "",
            "title": "",
            "description": "",
            "phone": []
        },
        {
            "id": "wxid_sonjrdopx77221",
            "gender": 1,
            "type": 3,
            "name": "一类化学危险品汽车修理",
            "friend": true,
            "star": false,
            "coworker": false,
            "address": null,
            "weixin": "Z3381108383",
            "corporation": "",
            "title": "",
            "description": "",
            "phone": []
        }],
    "msg": "success"
}

获取群列表 GET /api/rooms

{
    "code": 1,
    "data": [
        {
            "id": "20889085065@chatroom",
            "gender": 1,
            "type": 2,
            "name": "干球人羽毛球俱乐部",
            "friend": true,
            "star": false,
            "coworker": false,
            "address": null,
            "weixin": "",
            "corporation": "",
            "title": "",
            "description": "",
            "phone": []
        },
        {
            "id": "2037113676@chatroom",
            "gender": 1,
            "type": 2,
            "name": "星羽联盟🏸",
            "friend": true,
            "star": false,
            "coworker": false,
            "address": null,
            "weixin": "",
            "corporation": "",
            "title": "",
            "description": "",
            "phone": []
        }],
    "msg": "success"
}

获取登录用户信息 GET /api/contacts/self

{
    "code": 1,
    "data": {
        "id": "wxid_0o1t51l3f57221",
        "gender": 1,
        "name": "大师",
        "coworker": true,
        "avatar": "https://wx.qlogo.cn/mmhead/ver_1/2FFoLE7eRpAOFHUwYkLyicQwrhsDHZU1Nmp0IcDKJcmRNxlTgXlzrvmAYJDQ32NibNRBRTxfGyK09UyUgPibjAYibc7xJWtJvPoRfwAfRQdvgG8/0",
        "address": "",
        "alias": "",
        "city": "Haidian",
        "province": "Beijing",
        "weixin": "ledongmao",
        "corporation": "",
        "title": "",
        "description": "",
        "phone": [
            "15313358151"
        ]
    },
    "msg": "success"
}

发送文本消息 POST /api/message/text

{"contactId": "filehelper","text": "1112224"}
{
  "code": 1,
  "data": 1,
  "msg": "success"
}

兼容wxhelper API说明

兼容wxhelper接口,服务端口、路径、请求参数与wxhelper一致,响应参数中的data有差异 协议:http API地址: http://127.0.0.1:19088 同时支持GET/POST的接口,在使用POST方法请求时body设置为{}

获取登录用户信息 POST /api/userInfo

入参:

{}

响应:

{
    "code": 1,
    "data": {
        "account": "xxx",
        "city": "Zhengzhou",
        "country": "CN",
        "currentDataPath": "C:\\WeChat Files\\wxid_xxx\\",
        "dataSavePath": "C:\\wechatDir\\WeChat Files\\",
        "dbKey": "965715e30e474da09250cb5aa047e3940ffa1c8f767c4263b132bb512933db49",
        "headImage": "https://wx.qlogo.cn/mmhead/ver_1/MiblV0loY0GILewQ4u2121",
        "mobile": "13949175447",
        "name": "xxx",
        "province": "Henan",
        "signature": "xxx",
        "wxid": "wxid_22222"
    },
    "msg": "success"
}

获取联系人和群列表 POST /api/getContactList

入参:

{}

1 响应:

{
    "code": 1,
    "data": [
        {
            "customAccount": "",
            "encryptName": "v3_020b3826fd03010000000000e04128fddf4d90000000501ea9a3dba12f95f6b60a0536a1adb6b40fc4086288f46c0b89e6c4eb8062bb1661b4b6fbab708dc4f89d543d7ade135b2be74c14b9cfe3accef377b9@stranger",
            "nickname": "文件传输助手",
            "pinyin": "WJCSZS",
            "pinyinAll": "wenjianchuanshuzhushou",
            "remark": "",
            "remark_pinyin": "",
            "remark_pinyin_all": "",
            "label_ids": "",
            "reserved1": 1,
            "reserved2": 1,
            "type": 3,
            "verifyFlag": 0,
            "wxid": "filehelper"
        }
    ],
    "msg": "success"
}

发送文本消息 POST /api/sendTextMsg

入参:

{"wxid": "filehelper","msg": "1112224"}

响应:

{
    "code": 1,
    "data": 1,
    "msg": "success"
}

兼容wechat-bot API说明

兼容wechat-bot接口,服务端口、路径、请求参数与wechat-bot一致,响应参数中的data有差异 协议:http API地址: http://127.0.0.1:19088 同时支持GET/POST的接口,在使用POST方法请求时body设置为{}

获取联系人和群列表 POST /api/getcontactlist

{
  "id":"123456",
  "type":5000,
  "roomid":"null",
  "wxid":"null",
  "content":"null",
  "nickname":"null",
  "ext":"null"
}
{
    "code": 1,
    "data": [
        {
            "customAccount": "",
            "encryptName": "v3_020b3826fd03010000000000e04128fddf4d90000000501ea9a3dba12f95f6b60a0536a1adb6b40fc4086288f46c0b89e6c4eb8062bb1661b4b6fbab708dc4f89d543d7ade135b2be74c14b9cfe3accef377b9@stranger",
            "nickname": "文件传输助手",
            "pinyin": "WJCSZS",
            "pinyinAll": "wenjianchuanshuzhushou",
            "remark": "",
            "remark_pinyin": "",
            "remark_pinyin_all": "",
            "label_ids": "",
            "reserved1": 1,
            "reserved2": 1,
            "type": 3,
            "verifyFlag": 0,
            "wxid": "filehelper"
        }
    ],
    "msg": "success"
}

发送文本消息 POST /api/sendtxtmsg

{
  "id":"123456",
  "type":555,
  "wxid":"23023281066@chatroom",
  "content":"hello word",
  "nickname":"null",
  "ext":"null"
}
{
    "code": 1,
    "data": 1,
    "msg": "success"
}

更新日志

v0.6.0

  • 新增wechat-bot兼容接口API

v0.5.3

  • 优化启动逻辑,程序开启时自动启动,可手动停止
  • 优化按钮操作显示,增加按钮激活、禁用状态
  • 优化图片解析逻辑,增加延时保证缩略图下载

v0.5.0

  • 新增接收图片(缩略图)消息
  • 新增接收文件消息

v0.4.0

  • 新增获取群列表接口/api/rooms
  • 修复无法正常退出问题
  • 修复联系人列表信息不全问题
  • 优化响应数据格式

v0.1.0

  • 初始化版本,支持获取联系人列表、获取当前用户信息、发送文本消息、接收消息