Reapply "Add image download proxy support to OneBot"

This reverts commit 38c320d2c9.
This commit is contained in:
手瓜一十雪 committed 2026-01-29 20:40:19 +08:00
1 parent 38c320d2c9
commit 4bec3aa597
9 files changed
+119 -64

No files matched your search

+2 -1
View File
@@ -1288,7 +1288,8 @@ export class OneBotMsgApi {
}
realUri = await this.handleObfuckName(realUri) ?? realUri;
try {
const { path, fileName, errMsg, success } = await uriToLocalFile(this.core.NapCatTempPath, realUri);
const proxy = this.obContext.configLoader.configData.imageDownloadProxy || undefined;
const { path, fileName, errMsg, success } = await uriToLocalFile(this.core.NapCatTempPath, realUri, undefined, undefined, proxy);
if (!success) {
this.core.context.logger.logError('文件处理失败', errMsg);
throw new Error('文件处理失败: ' + errMsg);