mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
feat: Add scanCache
to NTQQApi
This commit is contained in:
parent
afe0ff89a7
commit
f521873ba7
@ -24,7 +24,8 @@ export enum ReceiveCmd {
|
|||||||
MEDIA_DOWNLOAD_COMPLETE = "nodeIKernelMsgListener/onRichMediaDownloadComplete",
|
MEDIA_DOWNLOAD_COMPLETE = "nodeIKernelMsgListener/onRichMediaDownloadComplete",
|
||||||
UNREAD_GROUP_NOTIFY = "nodeIKernelGroupListener/onGroupNotifiesUnreadCountUpdated",
|
UNREAD_GROUP_NOTIFY = "nodeIKernelGroupListener/onGroupNotifiesUnreadCountUpdated",
|
||||||
GROUP_NOTIFY = "nodeIKernelGroupListener/onGroupSingleScreenNotifies",
|
GROUP_NOTIFY = "nodeIKernelGroupListener/onGroupSingleScreenNotifies",
|
||||||
FRIEND_REQUEST = "nodeIKernelBuddyListener/onBuddyReqChange"
|
FRIEND_REQUEST = "nodeIKernelBuddyListener/onBuddyReqChange",
|
||||||
|
CACHE_SCAN_FINISH = "nodeIKernelStorageCleanListener/onFinishScan",
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NTQQApiReturnData<PayloadType = unknown> extends Array<any> {
|
interface NTQQApiReturnData<PayloadType = unknown> extends Array<any> {
|
||||||
|
@ -16,6 +16,7 @@ import {
|
|||||||
SelfInfo,
|
SelfInfo,
|
||||||
SendMessageElement,
|
SendMessageElement,
|
||||||
User,
|
User,
|
||||||
|
CacheScanResult,
|
||||||
ChatCacheList,
|
ChatCacheList,
|
||||||
ChatCacheListItemBasic
|
ChatCacheListItemBasic
|
||||||
} from "./types";
|
} from "./types";
|
||||||
@ -707,6 +708,20 @@ export class NTQQApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static scanCache() {
|
||||||
|
callNTQQApi<GeneralCallResult>({
|
||||||
|
channel: NTQQApiChannel.IPC_UP_3,
|
||||||
|
methodName: ReceiveCmd.CACHE_SCAN_FINISH,
|
||||||
|
classNameIsRegister: true,
|
||||||
|
}).then();
|
||||||
|
return callNTQQApi<CacheScanResult>({
|
||||||
|
channel: NTQQApiChannel.IPC_UP_3,
|
||||||
|
methodName: NTQQApiMethod.CACHE_SCAN,
|
||||||
|
args: [null, null],
|
||||||
|
timeoutSecond: 300,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
static getChatCacheList(type: 1 | 2, pageSize: number = 80, pageIndex: number = 0) {
|
static getChatCacheList(type: 1 | 2, pageSize: number = 80, pageIndex: number = 0) {
|
||||||
return new Promise<ChatCacheList>((res, rej) => {
|
return new Promise<ChatCacheList>((res, rej) => {
|
||||||
callNTQQApi<ChatCacheList>({
|
callNTQQApi<ChatCacheList>({
|
||||||
|
@ -355,6 +355,22 @@ export interface FriendRequestNotify {
|
|||||||
buddyReqs: FriendRequest[]
|
buddyReqs: FriendRequest[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CacheScanResult {
|
||||||
|
result: number,
|
||||||
|
size: [ // 单位为字节
|
||||||
|
string, // 系统总存储空间
|
||||||
|
string, // 系统可用存储空间
|
||||||
|
string, // 系统已用存储空间
|
||||||
|
string, // QQ总大小
|
||||||
|
string, // 「聊天与文件」大小
|
||||||
|
string, // 未知
|
||||||
|
string, // 「缓存数据」大小
|
||||||
|
string, // 「其他数据」大小
|
||||||
|
string, // 未知
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
export interface ChatCacheList {
|
export interface ChatCacheList {
|
||||||
pageCount: number,
|
pageCount: number,
|
||||||
infos: ChatCacheListItem[]
|
infos: ChatCacheListItem[]
|
||||||
@ -372,5 +388,7 @@ export interface ChatCacheListItemBasic {
|
|||||||
uid: string,
|
uid: string,
|
||||||
uin: string,
|
uin: string,
|
||||||
remarkName: string,
|
remarkName: string,
|
||||||
nickName: string
|
nickName: string,
|
||||||
|
chatType?: 1 | 2,
|
||||||
|
isChecked?: boolean
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user