修复bug

This commit is contained in:
Jerry 2025-05-11 13:47:23 +08:00
parent d4b32c763a
commit caad8d152e

View File

@ -175,9 +175,9 @@ export class xzq extends plugin {
true true
); );
if (!e.isMaster) { if (!e.isMaster) {
if ( const groupAllow = e.isGroup ? await redis.get(`fqxzq:g:${e.group_id}`) : null;
!(e.isGroup && redis.get(`fqxzq:g:${e.group_id})` || !redis.get(`fqxzq:u:${e.user_id}`))) const userAllow = await redis.get(`fqxzq:u:${e.user_id}`);
) { if (!groupAllow && !userAllow) {
return false; return false;
} }
} }
@ -223,14 +223,14 @@ export class xzq extends plugin {
try { try {
let res; let res;
if (e.isGroup) { if (e.isGroup) {
res = await e.bot.sendApi('upload_group_file', { res = this.e.bot.sendApi('upload_group_file', {
group_id: e.group_id, group_id: e.group_id,
file: filePath, file: filePath,
name: bookInfo.book_name, name: bookInfo.book_name,
folder: 'fanqie', folder: 'fanqie',
}); });
} else if (e.friend) { } else if (e.friend) {
res = await e.bot.sendApi('upload_private_file', { res = e.bot.sendApi('upload_private_file', {
user_id: e.user_id, user_id: e.user_id,
file: filePath, file: filePath,
name: bookInfo.book_name, name: bookInfo.book_name,