mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-27 19:31:22 +08:00
feat: download_file 支持 file://
This commit is contained in:
parent
9525786929
commit
89e7712676
@ -30,6 +30,9 @@ export default class GoCQHTTPDownloadFile extends OneBotAction<Payload, FileResp
|
||||
|
||||
if (payload.base64) {
|
||||
fs.writeFileSync(filePath, payload.base64, 'base64');
|
||||
} else if (payload.url?.startsWith('file://')) {
|
||||
const path = payload.url.substring(7);
|
||||
fs.copyFileSync(path, filePath);
|
||||
} else if (payload.url) {
|
||||
const headers = this.getHeaders(payload.headers);
|
||||
const buffer = await httpDownload({ url: payload.url, headers: headers });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user