mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: report self
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"name": "LLOneBot",
|
"name": "LLOneBot",
|
||||||
"slug": "LLOneBot",
|
"slug": "LLOneBot",
|
||||||
"description": "LiteLoaderQQNT的OneBotApi",
|
"description": "LiteLoaderQQNT的OneBotApi",
|
||||||
"version": "2.4.1",
|
"version": "2.5.0",
|
||||||
"thumbnail": "./icon.png",
|
"thumbnail": "./icon.png",
|
||||||
"authors": [{
|
"authors": [{
|
||||||
"name": "linyuchen",
|
"name": "linyuchen",
|
||||||
|
@@ -171,7 +171,7 @@ function onLoad() {
|
|||||||
for (const message of payload.msgList) {
|
for (const message of payload.msgList) {
|
||||||
OB11Construct.constructMessage(message).then((msg) => {
|
OB11Construct.constructMessage(message).then((msg) => {
|
||||||
postMsg(msg);
|
postMsg(msg);
|
||||||
});
|
}).catch(e=>log("constructMessage error: ", e.toString()));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ export function hookNTQQApiReceive(window: BrowserWindow) {
|
|||||||
if (args?.[1] instanceof Array) {
|
if (args?.[1] instanceof Array) {
|
||||||
for (let receiveData of args?.[1]) {
|
for (let receiveData of args?.[1]) {
|
||||||
const ntQQApiMethodName = receiveData.cmdName;
|
const ntQQApiMethodName = receiveData.cmdName;
|
||||||
log(`received ntqq api message: ${channel} ${ntQQApiMethodName}`, JSON.stringify(receiveData))
|
// log(`received ntqq api message: ${channel} ${ntQQApiMethodName}`, JSON.stringify(receiveData))
|
||||||
for (let hook of receiveHooks) {
|
for (let hook of receiveHooks) {
|
||||||
if (hook.method === ntQQApiMethodName) {
|
if (hook.method === ntQQApiMethodName) {
|
||||||
hook.hookFunc(receiveData.payload);
|
hook.hookFunc(receiveData.payload);
|
||||||
|
@@ -58,10 +58,10 @@ export class OB11Construct {
|
|||||||
message_data["data"]["mention"] = "all"
|
message_data["data"]["mention"] = "all"
|
||||||
message_data["data"]["qq"] = "all"
|
message_data["data"]["qq"] = "all"
|
||||||
} else {
|
} else {
|
||||||
let uid = element.textElement.atNtUid
|
let uid = element.textElement.atUid
|
||||||
let atMember = getGroupMember(msg.peerUin, uid)
|
let atMember = getGroupMember(msg.peerUin, uid)
|
||||||
message_data["data"]["mention"] = atMember!.uin
|
message_data["data"]["mention"] = atMember?.uin
|
||||||
message_data["data"]["qq"] = atMember!.uin
|
message_data["data"]["qq"] = atMember?.uin
|
||||||
}
|
}
|
||||||
} else if (element.textElement) {
|
} else if (element.textElement) {
|
||||||
message_data["type"] = "text"
|
message_data["type"] = "text"
|
||||||
|
@@ -267,6 +267,12 @@ export function startExpress(port: number) {
|
|||||||
|
|
||||||
|
|
||||||
export function postMsg(msg: OB11Message) {
|
export function postMsg(msg: OB11Message) {
|
||||||
|
const {reportSelfMessage} = getConfigUtil().getConfig()
|
||||||
|
if (!reportSelfMessage) {
|
||||||
|
if (msg.user_id == selfInfo.user_id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
for (const host of getConfigUtil().getConfig().hosts) {
|
for (const host of getConfigUtil().getConfig().hosts) {
|
||||||
fetch(host, {
|
fetch(host, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
Reference in New Issue
Block a user