Files
NapCatQQ/packages/napcat-onebot/action/go-cqhttp/GoCQHTTPCheckUrlSafely.ts
T
时瑾 e6f6468377
Release NapCat / validate-version (push) Canceled after 0s
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
Revert "fix: 对齐 OneBot schema 与合并转发消息处理行为 (#1694)" (#1701)
This reverts commit deae7fd467.
2026-03-13 15:26:53 +08:00

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 '../example/GoCQHTTPActionsExamples';
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 };
}
}