From 433a175809b5708aeece13c8e8db9c931eed883b Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:47:12 +0800 Subject: [PATCH 1/5] fix: `at` element --- src/ntqqapi/api/friend.ts | 8 ++---- src/ntqqapi/api/group.ts | 26 +++++++++++++++++++ src/ntqqapi/api/user.ts | 23 +++++++++------- .../services/NodeIKernelGroupService.ts | 2 ++ src/onebot11/helper/createMessage.ts | 7 +---- src/satori/message.ts | 6 ++++- 6 files changed, 50 insertions(+), 22 deletions(-) diff --git a/src/ntqqapi/api/friend.ts b/src/ntqqapi/api/friend.ts index 2206325..ed17a09 100644 --- a/src/ntqqapi/api/friend.ts +++ b/src/ntqqapi/api/friend.ts @@ -16,7 +16,7 @@ export class NTQQFriendApi extends Service { /** 大于或等于 26702 应使用 getBuddyV2 */ async getFriends() { - const data = await invoke<{ + const res = await invoke<{ data: { categoryId: number categroyName: string @@ -28,11 +28,7 @@ export class NTQQFriendApi extends Service { cbCmd: ReceiveCmdS.FRIENDS, afterFirstCmd: false }) - const _friends: Friend[] = [] - for (const item of data.data) { - _friends.push(...item.buddyList) - } - return _friends + return res.data.flatMap(e => e.buddyList) } async handleFriendRequest(friendUid: string, reqTime: string, accept: boolean) { diff --git a/src/ntqqapi/api/group.ts b/src/ntqqapi/api/group.ts index 2bc90fc..791bbb3 100644 --- a/src/ntqqapi/api/group.ts +++ b/src/ntqqapi/api/group.ts @@ -296,4 +296,30 @@ export class NTQQGroupApi extends Service { async setGroupAvatar(groupCode: string, path: string) { return await invoke('nodeIKernelGroupService/setHeader', [{ path, groupCode }]) } + + async searchMember(groupCode: string, keyword: string) { + await invoke('nodeIKernelGroupListener/onSearchMemberChange', [], { + registerEvent: true + }) + const sceneId = await invoke(NTMethod.GROUP_MEMBER_SCENE, [{ + groupCode, + scene: 'groupMemberList_MainWindow' + }]) + const data = await invoke<{ + sceneId: string + keyword: string + infos: Map + }>( + 'nodeIKernelGroupService/searchMember', + [{ sceneId, keyword }], + { + cbCmd: 'nodeIKernelGroupListener/onSearchMemberChange', + cmdCB: payload => { + return payload.sceneId === sceneId && payload.keyword === keyword + }, + afterFirstCmd: false + } + ) + return data.infos + } } diff --git a/src/ntqqapi/api/user.ts b/src/ntqqapi/api/user.ts index 5cb2d23..dc9f7f8 100644 --- a/src/ntqqapi/api/user.ts +++ b/src/ntqqapi/api/user.ts @@ -108,18 +108,23 @@ export class NTQQUserApi extends Service { async getUidByUinV1(uin: string, groupCode?: string) { let uid = (await invoke('nodeIKernelUixConvertService/getUid', [{ uins: [uin] }])).uidInfo.get(uin) if (!uid) { - const unveifyUid = (await this.getUserDetailInfoByUin(uin)).info.uid //特殊转换 - if (unveifyUid.indexOf('*') === -1) { - uid = unveifyUid - } - } - if (!uid) { - const friends = await this.ctx.ntFriendApi.getFriends() //从好友列表转 + const friends = await this.ctx.ntFriendApi.getFriends() uid = friends.find(item => item.uin === uin)?.uid } if (!uid && groupCode) { - const members = await this.ctx.ntGroupApi.getGroupMembers(groupCode) - uid = Array.from(members.values()).find(e => e.uin === uin)?.uid + let member = await this.ctx.ntGroupApi.searchMember(groupCode, uin) + if (member.size === 0) { + await this.ctx.ntGroupApi.getGroupMembers(groupCode, 1) + await this.ctx.sleep(30) + member = await this.ctx.ntGroupApi.searchMember(groupCode, uin) + } + uid = member.values().find(e => e.uin === uin)?.uid + } + if (!uid) { + const unveifyUid = (await this.getUserDetailInfoByUin(uin)).info.uid + if (!unveifyUid.includes('*')) { + uid = unveifyUid + } } return uid } diff --git a/src/ntqqapi/services/NodeIKernelGroupService.ts b/src/ntqqapi/services/NodeIKernelGroupService.ts index cf37bd9..f2a1aa6 100644 --- a/src/ntqqapi/services/NodeIKernelGroupService.ts +++ b/src/ntqqapi/services/NodeIKernelGroupService.ts @@ -125,4 +125,6 @@ export interface NodeIKernelGroupService { removeGroupEssence(param: { groupCode: string, msgRandom: number, msgSeq: number }): Promise setHeader(args: unknown[]): Promise + + searchMember(sceneId: string, keyword: string): Promise } diff --git a/src/onebot11/helper/createMessage.ts b/src/onebot11/helper/createMessage.ts index af5719d..39ae1a2 100644 --- a/src/onebot11/helper/createMessage.ts +++ b/src/onebot11/helper/createMessage.ts @@ -66,15 +66,10 @@ export async function createSendElements( } } else if (peer.chatType === ChatType.Group) { - const uid = await ctx.ntUserApi.getUidByUin(atQQ) ?? '' + const uid = await ctx.ntUserApi.getUidByUin(atQQ, peer.peerUid) ?? '' let display = '' if (sendMsg.data.name) { display = `@${sendMsg.data.name}` - } else { - try { - const member = await ctx.ntGroupApi.getGroupMember(peer.peerUid, uid) - display = `@${member.cardName || member.nick}` - } catch { } } sendElements.push(SendElement.at(atQQ, uid, AtType.One, display)) } diff --git a/src/satori/message.ts b/src/satori/message.ts index 3474fb0..2d67b85 100644 --- a/src/satori/message.ts +++ b/src/satori/message.ts @@ -175,10 +175,14 @@ export class MessageEncoder { if (type === 'text') { this.elements.push(SendElement.text(attrs.content)) } else if (type === 'at') { + this.peer ??= await getPeer(this.ctx, this.channelId) + if (this.peer.chatType !== NT.ChatType.Group) { + return + } if (attrs.type === 'all') { this.elements.push(SendElement.at('', '', NT.AtType.All, '@全体成员')) } else { - const uid = await this.ctx.ntUserApi.getUidByUin(attrs.id) ?? '' + const uid = await this.ctx.ntUserApi.getUidByUin(attrs.id, this.peer.peerUid) ?? '' const display = attrs.name ? '@' + attrs.name : '' this.elements.push(SendElement.at(attrs.id, uid, NT.AtType.One, display)) } From abb468c3f827579f3706b41682817ee679aa10f4 Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:38:59 +0800 Subject: [PATCH 2/5] optimize --- src/common/utils/audio.ts | 77 ++++++++++++++++++--------------------- src/ntqqapi/entities.ts | 6 +-- src/onebot11/adapter.ts | 6 +-- 3 files changed, 40 insertions(+), 49 deletions(-) diff --git a/src/common/utils/audio.ts b/src/common/utils/audio.ts index fce6ad0..e98ab7d 100644 --- a/src/common/utils/audio.ts +++ b/src/common/utils/audio.ts @@ -53,49 +53,44 @@ function convert(ctx: Context, input: Input, options: FFmpegOptions, outputPath? } export async function encodeSilk(ctx: Context, filePath: string) { - try { - const file = await fsPromise.readFile(filePath) - if (!isSilk(file)) { - ctx.logger.info(`语音文件${filePath}需要转换成silk`) - let result: EncodeResult - const allowSampleRate = [8000, 12000, 16000, 24000, 32000, 44100, 48000] - if (isWav(file) && allowSampleRate.includes(getWavFileInfo(file).fmt.sampleRate)) { - result = await encode(file, 0) - } else { - const input = await convert(ctx, filePath, { - output: [ - '-ar 24000', - '-ac 1', - '-f s16le' - ] - }) - result = await encode(input, 24000) - } - const pttPath = path.join(TEMP_DIR, randomUUID()) - await fsPromise.writeFile(pttPath, result.data) - ctx.logger.info(`语音文件${filePath}转换成功!`, pttPath, `时长:`, result.duration) - return { - converted: true, - path: pttPath, - duration: result.duration / 1000, - } + const file = await fsPromise.readFile(filePath) + if (!isSilk(file)) { + ctx.logger.info(`语音文件${filePath}需要转换成silk`) + let result: EncodeResult + const allowSampleRate = [8000, 12000, 16000, 24000, 32000, 44100, 48000] + if (isWav(file) && allowSampleRate.includes(getWavFileInfo(file).fmt.sampleRate)) { + result = await encode(file, 0) } else { - const silk = file - let duration = 1 - try { - duration = getDuration(silk) / 1000 - } catch (e) { - ctx.logger.warn('获取语音文件时长失败, 默认为1秒', filePath, (e as Error).stack) - } - return { - converted: false, - path: filePath, - duration, - } + const input = await convert(ctx, filePath, { + output: [ + '-ar 24000', + '-ac 1', + '-f s16le' + ] + }) + result = await encode(input, 24000) + } + const pttPath = path.join(TEMP_DIR, randomUUID()) + await fsPromise.writeFile(pttPath, result.data) + ctx.logger.info(`语音文件${filePath}转换成功!`, pttPath, `时长:`, result.duration) + return { + converted: true, + path: pttPath, + duration: result.duration / 1000, + } + } else { + const silk = file + let duration = 1 + try { + duration = getDuration(silk) / 1000 + } catch (e) { + ctx.logger.warn('获取语音文件时长失败, 默认为1秒', filePath, (e as Error).stack) + } + return { + converted: false, + path: filePath, + duration, } - } catch (err) { - ctx.logger.error('convert silk failed', (err as Error).stack) - return {} } } diff --git a/src/ntqqapi/entities.ts b/src/ntqqapi/entities.ts index 0ec2bd2..e5e3b99 100644 --- a/src/ntqqapi/entities.ts +++ b/src/ntqqapi/entities.ts @@ -210,13 +210,9 @@ export namespace SendElement { export async function ptt(ctx: Context, pttPath: string): Promise { const { converted, path: silkPath, duration } = await encodeSilk(ctx, pttPath) - if (!silkPath) { - throw '语音转换失败, 请检查语音文件是否正常' - } - // log("生成语音", silkPath, duration); const { md5, fileName, path, fileSize } = await ctx.ntFileApi.uploadFile(silkPath, ElementType.Ptt) if (fileSize === 0) { - throw '文件异常,大小为0' + throw new Error('文件异常,大小为 0') } if (converted) { unlink(silkPath) diff --git a/src/onebot11/adapter.ts b/src/onebot11/adapter.ts index ee3a61a..d34c2f3 100644 --- a/src/onebot11/adapter.ts +++ b/src/onebot11/adapter.ts @@ -180,19 +180,19 @@ class OneBot11Adapter extends Service { msg.target_id = parseInt(message.peerUin) } this.dispatch(msg) - }).catch(e => this.ctx.logger.error('constructMessage error: ', e.stack.toString())) + }).catch(e => this.ctx.logger.error('handling incoming messages', e)) OB11Entities.groupEvent(this.ctx, message).then(groupEvent => { if (groupEvent) { this.dispatch(groupEvent) } - }) + }).catch(e => this.ctx.logger.error('handling incoming group events', e)) OB11Entities.privateEvent(this.ctx, message).then(privateEvent => { if (privateEvent) { this.dispatch(privateEvent) } - }) + }).catch(e => this.ctx.logger.error('handling incoming buddy events', e)) } private handleRecallMsg(message: RawMessage) { From ba565e7c38a43836a09b74a315cadf2fba7352e7 Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:42:19 +0800 Subject: [PATCH 3/5] feat(onebot): `ocr_image` API --- src/ntqqapi/api/file.ts | 10 +++ src/ntqqapi/ntcall.ts | 4 +- .../services/NodeIKernelNodeMiscService.ts | 15 +++++ src/ntqqapi/services/index.ts | 1 + src/onebot11/action/go-cqhttp/OCRImage.ts | 63 +++++++++++++++++++ src/onebot11/action/index.ts | 2 + src/onebot11/action/types.ts | 1 + 7 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 src/ntqqapi/services/NodeIKernelNodeMiscService.ts create mode 100644 src/onebot11/action/go-cqhttp/OCRImage.ts diff --git a/src/ntqqapi/api/file.ts b/src/ntqqapi/api/file.ts index 26c9a55..1dd3cfc 100644 --- a/src/ntqqapi/api/file.ts +++ b/src/ntqqapi/api/file.ts @@ -201,6 +201,16 @@ export class NTQQFileApi extends Service { ) return data.notifyInfo.filePath } + + async ocrImage(path: string) { + return await invoke( + 'nodeIKernelNodeMiscService/wantWinScreenOCR', + [ + { url: path }, + { timeout: 5000 } + ] + ) + } } export class NTQQFileCacheApi extends Service { diff --git a/src/ntqqapi/ntcall.ts b/src/ntqqapi/ntcall.ts index 85add45..fc92890 100644 --- a/src/ntqqapi/ntcall.ts +++ b/src/ntqqapi/ntcall.ts @@ -14,7 +14,8 @@ import { NodeIKernelRichMediaService, NodeIKernelTicketService, NodeIKernelTipOffService, - NodeIKernelRobotService + NodeIKernelRobotService, + NodeIKernelNodeMiscService } from './services' export enum NTClass { @@ -94,6 +95,7 @@ interface NTService { nodeIKernelTicketService: NodeIKernelTicketService nodeIKernelTipOffService: NodeIKernelTipOffService nodeIKernelRobotService: NodeIKernelRobotService + nodeIKernelNodeMiscService: NodeIKernelNodeMiscService } interface InvokeOptions { diff --git a/src/ntqqapi/services/NodeIKernelNodeMiscService.ts b/src/ntqqapi/services/NodeIKernelNodeMiscService.ts new file mode 100644 index 0000000..3c2fe1f --- /dev/null +++ b/src/ntqqapi/services/NodeIKernelNodeMiscService.ts @@ -0,0 +1,15 @@ +export interface NodeIKernelNodeMiscService { + wantWinScreenOCR(...args: unknown[]): Promise<{ + code: number + errMsg: string + result: { + text: string + [key: `pt${number}`]: { + x: string + y: string + } + charBox: unknown[] + score: '' + }[] + }> +} diff --git a/src/ntqqapi/services/index.ts b/src/ntqqapi/services/index.ts index f233136..ad659ba 100644 --- a/src/ntqqapi/services/index.ts +++ b/src/ntqqapi/services/index.ts @@ -10,3 +10,4 @@ export * from './NodeIKernelRichMediaService' export * from './NodeIKernelTicketService' export * from './NodeIKernelTipOffService' export * from './NodeIKernelRobotService' +export * from './NodeIKernelNodeMiscService' diff --git a/src/onebot11/action/go-cqhttp/OCRImage.ts b/src/onebot11/action/go-cqhttp/OCRImage.ts new file mode 100644 index 0000000..5a09d1a --- /dev/null +++ b/src/onebot11/action/go-cqhttp/OCRImage.ts @@ -0,0 +1,63 @@ +import { BaseAction, Schema } from '../BaseAction' +import { ActionName } from '../types' +import { uri2local } from '@/common/utils/file' +import { access, unlink } from 'node:fs/promises' + +interface Payload { + image: string +} + +interface TextDetection { + text: string + confidence: number + coordinates: { + x: number //int32 + y: number + }[] +} + +interface Response { + texts: TextDetection[] + language: string +} + +export class OCRImage extends BaseAction { + actionName = ActionName.GoCQHTTP_OCRImage + payloadSchema = Schema.object({ + image: Schema.string().required() + }) + + protected async _handle(payload: Payload) { + const { errMsg, isLocal, path, success } = await uri2local(this.ctx, payload.image, true) + if (!success) { + throw new Error(errMsg) + } + await access(path) + + const data = await this.ctx.ntFileApi.ocrImage(path) + if (!isLocal) { + unlink(path) + } + + const texts = data.result.map(item => { + const ret: TextDetection = { + text: item.text, + confidence: 1, + coordinates: [] + } + for (let i = 0; i < 4; i++) { + const pt = item[`pt${i + 1}`] + ret.coordinates.push({ + x: parseInt(pt.x), + y: parseInt(pt.y) + }) + } + return ret + }) + + return { + texts, + language: '' + } + } +} diff --git a/src/onebot11/action/index.ts b/src/onebot11/action/index.ts index 4558006..e94beca 100644 --- a/src/onebot11/action/index.ts +++ b/src/onebot11/action/index.ts @@ -73,6 +73,7 @@ import { GetGroupFileUrl } from './go-cqhttp/GetGroupFileUrl' import { GetGroupNotice } from './go-cqhttp/GetGroupNotice' import { GetRobotUinRange } from './llonebot/GetRobotUinRange' import { DeleteFriend } from './go-cqhttp/DeleteFriend' +import { OCRImage } from './go-cqhttp/OCRImage' export function initActionMap(adapter: Adapter) { const actionHandlers = [ @@ -151,6 +152,7 @@ export function initActionMap(adapter: Adapter) { new GetGroupFileUrl(adapter), new GetGroupNotice(adapter), new DeleteFriend(adapter), + new OCRImage(adapter), ] const actionMap = new Map>() for (const action of actionHandlers) { diff --git a/src/onebot11/action/types.ts b/src/onebot11/action/types.ts index de10996..513f28d 100644 --- a/src/onebot11/action/types.ts +++ b/src/onebot11/action/types.ts @@ -86,4 +86,5 @@ export enum ActionName { GoCQHTTP_GetGroupFileUrl = 'get_group_file_url', GoCQHTTP_GetGroupNotice = '_get_group_notice', GoCQHTTP_DeleteFriend = 'delete_friend', + GoCQHTTP_OCRImage = 'ocr_image', } From 0081b0b124d92133372bbdb6d2464c8acea8950c Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:17:52 +0800 Subject: [PATCH 4/5] refactor --- package.json | 4 ++-- src/common/config.ts | 9 +++++---- src/common/types.ts | 4 +++- src/main/main.ts | 1 - src/ntqqapi/core.ts | 3 --- src/onebot11/adapter.ts | 8 +++----- src/renderer/index.ts | 2 +- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 2fded7f..28b726d 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "cordis": "^3.18.1", "cors": "^2.8.5", "cosmokit": "^1.6.3", - "express": "^5.0.0", + "express": "^5.0.1", "fast-xml-parser": "^4.5.0", "fluent-ffmpeg": "^2.1.3", "minato": "^3.6.0", @@ -42,7 +42,7 @@ "electron": "^31.4.0", "electron-vite": "^2.3.0", "protobufjs-cli": "^1.1.3", - "typescript": "^5.6.2", + "typescript": "^5.6.3", "vite": "^5.4.8", "vite-plugin-cp": "^4.0.8" }, diff --git a/src/common/config.ts b/src/common/config.ts index c764361..78749de 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -34,7 +34,8 @@ export class ConfigUtil { enableWsReverse: false, messagePostFormat: 'array', enableHttpHeart: false, - listenLocalhost: false + listenLocalhost: false, + reportSelfMessage: false } const satoriDefault: SatoriConfig = { enable: true, @@ -50,7 +51,6 @@ export class ConfigUtil { enableLocalFile2Url: false, debug: false, log: false, - reportSelfMessage: false, autoDeleteFile: false, autoDeleteFileSecond: 60, musicSignUrl: '', @@ -73,6 +73,7 @@ export class ConfigUtil { this.checkOldConfig(jsonData.ob11, jsonData, 'httpPort', 'http') this.checkOldConfig(jsonData.ob11, jsonData, 'httpHosts', 'hosts') this.checkOldConfig(jsonData.ob11, jsonData, 'wsPort', 'wsPort') + this.checkOldConfig(jsonData.ob11, jsonData, 'reportSelfMessage', 'reportSelfMessage') this.config = jsonData return this.config } @@ -86,8 +87,8 @@ export class ConfigUtil { private checkOldConfig( currentConfig: OB11Config, oldConfig: Config, - currentKey: 'httpPort' | 'httpHosts' | 'wsPort', - oldKey: 'http' | 'hosts' | 'wsPort', + currentKey: 'httpPort' | 'httpHosts' | 'wsPort' | 'reportSelfMessage', + oldKey: 'http' | 'hosts' | 'wsPort' | 'reportSelfMessage', ) { // 迁移旧的配置到新配置,避免用户重新填写配置 const oldValue = oldConfig[oldKey] diff --git a/src/common/types.ts b/src/common/types.ts index f586fba..14d780e 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -17,6 +17,7 @@ export interface OB11Config { */ enableQOAutoQuote?: boolean listenLocalhost: boolean + reportSelfMessage: boolean } export interface SatoriConfig { @@ -33,7 +34,6 @@ export interface Config { heartInterval: number // ms enableLocalFile2Url?: boolean // 开启后,本地文件路径图片会转成http链接, 语音会转成base64 debug?: boolean - reportSelfMessage?: boolean log?: boolean autoDeleteFile?: boolean autoDeleteFileSecond?: number @@ -50,6 +50,8 @@ export interface Config { wsPort?: string /** @deprecated */ enableLLOB?: boolean + /** @deprecated */ + reportSelfMessage?: boolean } export interface CheckVersion { diff --git a/src/main/main.ts b/src/main/main.ts index 4f79498..3166402 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -183,7 +183,6 @@ function onLoad() { heartInterval: config.heartInterval, token: config.token!, debug: config.debug!, - reportSelfMessage: config.reportSelfMessage!, musicSignUrl: config.musicSignUrl, enableLocalFile2Url: config.enableLocalFile2Url!, ffmpeg: config.ffmpeg, diff --git a/src/ntqqapi/core.ts b/src/ntqqapi/core.ts index 2e78049..b289e3b 100644 --- a/src/ntqqapi/core.ts +++ b/src/ntqqapi/core.ts @@ -205,9 +205,6 @@ class Core extends Service { }) registerReceiveHook<{ msgRecord: RawMessage }>(ReceiveCmdS.SELF_SEND_MSG, payload => { - if (!this.config.reportSelfMessage) { - return - } sentMsgIds.set(payload.msgRecord.msgId, true) }) diff --git a/src/onebot11/adapter.ts b/src/onebot11/adapter.ts index d34c2f3..e6f5efd 100644 --- a/src/onebot11/adapter.ts +++ b/src/onebot11/adapter.ts @@ -173,9 +173,6 @@ class OneBot11Adapter extends Service { return } const isSelfMsg = msg.user_id.toString() === selfInfo.uin - if (isSelfMsg && !this.config.reportSelfMessage) { - return - } if (isSelfMsg) { msg.target_id = parseInt(message.peerUin) } @@ -310,7 +307,6 @@ class OneBot11Adapter extends Service { heartInterval: config.heartInterval, token: config.token, debug: config.debug, - reportSelfMessage: config.reportSelfMessage, msgCacheExpire: config.msgCacheExpire, musicSignUrl: config.musicSignUrl, enableLocalFile2Url: config.enableLocalFile2Url, @@ -341,6 +337,9 @@ class OneBot11Adapter extends Service { this.handleRecallMsg(input) }) this.ctx.on('nt/message-sent', input => { + if (!this.config.reportSelfMessage) { + return + } this.handleMsg(input) }) this.ctx.on('nt/group-notify', input => { @@ -370,7 +369,6 @@ namespace OneBot11Adapter { heartInterval: number token: string debug: boolean - reportSelfMessage: boolean musicSignUrl?: string enableLocalFile2Url: boolean ffmpeg?: string diff --git a/src/renderer/index.ts b/src/renderer/index.ts index 7eecf45..b766bb1 100644 --- a/src/renderer/index.ts +++ b/src/renderer/index.ts @@ -171,7 +171,7 @@ async function onSettingWindowCreated(view: Element) { SettingItem( '上报 Bot 自身发送的消息', '上报 event 为 message_sent', - SettingSwitch('reportSelfMessage', config.reportSelfMessage), + SettingSwitch('ob11.reportSelfMessage', config.ob11.reportSelfMessage), ), SettingItem( '使用 Base64 编码获取文件', From 1cfa736dd5f9a3e42976331399e9abc8d9cfeeb3 Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:18:51 +0800 Subject: [PATCH 5/5] chore: bump versions --- manifest.json | 2 +- src/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index afaa89e..4fc0347 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "LLOneBot", "slug": "LLOneBot", "description": "实现 OneBot 11 和 Satori 协议,用于 QQ 机器人开发", - "version": "4.0.3", + "version": "4.0.4", "icon": "./icon.webp", "authors": [ { diff --git a/src/version.ts b/src/version.ts index c410f93..6890c24 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '4.0.3' +export const version = '4.0.4'