style: lint

This commit is contained in:
手瓜一十雪 2024-09-26 16:08:50 +08:00
parent 1c212ff2b4
commit 90906b9019
6 changed files with 43 additions and 59 deletions

View File

@ -15,14 +15,14 @@ export class OneBotFriendApi {
//使用前预先判断 busiId 1061 //使用前预先判断 busiId 1061
async parsePrivatePokeEvent(grayTipElement: GrayTipElement) { async parsePrivatePokeEvent(grayTipElement: GrayTipElement) {
const json = JSON.parse(grayTipElement.jsonGrayTipElement.jsonStr); const json = JSON.parse(grayTipElement.jsonGrayTipElement.jsonStr);
let pokedetail: any[] = json.items; let pokedetail: Array<{ uid: string }> = json.items;
//筛选item带有uid的元素 //筛选item带有uid的元素
pokedetail = pokedetail.filter(item => item.uid); pokedetail = pokedetail.filter(item => item.uid);
if (pokedetail.length == 2) { if (pokedetail.length == 2) {
return new OB11FriendPokeEvent( return new OB11FriendPokeEvent(
this.core, this.core,
parseInt((await this.core.apis.UserApi.getUinByUidV2(pokedetail[0].uid))!), parseInt((await this.core.apis.UserApi.getUinByUidV2(pokedetail[0].uid))),
parseInt((await this.core.apis.UserApi.getUinByUidV2(pokedetail[1].uid))!), parseInt((await this.core.apis.UserApi.getUinByUidV2(pokedetail[1].uid))),
pokedetail, pokedetail,
); );
} }

View File

@ -96,7 +96,6 @@ export class OneBotGroupApi {
if (GroupIncreaseEvent) return GroupIncreaseEvent; if (GroupIncreaseEvent) return GroupIncreaseEvent;
} }
//代码歧义 GrayTipElementSubType.MEMBER_NEW_TITLE
else if (element.grayTipElement.subElementType == NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_JSON) { else if (element.grayTipElement.subElementType == NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_JSON) {
const json = JSON.parse(element.grayTipElement.jsonGrayTipElement.jsonStr); const json = JSON.parse(element.grayTipElement.jsonGrayTipElement.jsonStr);
if (element.grayTipElement.jsonGrayTipElement.busiId == 1061) { if (element.grayTipElement.jsonGrayTipElement.busiId == 1061) {
@ -139,7 +138,6 @@ export class OneBotGroupApi {
// 获取MsgSeq+Peer可获取具体消息 // 获取MsgSeq+Peer可获取具体消息
} }
if (element.grayTipElement.jsonGrayTipElement.busiId == 2407) { if (element.grayTipElement.jsonGrayTipElement.busiId == 2407) {
//下面得改 上面也是错的grayTipElement.subElementType == GrayTipElementSubType.MEMBER_NEW_TITLE
const type = json.items[json.items.length - 1]?.txt; const type = json.items[json.items.length - 1]?.txt;
switch (type) { switch (type) {
case "头衔": { case "头衔": {
@ -207,7 +205,6 @@ export class OneBotGroupApi {
while ((match = regex.exec(xmlElement.content)) !== null) { while ((match = regex.exec(xmlElement.content)) !== null) {
matches.push(match[1]); matches.push(match[1]);
} }
// log("新人进群匹配到的QQ号", matches)
if (matches.length === 2) { if (matches.length === 2) {
const [inviter, invitee] = matches; const [inviter, invitee] = matches;
return new OB11GroupIncreaseEvent( return new OB11GroupIncreaseEvent(

View File

@ -457,17 +457,6 @@ export class OneBotMsgApi {
}, },
}; };
}, },
// {
// elementId: '0',
// elementType: 6,
// faceElement: {
// faceIndex: 0,
// faceType: 5,
// msgType: 0,
// pokeType: 1,
// pokeStrength: 0
// }
// }
[OB11MessageDataType.mface]: async ({ [OB11MessageDataType.mface]: async ({
data: { data: {
emoji_package_id, emoji_id, key, summary, emoji_package_id, emoji_id, key, summary,
@ -530,13 +519,12 @@ export class OneBotMsgApi {
faceElement: { faceElement: {
faceIndex: FaceIndex.dice, faceIndex: FaceIndex.dice,
faceType: FaceType.dice, faceType: FaceType.dice,
'faceText': '[骰子]', faceText: '[骰子]',
'packId': '1', packId: '1',
'stickerId': '33', stickerId: '33',
'sourceType': 1, sourceType: 1,
'stickerType': 2, stickerType: 2,
// resultId: resultId.toString(), surpriseId: '',
'surpriseId': '',
// "randomType": 1, // "randomType": 1,
}, },
}), }),
@ -545,15 +533,14 @@ export class OneBotMsgApi {
elementType: ElementType.FACE, elementType: ElementType.FACE,
elementId: '', elementId: '',
faceElement: { faceElement: {
'faceIndex': FaceIndex.RPS, faceIndex: FaceIndex.RPS,
'faceText': '[包剪锤]', faceText: '[包剪锤]',
'faceType': 3, faceType: 3,
'packId': '1', packId: '1',
'stickerId': '34', stickerId: '34',
'sourceType': 1, sourceType: 1,
'stickerType': 2, stickerType: 2,
// 'resultId': resultId.toString(), surpriseId: '',
'surpriseId': '',
// "randomType": 1, // "randomType": 1,
}, },
}), }),

View File

@ -119,7 +119,7 @@ export async function NCoreInitShell() {
quickLoginUin = ''; quickLoginUin = '';
} }
} }
let dataTimestape = new Date().getTime().toString(); const dataTimestape = new Date().getTime().toString();
o3Service.reportAmgomWeather('login', 'a1', [dataTimestape, '0', '0']); o3Service.reportAmgomWeather('login', 'a1', [dataTimestape, '0', '0']);
const selfInfo = await new Promise<SelfInfo>((resolve) => { const selfInfo = await new Promise<SelfInfo>((resolve) => {
const loginListener = new NodeIKernelLoginListener(); const loginListener = new NodeIKernelLoginListener();
@ -240,7 +240,7 @@ export async function NCoreInitShell() {
} }
}); });
// BEFORE LOGGING IN // BEFORE LOGGING IN
let amgomDataPiece = 'eb1fd6ac257461580dc7438eb099f23aae04ca679f4d88f53072dc56e3bb1129'; const amgomDataPiece = 'eb1fd6ac257461580dc7438eb099f23aae04ca679f4d88f53072dc56e3bb1129';
o3Service.setAmgomDataPiece(basicInfoWrapper.QQVersionAppid, new Uint8Array(Buffer.from(amgomDataPiece, 'hex'))); o3Service.setAmgomDataPiece(basicInfoWrapper.QQVersionAppid, new Uint8Array(Buffer.from(amgomDataPiece, 'hex')));
// AFTER LOGGING IN // AFTER LOGGING IN
//99b15bdb4c984fc69d5aa1feb9aa16xx --> 99b15bdb-4c98-4fc6-9d5a-a1feb9aa16xx //99b15bdb4c984fc69d5aa1feb9aa16xx --> 99b15bdb-4c98-4fc6-9d5a-a1feb9aa16xx