fix: 提高兼容性

This commit is contained in:
手瓜一十雪
2024-08-20 20:26:49 +08:00
parent e84e22e7b5
commit d91d03a8f3
5 changed files with 19 additions and 1 deletions

View File

@@ -79,6 +79,7 @@ import { NapCatOneBot11Adapter } from '@/onebot';
import GetGuildProfile from './guild/GetGuildProfile';
import SetModelShow from './go-cqhttp/SetModelShow';
import { SetInputStatus } from './extends/SetInputStatus';
import { GetCSRF } from './system/GetCSRF';
export type ActionMap = Map<string, BaseAction<any, any>>;
@@ -167,6 +168,7 @@ export function createActionMap(onebotContext: NapCatOneBot11Adapter, coreContex
new GetGuildProfile(onebotContext, coreContext),
new SetModelShow(onebotContext, coreContext),
new SetInputStatus(onebotContext, coreContext),
new GetCSRF(onebotContext, coreContext),
];
const actionMap = new Map();
for (const action of actionHandlers) {

View File

@@ -0,0 +1,12 @@
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
export class GetCSRF extends BaseAction<any, any> {
actionName = ActionName.GetCSRF;
async _handle(payload: any) {
return {
token: "",
};
}
}

View File

@@ -107,5 +107,6 @@ export enum ActionName {
FetchEmojiLike = 'fetch_emoji_like',
GetGuildProfile = "get_guild_service_profile",
SetModelShow = "_set_model_show",
SetInputStatus = "set_input_status"
SetInputStatus = "set_input_status",
GetCSRF = "get_csrf_token",
}