From 1ac1af9e32ea5c58cb3723674c575f2fe784adb4 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 11 May 2025 13:29:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8Dlgr=E7=9A=84=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fanqie.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/fanqie.js b/apps/fanqie.js index 97f632e..c2d95a7 100644 --- a/apps/fanqie.js +++ b/apps/fanqie.js @@ -207,7 +207,7 @@ export class xzq extends plugin { e.reply('下载超时', true); return true; } - ok = await this.upload(e, file); + ok = await this.upload(e, file, book_info); if (!ok) { this.clearCache(false, true, String(e.message_id)); e.reply('上传失败', true); @@ -219,14 +219,22 @@ export class xzq extends plugin { true ); } - async upload(e, filePath) { + async upload(e, filePath, bookInfo) { try { let res; if (e.isGroup) { - if (e.group.sendFile) res = await e.group.sendFile(filePath); - else if (e.group.fs && e.group.fs.upload) res = await e.group.fs.upload(filePath); - } else if (e.friend && e.friend.sendFile) { - res = await e.friend.sendFile(filePath); + res = e.bot.sendApi('upload_group_file', { + group_id: e.group_id, + file: filePath, + name: bookInfo.book_name, + folder: 'fanqie', + }); + } else if (e.friend) { + res = e.bot.sendApi('upload_private_file', { + user_id: e.user_id, + file: filePath, + name: bookInfo.book_name, + }); } if (res) { return true;