基于oicq的oneBot实现
npm install @oicq/onebot




docs
shell
npm init -y
`
2. 安装@oicq/oneBot
`shell
npm install @oicq/onebot
`
3. 在项目跟目录添加配置文件config.yaml
`yaml
port: 6727 # 项目oicq-oneBot监听的端口(默认:6727)
1472258369: # 你的机器人账户
version: V11 # oneBot版本(V11 或 V12)
`
4. 新建入口文件index.js并输入一下内容
`javascript
const {createApp}=require('@oicq/onebot')
createApp()
.start()
`
5. 启动项目
`shell
node ./index.js
`
使用命令行启动
`shell
npm install -g @oicq/onebot
oicq-onebot
``| url | method | params | desc |
|:--------| :--- |:-----------------|:----------------------|
| /list | GET | | 获取当前运行的机器人列表 |
| /detail | GET | uin | 获取指定机器人配置 |
| /qrcode | GET | uin | 获取指定机器人登录二维码 |
| /add | POST | {uin,...config} | 添加机器人 config 为机器人配置 |
| /edit | POST | {uin,...config} | 修改机器人配置 config 为机器人配置 |
| /remove | get | uin | 移除机器人 |