From 9a05aaa906c81d1e9d65c107a29ed22d04cad4b9 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: Wed, 14 Aug 2024 00:53:52 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=85=BC=E5=AE=B9guild=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/onebot/action/{group => guild}/GetGuildList.ts | 0 src/onebot/action/guild/GetGuildProfile.ts | 10 ++++++++++ src/onebot/action/index.ts | 3 ++- src/onebot/action/msg/GetMsg.ts | 4 ++-- src/onebot/action/types.ts | 3 ++- 5 files changed, 16 insertions(+), 4 deletions(-) rename src/onebot/action/{group => guild}/GetGuildList.ts (100%) create mode 100644 src/onebot/action/guild/GetGuildProfile.ts diff --git a/src/onebot/action/group/GetGuildList.ts b/src/onebot/action/guild/GetGuildList.ts similarity index 100% rename from src/onebot/action/group/GetGuildList.ts rename to src/onebot/action/guild/GetGuildList.ts diff --git a/src/onebot/action/guild/GetGuildProfile.ts b/src/onebot/action/guild/GetGuildProfile.ts new file mode 100644 index 00000000..431fb561 --- /dev/null +++ b/src/onebot/action/guild/GetGuildProfile.ts @@ -0,0 +1,10 @@ +import BaseAction from '../BaseAction'; +import { ActionName } from '../types'; + +export default class GetGuildProfile extends BaseAction { + actionName = ActionName.GetGuildProfile; + + async _handle(payload: null): Promise { + return null; + } +} diff --git a/src/onebot/action/index.ts b/src/onebot/action/index.ts index 7716fa1b..d29c0265 100644 --- a/src/onebot/action/index.ts +++ b/src/onebot/action/index.ts @@ -23,7 +23,7 @@ import GoCQHTTPGetStrangerInfo from './go-cqhttp/GetStrangerInfo'; import SendLike from './user/SendLike'; import SetGroupAddRequest from './group/SetGroupAddRequest'; import SetGroupLeave from './group/SetGroupLeave'; -import GetGuildList from './group/GetGuildList'; +import GetGuildList from './guild/GetGuildList'; import SetFriendAddRequest from './user/SetFriendAddRequest'; import SetGroupWholeBan from './group/SetGroupWholeBan'; import SetGroupName from './group/SetGroupName'; @@ -161,6 +161,7 @@ export function createActionMap(onebotContext: NapCatOneBot11Adapter, coreContex new SetGroupHeader(onebotContext, coreContext), new FetchCustomFace(onebotContext, coreContext), new GoCQHTTPUploadPrivateFile(onebotContext, coreContext), + new GetGuildProfile(onebotContext, coreContext) ]; const actionMap = new Map(); for (const action of actionHandlers) { diff --git a/src/onebot/action/msg/GetMsg.ts b/src/onebot/action/msg/GetMsg.ts index 2d9c5072..72d383d3 100644 --- a/src/onebot/action/msg/GetMsg.ts +++ b/src/onebot/action/msg/GetMsg.ts @@ -28,8 +28,8 @@ class GetMsg extends BaseAction { if (!payload.message_id) { throw Error('参数message_id不能为空'); } - const MsgShortId = await MessageUnique.getShortIdByMsgId(payload.message_id.toString()); - const msgIdWithPeer = await MessageUnique.getMsgIdAndPeerByShortId(MsgShortId || parseInt(payload.message_id.toString())); + const MsgShortId = MessageUnique.getShortIdByMsgId(payload.message_id.toString()); + const msgIdWithPeer = MessageUnique.getMsgIdAndPeerByShortId(MsgShortId || parseInt(payload.message_id.toString())); if (!msgIdWithPeer) { throw ('消息不存在'); } diff --git a/src/onebot/action/types.ts b/src/onebot/action/types.ts index a513028d..8ea51880 100644 --- a/src/onebot/action/types.ts +++ b/src/onebot/action/types.ts @@ -104,5 +104,6 @@ export enum ActionName { FetchCustomFace = 'fetch_custom_face', GOCQHTTP_UploadPrivateFile = 'upload_private_file', TestApi01 = 'test_api_01', - FetchEmojiLike = 'fetch_emoji_like' + FetchEmojiLike = 'fetch_emoji_like', + GetGuildProfile = "get_guild_service_profile" }