mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b830cfbfa0 | ||
![]() |
ce25c9752f | ||
![]() |
5e00aee176 | ||
![]() |
a25c1b24fc | ||
![]() |
afed1b8575 | ||
![]() |
0fe58c1965 | ||
![]() |
b3cae5f1c6 | ||
![]() |
d09fc78747 | ||
![]() |
19d7ecd4f0 | ||
![]() |
070eee6c1c | ||
![]() |
fe5e0ea4e0 | ||
![]() |
a249139fe0 | ||
![]() |
3d03aec976 | ||
![]() |
083d3ddf67 |
16
README.md
16
README.md
@@ -1,6 +1,5 @@
|
|||||||
# LLOneBot API
|
# LLOneBot API
|
||||||
|
|
||||||
|
|
||||||
将NTQQLiteLoaderAPI封装成OneBot11/12标准的API, V12没有完整测试
|
将NTQQLiteLoaderAPI封装成OneBot11/12标准的API, V12没有完整测试
|
||||||
|
|
||||||
*注意:本文档对应的是 LiteLoader 1.0.0及以上版本,如果你使用的是旧版本请切换到本项目v1分支查看文档*
|
*注意:本文档对应的是 LiteLoader 1.0.0及以上版本,如果你使用的是旧版本请切换到本项目v1分支查看文档*
|
||||||
@@ -105,24 +104,11 @@
|
|||||||
</details>
|
</details>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>撤回消息无效</summary>
|
|
||||||
<br/>
|
|
||||||
如果接口调用的传的`message`是number类型会导致精度丢失,使用string类型可解决,详情见<a href="https://github.com/linyuchen/LiteLoaderQQNT-OneBotApi/issues/17">issue#17</a>
|
|
||||||
</details>
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>如何查看日志</summary>
|
|
||||||
<br/>
|
|
||||||
LiteLoaderQQNT/data/LLOneBot/*.log
|
|
||||||
</details>
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- [x] 接口返回更详细的错误信息,目前消息发不出去也会返回发送成功(这河里吗)
|
|
||||||
- [ ] 转发消息记录
|
- [ ] 转发消息记录
|
||||||
|
- [ ] 好友点赞api
|
||||||
- [ ] 支持websocket,等个有缘人提PR实现
|
- [ ] 支持websocket,等个有缘人提PR实现
|
||||||
- [ ] 重构摆脱LLAPI,目前调用LLAPI只能在renderer进程调用,需重构成在main进程调用
|
- [ ] 重构摆脱LLAPI,目前调用LLAPI只能在renderer进程调用,需重构成在main进程调用
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
"name": "LLOneBot",
|
"name": "LLOneBot",
|
||||||
"slug": "LLOneBot",
|
"slug": "LLOneBot",
|
||||||
"description": "LiteLoaderQQNT的OneBotApi",
|
"description": "LiteLoaderQQNT的OneBotApi",
|
||||||
"version": "2.3.0",
|
"version": "2.4.0",
|
||||||
"thumbnail": "./icon.png",
|
"thumbnail": "./icon.png",
|
||||||
"authors": [{
|
"authors": [{
|
||||||
"name": "linyuchen",
|
"name": "linyuchen",
|
||||||
|
@@ -185,6 +185,7 @@ export interface Config {
|
|||||||
hosts: string[]
|
hosts: string[]
|
||||||
enableBase64?: boolean
|
enableBase64?: boolean
|
||||||
debug?: boolean
|
debug?: boolean
|
||||||
|
reportSelfMessage?: boolean
|
||||||
log?: boolean
|
log?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
/// <reference path="./global.d.ts" />
|
/// <reference path="./global.d.ts" />
|
||||||
|
|
||||||
// import express from "express";
|
|
||||||
// const { ipcRenderer } = require('electron');
|
|
||||||
import {
|
import {
|
||||||
AtType,
|
AtType,
|
||||||
ChatType,
|
ChatType,
|
||||||
@@ -13,7 +11,6 @@ import {
|
|||||||
SendMsgResult,
|
SendMsgResult,
|
||||||
User
|
User
|
||||||
} from "./common/types";
|
} from "./common/types";
|
||||||
import {checkFileReceived} from "./main/utils";
|
|
||||||
|
|
||||||
let self_qq: string = ""
|
let self_qq: string = ""
|
||||||
let groups: Group[] = []
|
let groups: Group[] = []
|
||||||
@@ -125,7 +122,7 @@ async function getGroupMember(group_qq: string, member_uid: string) {
|
|||||||
|
|
||||||
async function handleNewMessage(messages: MessageElement[]) {
|
async function handleNewMessage(messages: MessageElement[]) {
|
||||||
console.log("llonebot 收到消息:", messages);
|
console.log("llonebot 收到消息:", messages);
|
||||||
const {debug, enableBase64} = await window.llonebot.getConfig();
|
const {debug, enableBase64, reportSelfMessage} = await window.llonebot.getConfig();
|
||||||
for (let message of messages) {
|
for (let message of messages) {
|
||||||
let onebot_message_data: any = {
|
let onebot_message_data: any = {
|
||||||
self: {
|
self: {
|
||||||
@@ -244,9 +241,13 @@ async function handleNewMessage(messages: MessageElement[]) {
|
|||||||
msgHistory.splice(0, 100)
|
msgHistory.splice(0, 100)
|
||||||
}
|
}
|
||||||
msgHistory.push(message)
|
msgHistory.push(message)
|
||||||
console.log("发送上传消息给ipc main", onebot_message_data)
|
if (!reportSelfMessage && onebot_message_data["user_id"] == self_qq){
|
||||||
|
console.log("开启了不上传自己发送的消息,进行拦截 ", onebot_message_data);
|
||||||
|
} else {
|
||||||
|
console.log("发送上传消息给ipc main", onebot_message_data);
|
||||||
window.llonebot.postData(onebot_message_data);
|
window.llonebot.postData(onebot_message_data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function listenSendMessage(postData: PostDataSendMsg) {
|
async function listenSendMessage(postData: PostDataSendMsg) {
|
||||||
@@ -624,6 +625,13 @@ async function onSettingWindowCreated(view: Element) {
|
|||||||
</div>
|
</div>
|
||||||
<setting-switch id="debug" ${config.debug ? "is-active" : ""}></setting-switch>
|
<setting-switch id="debug" ${config.debug ? "is-active" : ""}></setting-switch>
|
||||||
</setting-item>
|
</setting-item>
|
||||||
|
<setting-item data-direction="row" class="hostItem vertical-list-item">
|
||||||
|
<div>
|
||||||
|
<div>上报自身消息</div>
|
||||||
|
<div class="tips">开启后上报自己发出的消息</div>
|
||||||
|
</div>
|
||||||
|
<setting-switch id="reportSelfMessage" ${config.reportSelfMessage ? "is-active" : ""}></setting-switch>
|
||||||
|
</setting-item>
|
||||||
<setting-item data-direction="row" class="hostItem vertical-list-item">
|
<setting-item data-direction="row" class="hostItem vertical-list-item">
|
||||||
<div>
|
<div>
|
||||||
<div>日志</div>
|
<div>日志</div>
|
||||||
@@ -679,6 +687,7 @@ async function onSettingWindowCreated(view: Element) {
|
|||||||
|
|
||||||
switchClick("debug", "debug");
|
switchClick("debug", "debug");
|
||||||
switchClick("switchBase64", "enableBase64");
|
switchClick("switchBase64", "enableBase64");
|
||||||
|
switchClick("reportSelfMessage", "reportSelfMessage");
|
||||||
switchClick("log", "log");
|
switchClick("log", "log");
|
||||||
|
|
||||||
doc.getElementById("save")?.addEventListener("click",
|
doc.getElementById("save")?.addEventListener("click",
|
||||||
|
Reference in New Issue
Block a user