Files
NapCatQQ/packages/napcat-onebot/action/new/SetDoubtFriendsAddRequest.ts
T
手瓜一十雪 974528fe7e Apply formatting and minor style fixes across repo
Normalize code style across multiple packages: whitespace cleanup, consistent commas and trailing commas in arrays/enums/objects, fix table markdown lines in CI comment template, ensure newline at EOF, normalize header/object property quoting and spacing, remove stray blank lines and minor non-functional comment tweaks. These are formatting-only changes and small type/annotation spacing adjustments; no functional behavior changes intended.
2026-03-05 18:45:50 +08:00

32 lines
1.3 KiB
TypeScript

import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
import { ActionName } from '@/napcat-onebot/action/router';
import { Static, Type } from '@sinclair/typebox';
export const SetDoubtFriendsAddRequestPayloadSchema = Type.Object({
flag: Type.String({ description: '请求 flag' }),
// 注意强制String 非isNumeric 不遵守则不符合设计
approve: Type.Boolean({ default: true, description: '是否同意 (强制为 true)' }),
// 该字段没有语义 仅做保留 强制为True
});
export type SetDoubtFriendsAddRequestPayload = Static<typeof SetDoubtFriendsAddRequestPayloadSchema>;
export class SetDoubtFriendsAddRequest extends OneBotAction<SetDoubtFriendsAddRequestPayload, any> {
override actionName = ActionName.SetDoubtFriendsAddRequest;
override payloadSchema = SetDoubtFriendsAddRequestPayloadSchema;
override returnSchema = Type.Any();
override actionSummary = '处理可疑好友申请';
override actionDescription = '同意或拒绝系统的可疑好友申请';
override actionTags = ['系统接口'];
override payloadExample = {
flag: '12345',
approve: true,
};
override returnExample = null;
async _handle (payload: SetDoubtFriendsAddRequestPayload) {
return await this.core.apis.FriendApi.handleDoubtFriendRequest(payload.flag);
}
}