diff --git a/src/common/data.ts b/src/common/data.ts index c551fa0..ccd36cc 100644 --- a/src/common/data.ts +++ b/src/common/data.ts @@ -16,7 +16,7 @@ export const llonebotError: LLOneBotError = { ffmpegError: '', httpServerError: '', wsServerError: '', - otherError: 'LLOnebot 未能正常启动,请检查日志查看错误', + otherError: 'LLOneBot 未能正常启动,请检查日志查看错误', } // 群号 -> 群成员map(uid=>GroupMember) export const groupMembers: Map> = new Map>() diff --git a/src/main/main.ts b/src/main/main.ts index 448095b..5ba38f5 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -382,7 +382,7 @@ function onLoad() { log('llonebot pid', process.pid) const config = getConfigUtil().getConfig() if (!config.enableLLOB) { - llonebotError.otherError = 'LLOnebot 未启动' + llonebotError.otherError = 'LLOneBot 未启动' log('LLOneBot 开关设置为关闭,不启动LLOneBot') return } diff --git a/src/ntqqapi/api/friend.ts b/src/ntqqapi/api/friend.ts index 48d6f12..cb51f3e 100644 --- a/src/ntqqapi/api/friend.ts +++ b/src/ntqqapi/api/friend.ts @@ -8,6 +8,7 @@ import { CacheClassFuncAsyncExtend } from '@/common/utils/helper' import { LimitedHashTable } from '@/common/utils/table' export class NTQQFriendApi { + /** >=26702 应使用 getBuddyV2 */ static async getFriends(forced = false) { const data = await callNTQQApi<{ data: { diff --git a/src/ntqqapi/api/user.ts b/src/ntqqapi/api/user.ts index 1bdd5fe..1d6c6b5 100644 --- a/src/ntqqapi/api/user.ts +++ b/src/ntqqapi/api/user.ts @@ -52,20 +52,11 @@ export class NTQQUserApi { 'NodeIKernelProfileListener/onUserDetailInfoChanged', 1, 5000, - (profile) => { - if (profile.uid === uid) { - return true - } - return false - }, + (profile) => profile.uid === uid, 'BuddyProfileStore', - [ - uid - ], + [uid], UserDetailSource.KSERVER, - [ - ProfileBizType.KALL - ] + [ProfileBizType.KALL] ) const RetUser: User = { ...profile.simpleInfo.coreInfo, @@ -81,7 +72,7 @@ export class NTQQUserApi { static async getUserDetailInfo(uid: string, getLevel = false, withBizInfo = true) { if (getBuildVersion() >= 26702) { - return this.fetchUserDetailInfo(uid) + return NTQQUserApi.fetchUserDetailInfo(uid) } type EventService = NodeIKernelProfileService['getUserDetailInfoWithBizInfo'] type EventListener = NodeIKernelProfileListener['onProfileDetailInfoChanged'] @@ -92,12 +83,7 @@ export class NTQQUserApi { 'NodeIKernelProfileListener/onProfileDetailInfoChanged', 2, 5000, - (profile: User) => { - if (profile.uid === uid) { - return true - } - return false - }, + (profile) => profile.uid === uid, uid, [0] ) @@ -119,7 +105,7 @@ export class NTQQUserApi { static async getQzoneCookies() { const uin = getSelfUin() - const requestUrl = 'https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=' + uin + '&clientkey=' + (await this.getClientKey()).clientKey + '&u1=https%3A%2F%2Fuser.qzone.qq.com%2F' + uin + '%2Finfocenter&keyindex=19%27' + const requestUrl = 'https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=' + uin + '&clientkey=' + (await NTQQUserApi.getClientKey()).clientKey + '&u1=https%3A%2F%2Fuser.qzone.qq.com%2F' + uin + '%2Finfocenter&keyindex=19%27' let cookies: { [key: string]: string } = {} try { cookies = await RequestUtil.HttpsGetCookies(requestUrl) @@ -129,8 +115,9 @@ export class NTQQUserApi { } return cookies } + static async getSkey(): Promise { - const clientKeyData = await this.getClientKey() + const clientKeyData = await NTQQUserApi.getClientKey() if (clientKeyData.result !== 0) { throw new Error('获取clientKey失败') } diff --git a/src/ntqqapi/hook.ts b/src/ntqqapi/hook.ts index 5b54f62..6acd5e3 100644 --- a/src/ntqqapi/hook.ts +++ b/src/ntqqapi/hook.ts @@ -246,12 +246,12 @@ let activatedGroups: string[] = [] async function updateGroups(_groups: Group[], needUpdate: boolean = true) { for (let group of _groups) { - log('update group', group) + log('update group', group.groupCode) if (group.privilegeFlag === 0) { deleteGroup(group.groupCode) continue } - log('update group', group) + //log('update group', group) NTQQMsgApi.activateChat({ peerUid: group.groupCode, chatType: ChatType.group }).then().catch(log) let existGroup = groups.find((g) => g.groupCode == group.groupCode) if (existGroup) { diff --git a/src/onebot11/action/llonebot/Debug.ts b/src/onebot11/action/llonebot/Debug.ts index 70a74c9..a184626 100644 --- a/src/onebot11/action/llonebot/Debug.ts +++ b/src/onebot11/action/llonebot/Debug.ts @@ -24,7 +24,7 @@ export default class Debug extends BaseAction { log('debug call ntqq api', payload) const ntqqApi = [NTQQMsgApi, NTQQFriendApi, NTQQGroupApi, NTQQUserApi, NTQQFileApi, NTQQFileCacheApi, NTQQWindowApi] for (const ntqqApiClass of ntqqApi) { - log('ntqqApiClass', ntqqApiClass) + //log('ntqqApiClass', ntqqApiClass) const method = ntqqApiClass[payload.method] if (method) { const result = method(...payload.args)