chore: 兼容guild api

This commit is contained in:
手瓜一十雪 2024-08-14 00:53:52 +08:00
parent 00fdce8876
commit 9a05aaa906
5 changed files with 16 additions and 4 deletions

View File

@ -0,0 +1,10 @@
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
export default class GetGuildProfile extends BaseAction<null, null> {
actionName = ActionName.GetGuildProfile;
async _handle(payload: null): Promise<null> {
return null;
}
}

View File

@ -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) {

View File

@ -28,8 +28,8 @@ class GetMsg extends BaseAction<Payload, OB11Message> {
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 ('消息不存在');
}

View File

@ -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"
}