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',