Refactor action example imports and add example files

Moved action example data to dedicated 'examples.ts' files for each action category (extends, file, go-cqhttp, group, msg, system, user). Updated all action classes to import and use the new example modules, improving code organization and maintainability. Also added missing actionTags and actionDescription where appropriate.
This commit is contained in:
手瓜一十雪
2026-01-25 17:55:07 +08:00
parent fd1808e36a
commit 335c83a3d5
38 changed files with 471 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
import { ActionName } from '@/napcat-onebot/action/router';
import { Static, Type } from '@sinclair/typebox';
import { GoCQHTTPActionsExamples } from './examples';
export const GoCQHTTPCheckUrlSafelyPayloadSchema = Type.Object({
url: Type.String({ description: '要检查的 URL' }),
@@ -18,6 +19,9 @@ export class GoCQHTTPCheckUrlSafely extends OneBotAction<GoCQHTTPCheckUrlSafelyP
override actionName = ActionName.GoCQHTTP_CheckUrlSafely;
override payloadSchema = GoCQHTTPCheckUrlSafelyPayloadSchema;
override returnSchema = GoCQHTTPCheckUrlSafelyReturnSchema;
override actionDescription = '检查 URL 安全性';
override actionTags = ['Go-CQHTTP'];
override payloadExample = GoCQHTTPActionsExamples.GoCQHTTPCheckUrlSafely.payload;
async _handle () {
return { level: 1 };