From b31876d2d16d277fc374d60723f300d021a28a5b 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: Sat, 27 Apr 2024 22:52:57 +0800 Subject: [PATCH] fix --- src/onebot11/action/extends/GetRobotUinRange.ts | 14 ++++++++++++++ src/onebot11/action/index.ts | 3 +++ src/onebot11/action/types.ts | 5 +++-- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/onebot11/action/extends/GetRobotUinRange.ts diff --git a/src/onebot11/action/extends/GetRobotUinRange.ts b/src/onebot11/action/extends/GetRobotUinRange.ts new file mode 100644 index 00000000..b73814a5 --- /dev/null +++ b/src/onebot11/action/extends/GetRobotUinRange.ts @@ -0,0 +1,14 @@ +import { OB11User } from '../../types'; +import { OB11Constructor } from '../../constructor'; +import { friends } from '../../../common/data'; +import BaseAction from '../BaseAction'; +import { ActionName } from '../types'; +import { NTQQUserApi } from '@/core/apis'; +export class GetRobotUinRange extends BaseAction> { + actionName = ActionName.GetRobotUinRange; + + protected async _handle(payload: void) { + // console.log(await NTQQUserApi.getRobotUinRange()); + return await NTQQUserApi.getRobotUinRange(); + } +} diff --git a/src/onebot11/action/index.ts b/src/onebot11/action/index.ts index c08c812d..285d37f3 100644 --- a/src/onebot11/action/index.ts +++ b/src/onebot11/action/index.ts @@ -47,6 +47,7 @@ import { GoCQHTTGetForwardMsgAction } from './go-cqhttp/GetForwardMsg'; import GetFriendMsgHistory from './go-cqhttp/GetFriendMsgHistory'; import { GetCookies } from './user/GetCookies'; import { SetMsgEmojiLike } from '@/onebot11/action/msg/SetMsgEmojiLike'; +import { GetRobotUinRange } from './extends/GetRobotUinRange'; export const actionHandlers = [ new GetFile(), @@ -84,6 +85,8 @@ export const actionHandlers = [ new SetMsgEmojiLike(), // new CleanCache(), new GetCookies(), + // + new GetRobotUinRange(), //以下为go-cqhttp api new GoCQHTTPSendForwardMsg(), new GoCQHTTPSendGroupForwardMsg(), diff --git a/src/onebot11/action/types.ts b/src/onebot11/action/types.ts index 9eb34215..f70594bc 100644 --- a/src/onebot11/action/types.ts +++ b/src/onebot11/action/types.ts @@ -51,8 +51,9 @@ export enum ActionName { GetImage = 'get_image', GetRecord = 'get_record', CleanCache = 'clean_cache', - GetCookies = "get_cookies", - + GetCookies = 'get_cookies', + // 以下为扩展napcat扩展 + GetRobotUinRange = 'get_robot_uin_range', // 以下为go-cqhttp api GoCQHTTP_SendForwardMsg = 'send_forward_msg', GoCQHTTP_SendGroupForwardMsg = 'send_group_forward_msg',