feat: 扩展GetFriendCategory Api

This commit is contained in:
手瓜一十雪
2024-05-10 20:27:38 +08:00
parent cae84bbf02
commit 261c6dabd5
4 changed files with 19 additions and 2 deletions

View File

@@ -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<void, Array<buddyCategorType>> {
actionName = ActionName.GetFriendCategory;
protected async _handle(payload: void) {
return buddyCategory.data;
}
}

View File

@@ -52,6 +52,7 @@ import { SetOnlineStatus } from './extends/SetOnlineStatus';
import { GetGroupNotice } from './group/GetGroupNotice'; import { GetGroupNotice } from './group/GetGroupNotice';
import { GetGroupEssence } from './group/GetGroupEssence'; import { GetGroupEssence } from './group/GetGroupEssence';
import { ForwardFriendSingleMsg, ForwardGroupSingleMsg } from '@/onebot11/action/msg/ForwardSingleMsg'; import { ForwardFriendSingleMsg, ForwardGroupSingleMsg } from '@/onebot11/action/msg/ForwardSingleMsg';
import { GetFriendCategory } from './extends/GetFriendCategory';
export const actionHandlers = [ export const actionHandlers = [
new GetFile(), new GetFile(),
@@ -94,6 +95,7 @@ export const actionHandlers = [
// //
new SetOnlineStatus(), new SetOnlineStatus(),
new GetRobotUinRange(), new GetRobotUinRange(),
new GetFriendCategory(),
//以下为go-cqhttp api //以下为go-cqhttp api
new GetGroupNotice(), new GetGroupNotice(),
new GetGroupEssence(), new GetGroupEssence(),

View File

@@ -57,8 +57,9 @@ export enum ActionName {
// 以下为扩展napcat扩展 // 以下为扩展napcat扩展
GetRobotUinRange = 'get_robot_uin_range', GetRobotUinRange = 'get_robot_uin_range',
SetOnlineStatus = 'set_online_status', SetOnlineStatus = 'set_online_status',
GetFriendCategory = 'get_friend_category',
// 以下为go-cqhttp api // 以下为go-cqhttp api
GoCQHTTP_GetEssenceMsg='get_essence_msg_list', GoCQHTTP_GetEssenceMsg = 'get_essence_msg_list',
GoCQHTTP_SetGroupNotice = '_send_group_notice', GoCQHTTP_SetGroupNotice = '_send_group_notice',
GoCQHTTP_GetGroupNotice = '_get_group_notice', GoCQHTTP_GetGroupNotice = '_get_group_notice',
GoCQHTTP_SendForwardMsg = 'send_forward_msg', GoCQHTTP_SendForwardMsg = 'send_forward_msg',