mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-07-04 14:19:19 +00:00
修
This commit is contained in:
parent
bf18ee4794
commit
e111d3ab5e
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user