From 28ce5d3cb4c656fa973edfaae0e5682a314d7c96 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: Sat, 1 Nov 2025 22:49:21 +0800 Subject: [PATCH] Add storeID and otherBusinessInfo to PttElement Extended the PttElement interface and related code to include storeID and otherBusinessInfo fields, supporting additional metadata for PTT elements. Also fixed minor formatting issues in function parameter spacing. --- src/core/apis/file.ts | 10 +++++++--- src/core/types/element.ts | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/core/apis/file.ts b/src/core/apis/file.ts index 48b650ae..bef08563 100644 --- a/src/core/apis/file.ts +++ b/src/core/apis/file.ts @@ -64,7 +64,7 @@ export class NTQQFileApi { } } - async getFileUrl(chatType: ChatType, peer: string, fileUUID?: string, file10MMd5?: string | undefined,timeout: number = 5000) { + async getFileUrl(chatType: ChatType, peer: string, fileUUID?: string, file10MMd5?: string | undefined, timeout: number = 5000) { if (this.core.apis.PacketApi.packetStatus) { try { if (chatType === ChatType.KCHATTYPEGROUP && fileUUID) { @@ -79,7 +79,7 @@ export class NTQQFileApi { throw new Error('fileUUID or file10MMd5 is undefined'); } - async getPttUrl(peer: string, fileUUID?: string,timeout: number = 5000) { + async getPttUrl(peer: string, fileUUID?: string, timeout: number = 5000) { if (this.core.apis.PacketApi.packetStatus && fileUUID) { let appid = new NapProtoMsg(FileId).decode(Buffer.from(fileUUID.replaceAll('-', '+').replaceAll('_', '/'), 'base64')).appid; try { @@ -107,7 +107,7 @@ export class NTQQFileApi { throw new Error('packet cant get ptt url'); } - async getVideoUrlPacket(peer: string, fileUUID?: string,timeout: number = 5000) { + async getVideoUrlPacket(peer: string, fileUUID?: string, timeout: number = 5000) { if (this.core.apis.PacketApi.packetStatus && fileUUID) { let appid = new NapProtoMsg(FileId).decode(Buffer.from(fileUUID.replaceAll('-', '+').replaceAll('_', '/'), 'base64')).appid; try { @@ -333,6 +333,10 @@ export class NTQQFileApi { fileSubId: '', playState: 1, autoConvertText: 0, + storeID: 0, + otherBusinessInfo: { + aiVoiceType: 0 + } }, }; } diff --git a/src/core/types/element.ts b/src/core/types/element.ts index 00d94b78..c0542d80 100644 --- a/src/core/types/element.ts +++ b/src/core/types/element.ts @@ -311,6 +311,10 @@ export interface PttElement { voiceType: number; waveAmplitudes: number[]; autoConvertText: number; + storeID: number; + otherBusinessInfo: { + aiVoiceType: number; + }; } export type SendRecommendedMsgElement = SendElementBase & ElementBase<'recommendedMsgElement'>; @@ -349,7 +353,7 @@ export type SendPicElement = SendElementBase & ElementBase<'pic export type SendPttElement = SendElementBase & ElementBase<'pttElement', { pttElement: ['fileName', 'filePath', 'md5HexStr', 'fileSize', 'duration', 'formatType', 'voiceType', - 'voiceChangeType', 'canConvert2Text', 'waveAmplitudes', 'fileSubId', 'playState', 'autoConvertText'] + 'voiceChangeType', 'canConvert2Text', 'waveAmplitudes', 'fileSubId', 'playState', 'autoConvertText', 'storeID', 'otherBusinessInfo'] }>; export type SendFileElement = SendElementBase & ElementBase<'fileElement'>;