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.
This commit is contained in:
手瓜一十雪 2025-11-01 22:49:21 +08:00
parent 3dd56c711e
commit 28ce5d3cb4
2 changed files with 12 additions and 4 deletions

View File

@ -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
}
},
};
}

View File

@ -311,6 +311,10 @@ export interface PttElement {
voiceType: number;
waveAmplitudes: number[];
autoConvertText: number;
storeID: number;
otherBusinessInfo: {
aiVoiceType: number;
};
}
export type SendRecommendedMsgElement = SendElementBase<ElementType.RECOMMENDEDMSG> & ElementBase<'recommendedMsgElement'>;
@ -349,7 +353,7 @@ export type SendPicElement = SendElementBase<ElementType.PIC> & ElementBase<'pic
export type SendPttElement = SendElementBase<ElementType.PTT> & 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<ElementType.FILE> & ElementBase<'fileElement'>;