Merge pull request #652 from JerryZRF/main

feat: add `get_clientkey`
This commit is contained in:
手瓜一十雪
2024-12-25 12:51:44 +08:00
committed by GitHub
3 changed files with 130 additions and 112 deletions

View File

@@ -0,0 +1,14 @@
import { ActionName } from '@/onebot/action/router';
import { OneBotAction } from '../OneBotAction';
interface GetClientkeyResponse {
clientkey?: string;
}
export class GetClientkey extends OneBotAction<void, GetClientkeyResponse> {
actionName = ActionName.GetClientkey;
async _handle() {
return { clientkey: (await this.core.apis.UserApi.forceFetchClientKey()).clientKey };
}
}

View File

@@ -102,6 +102,7 @@ import { SendGroupAiRecord } from "@/onebot/action/group/SendGroupAiRecord";
import { GetAiCharacters } from "@/onebot/action/extends/GetAiCharacters";
import { GetGuildList } from './guild/GetGuildList';
import { GetGuildProfile } from './guild/GetGuildProfile';
import { GetClientkey } from './extends/GetClientkey';
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
@@ -123,6 +124,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
new GetGroupRootFiles(obContext, core),
new SetGroupSign(obContext, core),
new SendGroupSign(obContext, core),
new GetClientkey(obContext, core),
// onebot11
new SendLike(obContext, core),
new GetMsg(obContext, core),

View File

@@ -143,4 +143,6 @@ export const ActionName = {
GetAiRecord: "get_ai_record",
GetAiCharacters: "get_ai_characters",
SendGroupAiRecord: "send_group_ai_record",
GetClientkey: "get_clientkey",
} as const;