style: 代码质量提高

This commit is contained in:
手瓜一十雪 2024-08-26 00:05:33 +08:00
parent c64367335c
commit ab955e41fb
2 changed files with 31 additions and 33 deletions

View File

@ -271,7 +271,7 @@ export class NTQQFileApi {
md5HexStr: md5,
fileSize: fileSize,
// duration: Math.max(1, Math.round(fileSize / 1024 / 3)), // 一秒钟大概是3kb大小, 小于1秒的按1秒算
duration: duration || 1,
duration: duration ?? 1,
formatType: 1,
voiceType: 1,
voiceChangeType: 0,

View File

@ -238,9 +238,7 @@ export class SendMsg extends BaseAction<OB11PostSendMsg, ReturnDataType> {
const AllElement: SendMessageElement[][] = [MixElement, ...SingleElement].filter(e => e !== undefined && e.length !== 0);
const MsgNodeList: Promise<RawMessage | undefined>[] = [];
for (const sendElementsSplitElement of AllElement) {
MsgNodeList.push(sendMsg(this.CoreContext, selfPeer, sendElementsSplitElement, [], true).catch(_ => new Promise((resolve) => {
resolve(undefined);
})));
MsgNodeList.push(sendMsg(this.CoreContext, selfPeer, sendElementsSplitElement, [], true).catch(_ => undefined));
}
(await Promise.allSettled(MsgNodeList)).map((result) => {
if (result.status === 'fulfilled' && result.value) {
@ -301,7 +299,7 @@ export class SendMsg extends BaseAction<OB11PostSendMsg, ReturnDataType> {
};
const logger = this.CoreContext.context.logger;
const NTQQMsgApi = this.CoreContext.apis.MsgApi;
//logDebug('克隆的目标消息', msg);
//msg 为待克隆消息
const sendElements: SendMessageElement[] = [];