fix: nullable
This commit is contained in:
1 parent
7221f4ac02
commit
9eaf51e15f
2 files changed
+4
-4
No files matched your search
@@ -5,8 +5,8 @@ import { MessageUnique } from '@/common/message-unique';
|
|||||||
import { Static, Type } from '@sinclair/typebox';
|
import { Static, Type } from '@sinclair/typebox';
|
||||||
|
|
||||||
const SchemaData = Type.Object({
|
const SchemaData = Type.Object({
|
||||||
message_id: Type.Union([Type.Number(), Type.String()]),
|
message_id: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
||||||
id: Type.Union([Type.Number(), Type.String()]),
|
id: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = Static<typeof SchemaData>;
|
type Payload = Static<typeof SchemaData>;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { Static, Type } from '@sinclair/typebox';
|
|||||||
const SchemaData = Type.Object({
|
const SchemaData = Type.Object({
|
||||||
flag: Type.String(),
|
flag: Type.String(),
|
||||||
approve: Type.Optional(Type.Union([Type.Boolean(), 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>;
|
type Payload = Static<typeof SchemaData>;
|
||||||
@@ -20,7 +20,7 @@ export default class SetGroupAddRequest extends OneBotAction<Payload, null> {
|
|||||||
const approve = payload.approve?.toString() !== 'false';
|
const approve = payload.approve?.toString() !== 'false';
|
||||||
await this.core.apis.GroupApi.handleGroupRequest(flag,
|
await this.core.apis.GroupApi.handleGroupRequest(flag,
|
||||||
approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
||||||
payload.reason,
|
payload.reason ?? ' ',
|
||||||
);
|
);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user