fix: 调整逻辑

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

View File

@ -235,18 +235,28 @@ 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({
try { chatType: msg.chatType,
videoUrlWrappers = await this.core.apis.FileApi.getVideoUrl({ peerUid: msg.peerUid,
chatType: msg.chatType, guildId: '0',
peerUid: msg.peerUid, }, msg.parentMsgIdList[0] ?? msg.msgId, elementWrapper.elementId);
guildId: '0', } catch (error) {
}, msg.msgId, elementWrapper.elementId); this.core.context.logger.logWarn('合并获取视频 URL 失败');
} catch (error) { }
this.core.context.logger.logWarn('获取视频 URL 失败'); } else {
try {
videoUrlWrappers = await this.core.apis.FileApi.getVideoUrl({
chatType: msg.chatType,
peerUid: msg.peerUid,
guildId: '0',
}, msg.msgId, elementWrapper.elementId);
} catch (error) {
this.core.context.logger.logWarn('获取视频 URL 失败');
}
} }
//读取在线URL //读取在线URL
let videoDownUrl: string | undefined; let videoDownUrl: string | undefined;