This commit is contained in:
Jerry 2025-05-16 23:43:27 +08:00
parent bf18ee4794
commit e111d3ab5e

View File

@ -204,7 +204,6 @@ export class xzq extends plugin {
async upload(e, filePath) { async upload(e, filePath) {
// TODO 修好这发文件的bug // TODO 修好这发文件的bug
try { try {
/*
let res; let res;
if (e.isGroup) { if (e.isGroup) {
res = e.bot.sendApi('upload_group_file', { res = e.bot.sendApi('upload_group_file', {
@ -220,7 +219,8 @@ export class xzq extends plugin {
name: path.basename(filePath), name: path.basename(filePath),
}); });
} }
return !!res; return res;
/*
//另外一种解决方法 //另外一种解决方法
const form = new FormData(); const form = new FormData();
if (!fs.existsSync(filePath)) { if (!fs.existsSync(filePath)) {
@ -246,7 +246,7 @@ export class xzq extends plugin {
const message = response.data?.message; const message = response.data?.message;
return { url, message }; return { url, message };
}*/ }*/
return null; //return null;
} catch (err) { } catch (err) {
logger.error(`文件上传错误:${logger.red(err.stack)}`); logger.error(`文件上传错误:${logger.red(err.stack)}`);
e.reply(`文件上传失败:${err.message}`, true); e.reply(`文件上传失败:${err.message}`, true);