diff --git a/src/onebot/action/extends/FetchOtherProfileLike.ts b/src/onebot/action/extends/FetchOtherProfileLike.ts new file mode 100644 index 00000000..820542fa --- /dev/null +++ b/src/onebot/action/extends/FetchOtherProfileLike.ts @@ -0,0 +1,11 @@ +import BaseAction from '../BaseAction'; +import { ActionName } from '../types'; + +export class FetchOtherProfileLike extends BaseAction<{ qq: number }, any> { + actionName = ActionName.FetchOtherProfileLike; + + async _handle(payload: { qq: number }) { + if (!payload.qq) throw new Error('qq is required'); + return await this.core.apis.UserApi.getUidByUinV2(payload.qq.toString()); + } +} diff --git a/src/onebot/action/index.ts b/src/onebot/action/index.ts index c55e9b0a..d8f1f13f 100644 --- a/src/onebot/action/index.ts +++ b/src/onebot/action/index.ts @@ -84,6 +84,7 @@ import { GetGroupFileSystemInfo } from '@/onebot/action/go-cqhttp/GetGroupFileSy import { GetGroupRootFiles } from '@/onebot/action/go-cqhttp/GetGroupRootFiles'; import { GetGroupFilesByFolder } from '@/onebot/action/go-cqhttp/GetGroupFilesByFolder'; import { GetGroupSystemMsg } from './system/GetSystemMsg'; +import { FetchOtherProfileLike } from './extends/fetchOtherProfileLike'; export type ActionMap = Map>; @@ -178,6 +179,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo new GetGroupFileSystemInfo(obContext, core), new GetGroupFilesByFolder(obContext, core), new GetGroupSystemMsg(obContext, core), + new FetchOtherProfileLike(obContext, core), ]; const actionMap = new Map(); for (const action of actionHandlers) { diff --git a/src/onebot/action/types.ts b/src/onebot/action/types.ts index 54d8cd68..0cc7644a 100644 --- a/src/onebot/action/types.ts +++ b/src/onebot/action/types.ts @@ -118,4 +118,5 @@ export enum ActionName { DelGroupNotice = '_del_group_notice', GetGroupInfoEx = "get_group_info_ex", GetGroupSystemMsg = 'get_group_system_msg', + FetchOtherProfileLike = "fetch_other_profile_like", }