chore: 解耦

This commit is contained in:
手瓜一十雪
2024-08-22 14:05:01 +08:00
parent 5eacfae031
commit 419c0f87d1
19 changed files with 667 additions and 667 deletions

View File

@@ -45,6 +45,32 @@ export class OneBotGroupApi {
}
return undefined;
}
async parseGroupIncreaseEvent(GroupCode: string, grayTipElement: GrayTipElement) {
this.coreContext.context.logger.logDebug('收到新人被邀请进群消息', grayTipElement);
const xmlElement = grayTipElement.xmlElement;
if (xmlElement?.content) {
const regex = /jp="(\d+)"/g;
const matches = [];
let match = null;
while ((match = regex.exec(xmlElement.content)) !== null) {
matches.push(match[1]);
}
// log("新人进群匹配到的QQ号", matches)
if (matches.length === 2) {
const [inviter, invitee] = matches;
return new OB11GroupIncreaseEvent(
this.coreContext,
parseInt(GroupCode),
parseInt(invitee),
parseInt(inviter),
'invite'
);
}
}
return undefined;
}
async parseGroupMemberIncreaseEvent(GroupCode: string, grayTipElement: GrayTipElement) {
const NTQQGroupApi = this.coreContext.apis.GroupApi;
let groupElement = grayTipElement?.groupElement;