mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
feat: add get_clientkey
This commit is contained in:
14
src/onebot/action/extends/GetClientkey.ts
Normal file
14
src/onebot/action/extends/GetClientkey.ts
Normal 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 };
|
||||||
|
}
|
||||||
|
}
|
@@ -102,6 +102,7 @@ import { SendGroupAiRecord } from "@/onebot/action/group/SendGroupAiRecord";
|
|||||||
import { GetAiCharacters } from "@/onebot/action/extends/GetAiCharacters";
|
import { GetAiCharacters } from "@/onebot/action/extends/GetAiCharacters";
|
||||||
import { GetGuildList } from './guild/GetGuildList';
|
import { GetGuildList } from './guild/GetGuildList';
|
||||||
import { GetGuildProfile } from './guild/GetGuildProfile';
|
import { GetGuildProfile } from './guild/GetGuildProfile';
|
||||||
|
import { GetClientkey } from './extends/GetClientKey';
|
||||||
|
|
||||||
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||||
|
|
||||||
@@ -123,6 +124,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
|
|||||||
new GetGroupRootFiles(obContext, core),
|
new GetGroupRootFiles(obContext, core),
|
||||||
new SetGroupSign(obContext, core),
|
new SetGroupSign(obContext, core),
|
||||||
new SendGroupSign(obContext, core),
|
new SendGroupSign(obContext, core),
|
||||||
|
new GetClientkey(obContext, core),
|
||||||
// onebot11
|
// onebot11
|
||||||
new SendLike(obContext, core),
|
new SendLike(obContext, core),
|
||||||
new GetMsg(obContext, core),
|
new GetMsg(obContext, core),
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
import { GetClientkey } from "./extends/GetClientKey";
|
||||||
|
|
||||||
export type BaseCheckResult = ValidCheckResult | InvalidCheckResult;
|
export type BaseCheckResult = ValidCheckResult | InvalidCheckResult;
|
||||||
|
|
||||||
export interface ValidCheckResult {
|
export interface ValidCheckResult {
|
||||||
@@ -143,4 +145,6 @@ export const ActionName = {
|
|||||||
GetAiRecord: "get_ai_record",
|
GetAiRecord: "get_ai_record",
|
||||||
GetAiCharacters: "get_ai_characters",
|
GetAiCharacters: "get_ai_characters",
|
||||||
SendGroupAiRecord: "send_group_ai_record",
|
SendGroupAiRecord: "send_group_ai_record",
|
||||||
|
|
||||||
|
GetClientkey: "get_clientkey",
|
||||||
} as const;
|
} as const;
|
||||||
|
Reference in New Issue
Block a user