fix: 调整逻辑

This commit is contained in:
手瓜一十雪 2024-09-26 15:37:07 +08:00
parent ea9e88a18a
commit 7d709f44a8

View File

@ -235,8 +235,16 @@ export class OneBotMsgApi {
let videoUrlWrappers: Awaited<ReturnType<typeof this.core.apis.FileApi.getVideoUrl>> | undefined; let videoUrlWrappers: Awaited<ReturnType<typeof this.core.apis.FileApi.getVideoUrl>> | undefined;
if (msg.peerUin === '284840486' || msg.peerUin === '1094950020') { if (msg.peerUin === '284840486' || msg.peerUin === '1094950020') {
//TODO: 合并消息内部 应该进行特殊处理 可能需要重写peer 待测试与研究 Mlikiowa Tagged try {
videoUrlWrappers = await this.core.apis.FileApi.getVideoUrl({
chatType: msg.chatType,
peerUid: msg.peerUid,
guildId: '0',
}, msg.parentMsgIdList[0] ?? msg.msgId, elementWrapper.elementId);
} catch (error) {
this.core.context.logger.logWarn('合并获取视频 URL 失败');
} }
} else {
try { try {
videoUrlWrappers = await this.core.apis.FileApi.getVideoUrl({ videoUrlWrappers = await this.core.apis.FileApi.getVideoUrl({
chatType: msg.chatType, chatType: msg.chatType,
@ -246,6 +254,8 @@ export class OneBotMsgApi {
} catch (error) { } catch (error) {
this.core.context.logger.logWarn('获取视频 URL 失败'); this.core.context.logger.logWarn('获取视频 URL 失败');
} }
}
//读取在线URL //读取在线URL
let videoDownUrl: string | undefined; let videoDownUrl: string | undefined;