mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
docs: update readme
This commit is contained in:
parent
ef4443d080
commit
97200f427d
@ -18,7 +18,11 @@ LiteLoaderQQNT的OneBot11协议插件
|
|||||||
|
|
||||||
## 支持的API
|
## 支持的API
|
||||||
|
|
||||||
目前只支持http协议,不支持websocket,事件上报也是http协议
|
目前支持的协议
|
||||||
|
- [x] http调用api
|
||||||
|
- [x] http事件上报
|
||||||
|
- [x] 正向websocket
|
||||||
|
- [ ] 反向websocket
|
||||||
|
|
||||||
主要功能:
|
主要功能:
|
||||||
- [x] 发送好友消息
|
- [x] 发送好友消息
|
||||||
@ -98,9 +102,9 @@ LiteLoaderQQNT的OneBot11协议插件
|
|||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
- [x] 重构摆脱LLAPI,目前调用LLAPI只能在renderer进程调用,需重构成在main进程调用
|
- [x] 重构摆脱LLAPI,目前调用LLAPI只能在renderer进程调用,需重构成在main进程调用
|
||||||
|
- [x] 支持正向websocket
|
||||||
- [ ] 转发消息记录
|
- [ ] 转发消息记录
|
||||||
- [ ] 好友点赞api
|
- [ ] 好友点赞api
|
||||||
- [ ] 支持websocket,等个有缘人提PR实现
|
|
||||||
|
|
||||||
## onebot11文档
|
## onebot11文档
|
||||||
<https://11.onebot.dev/>
|
<https://11.onebot.dev/>
|
||||||
|
@ -73,7 +73,7 @@ export function startWSServer(port: number) {
|
|||||||
const url = req.url;
|
const url = req.url;
|
||||||
ws.send('Welcome to the LLOneBot WebSocket server! url:' + url);
|
ws.send('Welcome to the LLOneBot WebSocket server! url:' + url);
|
||||||
|
|
||||||
if (url == "/api" || url == "/api/") {
|
if (url == "/api" || url == "/api/" || url == "/") {
|
||||||
ws.on("message", async (msg) => {
|
ws.on("message", async (msg) => {
|
||||||
|
|
||||||
let receiveData: { action: ActionName, params: any } = {action: null, params: {}}
|
let receiveData: { action: ActionName, params: any } = {action: null, params: {}}
|
||||||
@ -94,7 +94,8 @@ export function startWSServer(port: number) {
|
|||||||
wsReply(ws, OB11Response.error(`api处理出错:${e}`))
|
wsReply(ws, OB11Response.error(`api处理出错:${e}`))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (url == "/event" || url == "/event/") {
|
}
|
||||||
|
if (url == "/event" || url == "/event/" || url == "/") {
|
||||||
log("event上报ws客户端已连接")
|
log("event上报ws客户端已连接")
|
||||||
wsEventClients.push(ws)
|
wsEventClients.push(ws)
|
||||||
ws.on("close", () => {
|
ws.on("close", () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user