Skip to content

ProtobufBot/pbrq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Dec 11, 2022
8565573 · Dec 11, 2022
Jun 21, 2022
Jun 16, 2022
Jul 24, 2022
Dec 11, 2022
Jun 21, 2022
Mar 16, 2022
Dec 11, 2022
Jun 28, 2022
Jun 25, 2022
Mar 16, 2022
Dec 11, 2022

Repository files navigation

pbbot-rq

基于 ricq 的机器人框架,使用 websocket + protobuf 通信。

使用方法

直接运行

  1. 下载 Release 版本。
  2. 下载 PBRQ-UI-Release,并解压 static.zip。
  3. 如果是 Linux/MacOS 需要执行 chmod +x pbbot-rq 添加权限。
  4. 执行 ./pbbot-rq --help 查看帮助。
  5. 执行 ./pbbot-rq --bind-addr 0.0.0.0:9000 --static-dir static 启动程序,可以自己添加参数开启 跨域、HTTP-BASIC登录 等功能。
  6. 打开浏览器访问 http://localhost:9000 管理机器人。
  7. 首次运行后生成 plugins 文件夹,默认连接地址 ws://localhost:8081/ws/rq/,修改后重启生效。
├── pbbot-rq.exe
└── static
    ├── asset-manifest.json
    ├── favicon.ico
    ├── index.html
    ├── logo192.png
    ├── logo512.png
    ├── manifest.json
    ├── robots.txt
    └── static
        ├── css
        │   └── main.a14a9148.css
        └── js
            ├── 27.af432e68.chunk.js
            ├── main.989aee2b.js
            └── main.989aee2b.js.LICENSE.txt

Docker运行

docker run --name pbrq -d -p 9000:9000 -v plugins:/app/plugins lz1998/pbrq:0.1.9
  • 默认端口 9000
  • 挂载目录 plugins,修改需要重启docker restart pbrq

API

  • SendPrivateMsg
  • SendGroupMsg
  • DeleteMsg
  • SetGroupKick
  • SetGroupBan
  • SetGroupWholeBan
  • SetGroupAdmin
  • SetGroupCard
  • SetGroupName
  • SetGroupLeave
  • SetGroupSpecialTitle
  • SetFriendAddRequest
  • SetGroupAddRequest
  • GetLoginInfo
  • GetStrangerInfo
  • GetFriendList
  • GetGroupInfo
  • GetGroupList
  • GetGroupMemberInfo
  • GetGroupMemberList

Event

  • GroupMessageEvent
  • PrivateMessageEvent
  • GroupRequestEvent
  • GroupRequestEvent
  • FriendRequestEvent
  • GroupIncreaseNoticeEvent
  • GroupBanNoticeEvent
  • FriendRecallNoticeEvent
  • GroupRecallNoticeEvent
  • FriendAddNoticeEvent
  • GroupDecreaseNoticeEvent
  • GroupAdminNoticeEvent

消息类型

  • text
  • face
  • at
  • image
  • video
  • music

编译

环境要求:使用 rustup 安装的 Rust 环境。

如果速度较慢可以使用 rsproxy

 # 更新rust工具链到最新
rustup update

# 拉取最新代码
git pull

# 更新依赖
cargo update

# 清理之前的产物
cargo clean

# 编译
cargo +nightly build --release

# 运行
./target/release/main