chore:action

This commit is contained in:
手瓜一十雪 committed 2024-08-09 16:15:17 +08:00
1 parent 013df1dbdd
commit 67d92c61f7
19 files changed
+48 -80

No files matched your search

+1 -6
View File
@@ -1,7 +1,5 @@
import BaseAction from '../BaseAction';
import { getGroupMember } from '@/core/data';
import { ActionName } from '../types';
import { NTQQGroupApi } from '@/core/apis/group';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
const SchemaData = {
@@ -20,10 +18,7 @@ export default class SetGroupBan extends BaseAction<Payload, null> {
actionName = ActionName.SetGroupBan;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload): Promise<null> {
const member = await getGroupMember(payload.group_id, payload.user_id);
if (!member) {
throw `群成员${payload.user_id}不存在`;
}
const NTQQGroupApi = this.CoreContext.getApiContext().GroupApi;
await NTQQGroupApi.banMember(payload.group_id.toString(),
[{ uid: member.uid, timeStamp: parseInt(payload.duration.toString()) }]);
return null;