From 29b51adf7d810abfa7a5084413527cd00bca9052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Wed, 14 Aug 2024 00:47:31 +0800 Subject: [PATCH] =?UTF-8?q?style&&chore:=20=E9=80=90=E6=AD=A5=E6=B8=85?= =?UTF-8?q?=E9=80=80=E8=80=81=E7=89=88=E6=9C=AC=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/onebot/action/extends/GetFriendWithCategory.ts | 13 ++++--------- src/onebot/action/extends/GetRobotUinRange.ts | 1 - src/onebot/action/group/DelEssenceMsg.ts | 4 +--- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/onebot/action/extends/GetFriendWithCategory.ts b/src/onebot/action/extends/GetFriendWithCategory.ts index 04373d0c..6374f1cb 100644 --- a/src/onebot/action/extends/GetFriendWithCategory.ts +++ b/src/onebot/action/extends/GetFriendWithCategory.ts @@ -6,14 +6,9 @@ export class GetFriendWithCategory extends BaseAction { actionName = ActionName.GetFriendsWithCategory; async _handle(payload: void) { - if (this.CoreContext.context.basicInfoWrapper.requireMinNTQQBuild('26702')) { - //全新逻辑 - return (await this.CoreContext.apis.FriendApi.getBuddyV2ExWithCate(true)).map(category => ({ - ...category, - buddyList: OB11Constructor.friendsV2(category.buddyList), - })); - } else { - throw new Error('this ntqq version not support, must be 26702 or later'); - } + return (await this.CoreContext.apis.FriendApi.getBuddyV2ExWithCate(true)).map(category => ({ + ...category, + buddyList: OB11Constructor.friendsV2(category.buddyList), + })); } } diff --git a/src/onebot/action/extends/GetRobotUinRange.ts b/src/onebot/action/extends/GetRobotUinRange.ts index 21c0bce9..0466f3cf 100644 --- a/src/onebot/action/extends/GetRobotUinRange.ts +++ b/src/onebot/action/extends/GetRobotUinRange.ts @@ -5,7 +5,6 @@ export class GetRobotUinRange extends BaseAction> { actionName = ActionName.GetRobotUinRange; async _handle(payload: void) { - // console.log(await NTQQUserApi.getRobotUinRange()); const NTQQUserApi = this.CoreContext.apis.UserApi; return await NTQQUserApi.getRobotUinRange(); } diff --git a/src/onebot/action/group/DelEssenceMsg.ts b/src/onebot/action/group/DelEssenceMsg.ts index 733138e5..001f178a 100644 --- a/src/onebot/action/group/DelEssenceMsg.ts +++ b/src/onebot/action/group/DelEssenceMsg.ts @@ -20,9 +20,7 @@ export default class DelEssenceMsg extends BaseAction { async _handle(payload: Payload): Promise { const NTQQGroupApi = this.CoreContext.apis.GroupApi; const msg = MessageUnique.getMsgIdAndPeerByShortId(parseInt(payload.message_id.toString())); - if (!msg) { - throw new Error('msg not found'); - } + if (!msg) throw new Error('msg not found'); return await NTQQGroupApi.removeGroupEssence( msg.Peer.peerUid, msg.MsgId,