This commit is contained in:
手瓜一十雪 2024-10-14 22:13:41 +08:00
parent 10e281ed35
commit 7affa081ac
5 changed files with 32 additions and 3 deletions

View File

@ -59,7 +59,9 @@ export class NTQQGroupApi {
pageLimit: 300, pageLimit: 300,
}, pskey); }, pskey);
} }
async getGroupShutUpMemberList(groupCode: string) {
return this.context.session.getGroupService().getGroupShutUpMemberList(groupCode);
}
async clearGroupNotifiesUnreadCount(uk: boolean) { async clearGroupNotifiesUnreadCount(uk: boolean) {
return this.context.session.getGroupService().clearGroupNotifiesUnreadCount(uk); return this.context.session.getGroupService().clearGroupNotifiesUnreadCount(uk);
} }

View File

@ -145,7 +145,7 @@ export interface NodeIKernelGroupService {
getMemberExtInfo(param: GroupExtParam): Promise<unknown>;//req getMemberExtInfo(param: GroupExtParam): Promise<unknown>;//req
getGroupAllInfo(): unknown; getGroupAllInfo(groupId: string, sourceId: number): Promise<any>;
getDiscussExistInfo(): unknown; getDiscussExistInfo(): unknown;
@ -234,7 +234,7 @@ export interface NodeIKernelGroupService {
setGroupShutUp(groupCode: string, shutUp: boolean): void; setGroupShutUp(groupCode: string, shutUp: boolean): void;
getGroupShutUpMemberList(groupCode: string): unknown[]; getGroupShutUpMemberList(groupCode: string): Promise<any>;
setMemberShutUp(groupCode: string, memberTimes: { uid: string, timeStamp: number }[]): Promise<void>; setMemberShutUp(groupCode: string, memberTimes: { uid: string, timeStamp: number }[]): Promise<void>;

View File

@ -0,0 +1,24 @@
import { OB11Group } from '@/onebot';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
const SchemaData = {
type: 'object',
properties: {
group_id: { type: ['number', 'string'] },
},
required: ['group_id'],
} as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;
export class GetGroupShutList extends BaseAction<Payload, OB11Group> {
actionName = ActionName.GetGroupShutList;
payloadSchema = SchemaData;
async _handle(payload: Payload) {
return await this.core.apis.GroupApi.getGroupShutUpMemberList(payload.group_id.toString());
}
}

View File

@ -89,6 +89,7 @@ import { GetUserStatus } from './extends/GetUserStatus';
import { GetRkey } from './extends/GetRkey'; import { GetRkey } from './extends/GetRkey';
import { SetSpecialTittle } from './extends/SetSpecialTittle'; import { SetSpecialTittle } from './extends/SetSpecialTittle';
import { UploadForwardMsg } from "@/onebot/action/extends/UploadForwardMsg"; import { UploadForwardMsg } from "@/onebot/action/extends/UploadForwardMsg";
import { GetGroupShutList } from './group/GetGroupShutList';
export type ActionMap = Map<string, BaseAction<any, any>>; export type ActionMap = Map<string, BaseAction<any, any>>;
@ -190,6 +191,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
new GetRkey(obContext, core), new GetRkey(obContext, core),
new SetSpecialTittle(obContext, core), new SetSpecialTittle(obContext, core),
new UploadForwardMsg(obContext, core), new UploadForwardMsg(obContext, core),
new GetGroupShutList(obContext, core),
]; ];
const actionMap = new Map(); const actionMap = new Map();
for (const action of actionHandlers) { for (const action of actionHandlers) {

View File

@ -124,4 +124,5 @@ export enum ActionName {
GetRkey = "nc_get_rkey", GetRkey = "nc_get_rkey",
SetSpecialTittle = "set_group_special_title", SetSpecialTittle = "set_group_special_title",
UploadForwardMsg = "upload_forward_msg", UploadForwardMsg = "upload_forward_msg",
GetGroupShutList = "get_goup_shut_list",
} }