mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 23:19:37 +00:00
Replaced generic ActionExamples imports with more specific examples modules (FileActionsExamples, GroupActionsExamples, GoCQHTTPActionsExamples) across file, group, and go-cqhttp actions. Added or updated actionSummary, actionDescription, actionTags, payloadExample, and returnExample properties for improved API documentation and clarity.
32 lines
1.4 KiB
TypeScript
32 lines
1.4 KiB
TypeScript
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' }),
|
|
});
|
|
|
|
export type GoCQHTTPCheckUrlSafelyPayload = Static<typeof GoCQHTTPCheckUrlSafelyPayloadSchema>;
|
|
|
|
export const GoCQHTTPCheckUrlSafelyReturnSchema = Type.Object({
|
|
level: Type.Number({ description: '安全等级 (1: 安全, 2: 未知, 3: 危险)' }),
|
|
});
|
|
|
|
export type GoCQHTTPCheckUrlSafelyReturn = Static<typeof GoCQHTTPCheckUrlSafelyReturnSchema>;
|
|
|
|
export class GoCQHTTPCheckUrlSafely extends OneBotAction<GoCQHTTPCheckUrlSafelyPayload, GoCQHTTPCheckUrlSafelyReturn> {
|
|
override actionName = ActionName.GoCQHTTP_CheckUrlSafely;
|
|
override payloadSchema = GoCQHTTPCheckUrlSafelyPayloadSchema;
|
|
override returnSchema = GoCQHTTPCheckUrlSafelyReturnSchema;
|
|
override actionSummary = '检查URL安全性';
|
|
override actionDescription = '检查指定URL的安全等级';
|
|
override actionTags = ['Go-CQHTTP'];
|
|
override payloadExample = GoCQHTTPActionsExamples.GoCQHTTPCheckUrlSafely.payload;
|
|
override returnExample = GoCQHTTPActionsExamples.GoCQHTTPCheckUrlSafely.response;
|
|
|
|
async _handle () {
|
|
return { level: 1 };
|
|
}
|
|
}
|