build: 1.3.5-beta32
This commit is contained in:
1 parent
b5fba09f0d
commit
3e8d8817bb
15 files changed
+176
-79
No files matched your search
@@ -1,15 +1,22 @@
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { NTQQGroupApi } from '@/core/apis/group';
|
||||
|
||||
interface Payload {
|
||||
group_id: number,
|
||||
enable: boolean
|
||||
}
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
group_id: { type: 'number' },
|
||||
enable: { type: 'boolean' }
|
||||
},
|
||||
required: ['group_id', 'enable']
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class SetGroupWholeBan extends BaseAction<Payload, null> {
|
||||
actionName = ActionName.SetGroupWholeBan;
|
||||
|
||||
PayloadSchema = SchemaData;
|
||||
protected async _handle(payload: Payload): Promise<null> {
|
||||
const enable = payload.enable.toString() === 'true';
|
||||
await NTQQGroupApi.banGroup(payload.group_id.toString(), enable);
|
||||
|
||||
Reference in new issue
Block a user