mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
build: 1.3.5-beta36
get_group_system_msg 未标准化
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
import { NTQQGroupApi } from '@/core';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { NTQQMsgApi } from '@/core/apis/msg';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
group_id: { type: 'number' }
|
||||
},
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
export class GetGroupSystemMsg extends BaseAction<void, void> {
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetGroupSystemMsg extends BaseAction<void, any> {
|
||||
actionName = ActionName.GetGroupSystemMsg;
|
||||
protected async _handle(payload: void) {
|
||||
|
||||
// 默认10条 该api未完整实现 包括响应数据规范化 类型规范化
|
||||
return await NTQQGroupApi.getSingleScreenNotifies(10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ import { SendGroupNotice } from './go-cqhttp/SendGroupNotice';
|
||||
import { Reboot, RebootNormol } from './system/Reboot';
|
||||
import { GetGroupHonorInfo } from './go-cqhttp/GetGroupHonorInfo';
|
||||
import { GoCQHTTHandleQuickAction } from './go-cqhttp/QuickAction';
|
||||
import { GetGroupSystemMsg } from './group/GetGroupSystemMsg';
|
||||
|
||||
export const actionHandlers = [
|
||||
new RebootNormol(),
|
||||
@@ -118,7 +119,8 @@ export const actionHandlers = [
|
||||
new GoCQHTTPGetGroupMsgHistory(),
|
||||
new GoCQHTTGetForwardMsgAction(),
|
||||
new GetFriendMsgHistory(),
|
||||
new GoCQHTTHandleQuickAction()
|
||||
new GoCQHTTHandleQuickAction(),
|
||||
new GetGroupSystemMsg()
|
||||
];
|
||||
|
||||
function initActionMap() {
|
||||
|
||||
@@ -127,6 +127,7 @@ export class NapCatOnebot11 {
|
||||
// BuddyListener
|
||||
const buddyListener = new BuddyListener();
|
||||
buddyListener.onBuddyReqChange = ((req) => {
|
||||
//从这里获取?好友请求
|
||||
this.postFriendRequest(req.buddyReqs).then().catch(logError);
|
||||
});
|
||||
napCatCore.addListener(buddyListener);
|
||||
@@ -298,7 +299,7 @@ export class NapCatOnebot11 {
|
||||
// if (notify.user2.uid) {
|
||||
// member2 = await getGroupMember(notify.group.groupCode, null, notify.user2.uid);
|
||||
// }
|
||||
|
||||
|
||||
if ([GroupNotifyTypes.ADMIN_SET, GroupNotifyTypes.ADMIN_UNSET, GroupNotifyTypes.ADMIN_UNSET_OTHER].includes(notify.type)) {
|
||||
const member1 = await getGroupMember(notify.group.groupCode, notify.user1.uid);
|
||||
logDebug('有管理员变动通知');
|
||||
|
||||
Reference in New Issue
Block a user