fix: 初始化问题
This commit is contained in:
1 parent
673fb4e008
commit
998e615272
4 files changed
+11
-12
No files matched your search
@@ -10,6 +10,7 @@ import { ActionName, BaseCheckResult } from '@/onebot11/action/types';
|
||||
import { getGroup } from '@/core/data';
|
||||
import { ChatType, ElementType, Group, NTQQFileApi, NTQQFriendApi, NTQQMsgApi, NTQQUserApi, Peer, SendMessageElement, } from '@/core';
|
||||
import fs from 'node:fs';
|
||||
import fsPromise from 'node:fs/promises';
|
||||
import { logDebug, logError } from '@/common/utils/log';
|
||||
import { decodeCQCode } from '@/onebot11/cqcode';
|
||||
import createSendElements from './create-send-elements';
|
||||
@@ -71,14 +72,7 @@ export async function sendMsg(peer: Peer, sendElements: SendMessageElement[], de
|
||||
logDebug('发送消息id获取失败', e);
|
||||
returnMsg!.id = 0;
|
||||
}
|
||||
|
||||
deleteAfterSentFiles.map((f) => {
|
||||
try {
|
||||
fs.unlinkSync(f);
|
||||
} catch (e) {
|
||||
logError('发送消息删除文件失败', e);
|
||||
}
|
||||
});
|
||||
deleteAfterSentFiles.map((f) => { fsPromise.unlink(f).then().catch(e => logError('发送消息删除文件失败', e)); });
|
||||
return returnMsg;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ export default class GetFriendList extends BaseAction<Payload, OB11User[]> {
|
||||
actionName = ActionName.GetFriendList;
|
||||
PayloadSchema = SchemaData;
|
||||
protected async _handle(payload: Payload) {
|
||||
let data = await NTQQFriendApi.getBuddyV2(payload?.no_cache === true || payload?.no_cache=== 'true');
|
||||
if (friends.size === 0 || payload?.no_cache === true || payload?.no_cache === 'true') {
|
||||
const _friends = await NTQQFriendApi.getFriends(true);
|
||||
// log('强制刷新好友列表,结果: ', _friends)
|
||||
|
||||
Reference in new issue
Block a user