mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: #875
This commit is contained in:
@@ -345,9 +345,9 @@ export class NTQQGroupApi {
|
|||||||
return this.context.session.getGroupService().uploadGroupBulletinPic(groupCode, _Pskey, imageurl);
|
return this.context.session.getGroupService().uploadGroupBulletinPic(groupCode, _Pskey, imageurl);
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleGroupRequest(notify: GroupNotify, operateType: NTGroupRequestOperateTypes, reason?: string) {
|
async handleGroupRequest(doubt: boolean, notify: GroupNotify, operateType: NTGroupRequestOperateTypes, reason?: string) {
|
||||||
return this.context.session.getGroupService().operateSysNotify(
|
return this.context.session.getGroupService().operateSysNotify(
|
||||||
false,
|
doubt,
|
||||||
{
|
{
|
||||||
operateType: operateType,
|
operateType: operateType,
|
||||||
targetMsg: {
|
targetMsg: {
|
||||||
|
@@ -20,11 +20,12 @@ export default class SetGroupAddRequest extends OneBotAction<Payload, null> {
|
|||||||
const approve = payload.approve?.toString() !== 'false';
|
const approve = payload.approve?.toString() !== 'false';
|
||||||
const reason = payload.reason ?? ' ';
|
const reason = payload.reason ?? ' ';
|
||||||
const invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(flag);
|
const invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(flag);
|
||||||
const notify = invite_notify ?? await this.findNotify(flag);
|
const { doubt, notify } = invite_notify ? { doubt: false, notify: invite_notify } : await this.findNotify(flag);
|
||||||
if (!notify) {
|
if (!notify) {
|
||||||
throw new Error('No such request');
|
throw new Error('No such request');
|
||||||
}
|
}
|
||||||
await this.core.apis.GroupApi.handleGroupRequest(
|
await this.core.apis.GroupApi.handleGroupRequest(
|
||||||
|
doubt,
|
||||||
notify,
|
notify,
|
||||||
approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
||||||
reason,
|
reason,
|
||||||
@@ -36,7 +37,8 @@ export default class SetGroupAddRequest extends OneBotAction<Payload, null> {
|
|||||||
let notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(false, 100)).find(e => e.seq == flag);
|
let notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(false, 100)).find(e => e.seq == flag);
|
||||||
if (!notify) {
|
if (!notify) {
|
||||||
notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(true, 100)).find(e => e.seq == flag);
|
notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(true, 100)).find(e => e.seq == flag);
|
||||||
|
return { doubt: true, notify };
|
||||||
}
|
}
|
||||||
return notify;
|
return { doubt: true, notify };
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -84,17 +84,19 @@ export class OneBotQuickActionApi {
|
|||||||
let notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(false, 100)).find(e => e.seq == flag);
|
let notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(false, 100)).find(e => e.seq == flag);
|
||||||
if (!notify) {
|
if (!notify) {
|
||||||
notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(true, 100)).find(e => e.seq == flag);
|
notify = (await this.core.apis.GroupApi.getSingleScreenNotifies(true, 100)).find(e => e.seq == flag);
|
||||||
|
return { doubt: true, notify };
|
||||||
}
|
}
|
||||||
return notify;
|
return { doubt: true, notify };
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleGroupRequest(request: OB11GroupRequestEvent, quickAction: QuickActionGroupRequest) {
|
async handleGroupRequest(request: OB11GroupRequestEvent, quickAction: QuickActionGroupRequest) {
|
||||||
|
|
||||||
const invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(request.flag);
|
const invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(request.flag);
|
||||||
const notify = invite_notify ?? await this.findNotify(request.flag);
|
const { doubt, notify } = invite_notify ? { doubt: false, notify: invite_notify } : await this.findNotify(request.flag);
|
||||||
|
|
||||||
if (!isNull(quickAction.approve) && notify) {
|
if (!isNull(quickAction.approve) && notify) {
|
||||||
this.core.apis.GroupApi.handleGroupRequest(
|
this.core.apis.GroupApi.handleGroupRequest(
|
||||||
|
doubt,
|
||||||
notify,
|
notify,
|
||||||
quickAction.approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
quickAction.approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
||||||
quickAction.reason,
|
quickAction.reason,
|
||||||
|
@@ -10,6 +10,7 @@ export enum OB11MessageType {
|
|||||||
|
|
||||||
// 消息接口定义
|
// 消息接口定义
|
||||||
export interface OB11Message {
|
export interface OB11Message {
|
||||||
|
real_seq?: string;// 自行扩展
|
||||||
temp_source?: number;
|
temp_source?: number;
|
||||||
message_sent_type?: string;
|
message_sent_type?: string;
|
||||||
target_id?: number; // 自己发送消息/私聊消息
|
target_id?: number; // 自己发送消息/私聊消息
|
||||||
|
Reference in New Issue
Block a user