From 30d0174f47e2304e51cf6d9667a3ae0baac62abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 3 Sep 2024 13:20:10 +0800 Subject: [PATCH] fix: #334 --- manifest.json | 2 +- package.json | 2 +- src/common/version.ts | 2 +- src/onebot/api/msg.ts | 3 +++ src/onebot/types/message.ts | 1 + src/webui/ui/NapCat.ts | 2 +- static/assets/renderer.js | 2 +- 7 files changed, 9 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index 4ca13617e..8e0af195a 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "NapCatQQ", "slug": "NapCat.Framework", "description": "高性能的 OneBot 11 协议实现", - "version": "2.2.40", + "version": "2.2.41", "icon": "./logo.png", "authors": [ { diff --git a/package.json b/package.json index 8696d4eba..98ffba79f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "2.2.40", + "version": "2.2.41", "scripts": { "build:framework": "vite build --mode framework", "build:shell": "vite build --mode shell", diff --git a/src/common/version.ts b/src/common/version.ts index eab85f5dd..f8fb8ba6b 100644 --- a/src/common/version.ts +++ b/src/common/version.ts @@ -1 +1 @@ -export const napCatVersion = '2.2.40'; +export const napCatVersion = '2.2.41'; diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index 8e4a13b41..85689dbab 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -709,6 +709,9 @@ export class OneBotMsgApi { message_format: messagePostFormat === 'string' ? 'string' : 'array', post_type: this.core.selfInfo.uin == msg.senderUin ? EventType.MESSAGE_SENT : EventType.MESSAGE, }; + if (this.core.selfInfo.uin == msg.senderUin) { + resMsg.message_sent_type = 'self'; + } if (msg.chatType == ChatType.KCHATTYPEGROUP) { resMsg.sub_type = 'normal'; // 这里go-cqhttp是group,而onebot11标准是normal, 蛋疼 resMsg.group_id = parseInt(msg.peerUin); diff --git a/src/onebot/types/message.ts b/src/onebot/types/message.ts index 001c0199b..2a340bab2 100644 --- a/src/onebot/types/message.ts +++ b/src/onebot/types/message.ts @@ -8,6 +8,7 @@ export enum OB11MessageType { } export interface OB11Message { + message_sent_type?: string; target_id?: number; // 自己发送的消息才有此字段 self_id?: number, time: number, diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index 7ba5ffa30..9fea01b10 100644 --- a/src/webui/ui/NapCat.ts +++ b/src/webui/ui/NapCat.ts @@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) { SettingItem( 'Napcat', undefined, - SettingButton('V2.2.40', 'napcat-update-button', 'secondary'), + SettingButton('V2.2.41', 'napcat-update-button', 'secondary'), ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index ef794de8b..663b4c4c9 100644 --- a/static/assets/renderer.js +++ b/static/assets/renderer.js @@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) { SettingItem( 'Napcat', void 0, - SettingButton("V2.2.40", "napcat-update-button", "secondary") + SettingButton("V2.2.41", "napcat-update-button", "secondary") ) ]), SettingList([