refactor: Use remote rkey

This commit is contained in:
linyuchen
2024-05-11 13:41:09 +08:00
parent 698649f981
commit f9aa2d3bce
11 changed files with 23 additions and 86 deletions

View File

@@ -1,14 +0,0 @@
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

@@ -0,0 +1,14 @@
import { OB11User } from '../../types';
import { OB11Constructor } from '../../constructor';
import { rawFriends, friends } from '@/core/data';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { BuddyCategoryType } from '@/core/entities/';
export class GetFriendWithCategory extends BaseAction<void, Array<BuddyCategoryType>> {
actionName = ActionName.GetFriendsWithCategory;
protected async _handle(payload: void) {
return rawFriends;
}
}

View File

@@ -52,7 +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';
import { GetFriendWithCategory } from './extends/GetFriendWithCategory';
export const actionHandlers = [
new GetFile(),
@@ -95,7 +95,7 @@ export const actionHandlers = [
//
new SetOnlineStatus(),
new GetRobotUinRange(),
new GetFriendCategory(),
new GetFriendWithCategory(),
//以下为go-cqhttp api
new GetGroupNotice(),
new GetGroupEssence(),

View File

@@ -57,7 +57,7 @@ export enum ActionName {
// 以下为扩展napcat扩展
GetRobotUinRange = 'get_robot_uin_range',
SetOnlineStatus = 'set_online_status',
GetFriendCategory = 'get_friend_category',
GetFriendsWithCategory = 'get_friends_with_category',
// 以下为go-cqhttp api
GoCQHTTP_GetEssenceMsg = 'get_essence_msg_list',
GoCQHTTP_SetGroupNotice = '_send_group_notice',