diff --git a/src/onebot/action/go-cqhttp/GetStrangerInfo.ts b/src/onebot/action/go-cqhttp/GetStrangerInfo.ts index c8d53b0a..796f67f3 100644 --- a/src/onebot/action/go-cqhttp/GetStrangerInfo.ts +++ b/src/onebot/action/go-cqhttp/GetStrangerInfo.ts @@ -7,6 +7,7 @@ import { Static, Type } from '@sinclair/typebox'; const SchemaData = Type.Object({ user_id: Type.Union([Type.Number(), Type.String()]), + no_cache: Type.Union([Type.Boolean(), Type.String()], { default: false }), }); type Payload = Static; @@ -16,10 +17,11 @@ export default class GoCQHTTPGetStrangerInfo extends OneBotAction { const [member, info] = await Promise.all([ this.core.apis.GroupApi.getGroupMemberEx(payload.group_id.toString(), uid, isNocache), - this.core.apis.UserApi.getUserDetailInfo(uid), + this.core.apis.UserApi.getUserDetailInfo(uid, isNocache), ]); if (!member || !groupMember) throw new Error(`群(${payload.group_id})成员${payload.user_id}不存在`); diff --git a/src/onebot/action/user/GetFriendList.ts b/src/onebot/action/user/GetFriendList.ts index 0bc4e677..6850f0f6 100644 --- a/src/onebot/action/user/GetFriendList.ts +++ b/src/onebot/action/user/GetFriendList.ts @@ -16,11 +16,11 @@ export default class GetFriendList extends OneBotAction { async _handle(_payload: Payload) { const buddyMap = await this.core.apis.FriendApi.getBuddyV2SimpleInfoMap(); - + const isNocache = typeof _payload.no_cache === 'string' ? _payload.no_cache === 'true' : !!_payload.no_cache; await Promise.all( Array.from(buddyMap.values()).map(async (buddyInfo) => { try { - const userDetail = await this.core.apis.UserApi.getUserDetailInfo(buddyInfo.coreInfo.uid); + const userDetail = await this.core.apis.UserApi.getUserDetailInfo(buddyInfo.coreInfo.uid, isNocache); const data = buddyMap.get(buddyInfo.coreInfo.uid); if (data) { data.qqLevel = userDetail.qqLevel; diff --git a/src/onebot/index.ts b/src/onebot/index.ts index 78b25397..4fb0089c 100644 --- a/src/onebot/index.ts +++ b/src/onebot/index.ts @@ -100,7 +100,7 @@ export class NapCatOneBot11Adapter { const selfInfo = this.core.selfInfo; const ob11Config = this.configLoader.configData; - this.core.apis.UserApi.getUserDetailInfo(selfInfo.uid) + this.core.apis.UserApi.getUserDetailInfo(selfInfo.uid, false) .then((user) => { selfInfo.nick = user.nick; this.context.logger.setLogSelfInfo(selfInfo);