mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: nullable
This commit is contained in:
@@ -5,8 +5,8 @@ import { MessageUnique } from '@/common/message-unique';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
message_id: Type.Union([Type.Number(), Type.String()]),
|
||||
id: Type.Union([Type.Number(), Type.String()]),
|
||||
message_id: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
||||
id: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
||||
});
|
||||
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
@@ -6,7 +6,7 @@ import { Static, Type } from '@sinclair/typebox';
|
||||
const SchemaData = Type.Object({
|
||||
flag: Type.String(),
|
||||
approve: Type.Optional(Type.Union([Type.Boolean(), Type.String()])),
|
||||
reason: Type.String({ default: ' ' }),
|
||||
reason: Type.Union([Type.String({ default: ' ' }), Type.Null()]),
|
||||
});
|
||||
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
@@ -20,7 +20,7 @@ export default class SetGroupAddRequest extends OneBotAction<Payload, null> {
|
||||
const approve = payload.approve?.toString() !== 'false';
|
||||
await this.core.apis.GroupApi.handleGroupRequest(flag,
|
||||
approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
||||
payload.reason,
|
||||
payload.reason ?? ' ',
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user