mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
build: 2.2.7
DelGroupNotice
This commit is contained in:
parent
4c69c6d9fd
commit
3d09d45423
@ -224,6 +224,10 @@ export class NTQQGroupApi {
|
|||||||
async kickMemberV2Inner(param: kickMemberV2Req) {
|
async kickMemberV2Inner(param: kickMemberV2Req) {
|
||||||
return this.context.session.getGroupService().kickMemberV2(param);
|
return this.context.session.getGroupService().kickMemberV2(param);
|
||||||
}
|
}
|
||||||
|
async deleteGroupBulletin(GroupCode: string, feedId: string) {
|
||||||
|
const _Pskey = (await this.core.apis.UserApi.getPSkey(['qun.qq.com'])).domainPskeyMap.get('qun.qq.com')!;
|
||||||
|
return this.context.session.getGroupService().deleteGroupBulletin(GroupCode, _Pskey, feedId);
|
||||||
|
}
|
||||||
async quitGroupV2(GroupCode: string, needDeleteLocalMsg: boolean) {
|
async quitGroupV2(GroupCode: string, needDeleteLocalMsg: boolean) {
|
||||||
let param = {
|
let param = {
|
||||||
groupCode: GroupCode,
|
groupCode: GroupCode,
|
||||||
|
@ -209,7 +209,7 @@ export interface NodeIKernelGroupService {
|
|||||||
|
|
||||||
getGroupBulletin(groupCode: string): unknown;
|
getGroupBulletin(groupCode: string): unknown;
|
||||||
|
|
||||||
deleteGroupBulletin(groupCode: string, seq: string): void;
|
deleteGroupBulletin(groupCode: string, seq: string, feedId: string): void;
|
||||||
|
|
||||||
publishGroupBulletin(groupCode: string, pskey: string, data: any): Promise<GeneralCallResult>;
|
publishGroupBulletin(groupCode: string, pskey: string, data: any): Promise<GeneralCallResult>;
|
||||||
|
|
||||||
|
28
src/onebot/action/group/DelGroupNotice.ts
Normal file
28
src/onebot/action/group/DelGroupNotice.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { WebApiGroupNoticeFeed } from '@/core';
|
||||||
|
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'] },
|
||||||
|
feed_id: { type: 'string' },
|
||||||
|
},
|
||||||
|
required: ['group_id','feed_id'],
|
||||||
|
} as const satisfies JSONSchema;
|
||||||
|
|
||||||
|
type Payload = FromSchema<typeof SchemaData>;
|
||||||
|
|
||||||
|
export class DelGroupNotice extends BaseAction<Payload, any> {
|
||||||
|
actionName = ActionName.DelGroupNotice;
|
||||||
|
PayloadSchema = SchemaData;
|
||||||
|
|
||||||
|
async _handle(payload: Payload) {
|
||||||
|
const NTQQGroupApi = this.CoreContext.apis.GroupApi;
|
||||||
|
const group = payload.group_id.toString();
|
||||||
|
const feedId = payload.feed_id;
|
||||||
|
return await NTQQGroupApi.deleteGroupBulletin(group, feedId);
|
||||||
|
}
|
||||||
|
}
|
@ -80,6 +80,7 @@ import GetGuildProfile from './guild/GetGuildProfile';
|
|||||||
import SetModelShow from './go-cqhttp/SetModelShow';
|
import SetModelShow from './go-cqhttp/SetModelShow';
|
||||||
import { SetInputStatus } from './extends/SetInputStatus';
|
import { SetInputStatus } from './extends/SetInputStatus';
|
||||||
import { GetCSRF } from './system/GetCSRF';
|
import { GetCSRF } from './system/GetCSRF';
|
||||||
|
import { DelGroupNotice } from './group/DelGroupNotice';
|
||||||
|
|
||||||
export type ActionMap = Map<string, BaseAction<any, any>>;
|
export type ActionMap = Map<string, BaseAction<any, any>>;
|
||||||
|
|
||||||
@ -169,6 +170,7 @@ export function createActionMap(onebotContext: NapCatOneBot11Adapter, coreContex
|
|||||||
new SetModelShow(onebotContext, coreContext),
|
new SetModelShow(onebotContext, coreContext),
|
||||||
new SetInputStatus(onebotContext, coreContext),
|
new SetInputStatus(onebotContext, coreContext),
|
||||||
new GetCSRF(onebotContext, coreContext),
|
new GetCSRF(onebotContext, coreContext),
|
||||||
|
new DelGroupNotice(onebotContext, coreContext),
|
||||||
];
|
];
|
||||||
const actionMap = new Map();
|
const actionMap = new Map();
|
||||||
for (const action of actionHandlers) {
|
for (const action of actionHandlers) {
|
||||||
|
@ -109,4 +109,5 @@ export enum ActionName {
|
|||||||
SetModelShow = "_set_model_show",
|
SetModelShow = "_set_model_show",
|
||||||
SetInputStatus = "set_input_status",
|
SetInputStatus = "set_input_status",
|
||||||
GetCSRF = "get_csrf_token",
|
GetCSRF = "get_csrf_token",
|
||||||
|
DelGroupNotice = "_del_group_notice",
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user