From 261c6dabd5bb68bf9751f5e023c31c1ec451e860 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: Fri, 10 May 2024 20:27:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=89=A9=E5=B1=95GetFriendCategory=20A?= =?UTF-8?q?pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core | 2 +- src/onebot11/action/extends/GetFriendCategory.ts | 14 ++++++++++++++ src/onebot11/action/index.ts | 2 ++ src/onebot11/action/types.ts | 3 ++- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/onebot11/action/extends/GetFriendCategory.ts diff --git a/src/core b/src/core index f2851206..934d336b 160000 --- a/src/core +++ b/src/core @@ -1 +1 @@ -Subproject commit f285120670e02b0ee7d432c573a6b9b57b701367 +Subproject commit 934d336bbdd2ac59a2b5d025bf4c0d7b2879bf54 diff --git a/src/onebot11/action/extends/GetFriendCategory.ts b/src/onebot11/action/extends/GetFriendCategory.ts new file mode 100644 index 00000000..399552a1 --- /dev/null +++ b/src/onebot11/action/extends/GetFriendCategory.ts @@ -0,0 +1,14 @@ +import { OB11User } from '../../types'; +import { OB11Constructor } from '../../constructor'; +import { buddyCategory, friends } from '@/core/data'; +import BaseAction from '../BaseAction'; +import { ActionName } from '../types'; +import { buddyCategorType } from '@/core/entities/'; + +export class GetFriendCategory extends BaseAction> { + actionName = ActionName.GetFriendCategory; + + protected async _handle(payload: void) { + return buddyCategory.data; + } +} diff --git a/src/onebot11/action/index.ts b/src/onebot11/action/index.ts index 56959ee2..ea5c84b7 100644 --- a/src/onebot11/action/index.ts +++ b/src/onebot11/action/index.ts @@ -52,6 +52,7 @@ import { SetOnlineStatus } from './extends/SetOnlineStatus'; import { GetGroupNotice } from './group/GetGroupNotice'; import { GetGroupEssence } from './group/GetGroupEssence'; import { ForwardFriendSingleMsg, ForwardGroupSingleMsg } from '@/onebot11/action/msg/ForwardSingleMsg'; +import { GetFriendCategory } from './extends/GetFriendCategory'; export const actionHandlers = [ new GetFile(), @@ -94,6 +95,7 @@ export const actionHandlers = [ // new SetOnlineStatus(), new GetRobotUinRange(), + new GetFriendCategory(), //以下为go-cqhttp api new GetGroupNotice(), new GetGroupEssence(), diff --git a/src/onebot11/action/types.ts b/src/onebot11/action/types.ts index 67f7b76c..dc448a78 100644 --- a/src/onebot11/action/types.ts +++ b/src/onebot11/action/types.ts @@ -57,8 +57,9 @@ export enum ActionName { // 以下为扩展napcat扩展 GetRobotUinRange = 'get_robot_uin_range', SetOnlineStatus = 'set_online_status', + GetFriendCategory = 'get_friend_category', // 以下为go-cqhttp api - GoCQHTTP_GetEssenceMsg='get_essence_msg_list', + GoCQHTTP_GetEssenceMsg = 'get_essence_msg_list', GoCQHTTP_SetGroupNotice = '_send_group_notice', GoCQHTTP_GetGroupNotice = '_get_group_notice', GoCQHTTP_SendForwardMsg = 'send_forward_msg',