This commit is contained in:
手瓜一十雪
2024-11-28 15:28:09 +08:00
parent bbfeac46dd
commit 06eba28b4c

View File

@@ -66,31 +66,31 @@ export class OneBotGroupApi {
return undefined; return undefined;
} }
async parseGroupIncreaseEvent(GroupCode: string, grayTipElement: GrayTipElement) { // async parseGroupIncreaseEvent(GroupCode: string, grayTipElement: GrayTipElement) {
this.core.context.logger.logDebug('收到新人被邀请进群消息', grayTipElement); // this.core.context.logger.logDebug('收到新人被邀请进群消息', grayTipElement);
const xmlElement = grayTipElement.xmlElement; // const xmlElement = grayTipElement.xmlElement;
if (xmlElement?.content) { // if (xmlElement?.content) {
const regex = /jp="(\d+)"/g; // const regex = /jp="(\d+)"/g;
const matches = []; // const matches = [];
let match = null; // let match = null;
while ((match = regex.exec(xmlElement.content)) !== null) { // while ((match = regex.exec(xmlElement.content)) !== null) {
matches.push(match[1]); // matches.push(match[1]);
} // }
if (matches.length === 2) { // if (matches.length === 2) {
const [inviter, invitee] = matches; // const [inviter, invitee] = matches;
return new OB11GroupIncreaseEvent( // return new OB11GroupIncreaseEvent(
this.core, // this.core,
parseInt(GroupCode), // parseInt(GroupCode),
parseInt(invitee), // parseInt(invitee),
parseInt(inviter), // parseInt(inviter),
'invite', // 'invite',
); // );
} // }
} // }
return undefined; // return undefined;
} // }
// async parseGroupMemberIncreaseEvent(GroupCode: string, grayTipElement: GrayTipElement) { // async parseGroupMemberIncreaseEvent(GroupCode: string, grayTipElement: GrayTipElement) {
// const groupElement = grayTipElement?.groupElement; // const groupElement = grayTipElement?.groupElement;
@@ -304,9 +304,8 @@ export class OneBotGroupApi {
// 筛选出表情回应 事件 // 筛选出表情回应 事件
if (grayTipElement.xmlElement?.templId === '10382') { if (grayTipElement.xmlElement?.templId === '10382') {
return await this.obContext.apis.GroupApi.parseGroupEmojiLikeEventByGrayTip(msg.peerUid, grayTipElement); return await this.obContext.apis.GroupApi.parseGroupEmojiLikeEventByGrayTip(msg.peerUid, grayTipElement);
} else { } else {
return await this.obContext.apis.GroupApi.parseGroupIncreaseEvent(msg.peerUid, grayTipElement); //return await this.obContext.apis.GroupApi.parseGroupIncreaseEvent(msg.peerUid, grayTipElement);
} }
} else if (grayTipElement.subElementType == NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_JSON) { } else if (grayTipElement.subElementType == NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_JSON) {
// 解析json事件 // 解析json事件