mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
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:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user