mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: Fix type
This commit is contained in:
parent
3ec1134204
commit
11108bc13f
@ -766,7 +766,7 @@ export class NTQQApi {
|
||||
});
|
||||
}
|
||||
|
||||
static getChatCacheList(type: 1 | 2, pageSize: number = 80, pageIndex: number = 0) {
|
||||
static getChatCacheList(type: ChatType, pageSize: number = 80, pageIndex: number = 0) {
|
||||
return new Promise<ChatCacheList>((res, rej) => {
|
||||
callNTQQApi<ChatCacheList>({
|
||||
methodName: NTQQApiMethod.CACHE_CHAT_GET,
|
||||
|
@ -377,7 +377,7 @@ export interface ChatCacheList {
|
||||
}
|
||||
|
||||
export interface ChatCacheListItem {
|
||||
chatType: 1 | 2,
|
||||
chatType: ChatType,
|
||||
basicChatCacheInfo: ChatCacheListItemBasic,
|
||||
guildChatCacheInfo: unknown[] // TODO: 没用过频道所以不知道这里边的详细内容
|
||||
}
|
||||
@ -389,6 +389,6 @@ export interface ChatCacheListItemBasic {
|
||||
uin: string,
|
||||
remarkName: string,
|
||||
nickName: string,
|
||||
chatType?: 1 | 2,
|
||||
chatType?: ChatType,
|
||||
isChecked?: boolean
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ export default class CleanCache extends BaseAction<void, void> {
|
||||
|
||||
// 清理聊天记录
|
||||
// NOTE: 以防有人不需要删除聊天记录,暂时先注释掉,日后加个开关
|
||||
// await clearChatCache(ChatCacheType.PRIVATE); // 私聊消息
|
||||
// await clearChatCache(ChatCacheType.GROUP); // 群聊消息
|
||||
// await clearChatCache(ChatType.PRIVATE); // 私聊消息
|
||||
// await clearChatCache(ChatType.GROUP); // 群聊消息
|
||||
|
||||
|
||||
|
||||
@ -72,12 +72,12 @@ function deleteCachePath(pathList: string[]) {
|
||||
}
|
||||
}
|
||||
|
||||
async function clearChatCache(type: ChatCacheType) {
|
||||
async function clearChatCache(type: ChatType) {
|
||||
const cacheList = await getCacheList(type);
|
||||
return NTQQApi.clearChatCache(cacheList, []);
|
||||
}
|
||||
|
||||
function getCacheList(type: ChatCacheType) { // NOTE: 做这个方法主要是因为目前还不支持针对频道消息的清理
|
||||
function getCacheList(type: ChatType) { // NOTE: 做这个方法主要是因为目前还不支持针对频道消息的清理
|
||||
return new Promise<Array<ChatCacheListItemBasic>>((res, rej) => {
|
||||
NTQQApi.getChatCacheList(type, 1000, 0)
|
||||
.then(data => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user