llonebot-dist 8.0.1 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/llbot.js CHANGED
@@ -10933,16 +10933,35 @@ var Msg;
10933
10933
  buf: ProtoField(11, "bytes", "optional")
10934
10934
  }, "optional"),
10935
10935
  notOnlineImage: ProtoField(4, {
10936
- filePath: ProtoField(1, "string", "optional"),
10937
- fileLen: ProtoField(2, "uint32", "optional"),
10938
- downloadPath: ProtoField(3, "string", "optional"),
10939
- picMd5: ProtoField(7, "bytes", "optional"),
10940
- picHeight: ProtoField(8, "uint32", "optional"),
10941
- picWidth: ProtoField(9, "uint32", "optional"),
10942
- resId: ProtoField(10, "string", "optional"),
10943
- thumbUrl: ProtoField(12, "string", "optional"),
10944
- bigUrl: ProtoField(14, "string", "optional"),
10945
- origUrl: ProtoField(15, "string", "optional")
10936
+ filePath: ProtoField(1, "string"),
10937
+ fileLen: ProtoField(2, "uint32"),
10938
+ downloadPath: ProtoField(3, "bytes"),
10939
+ oldVerSendFile: ProtoField(4, "bytes"),
10940
+ imgType: ProtoField(5, "uint32"),
10941
+ previewsImage: ProtoField(6, "bytes"),
10942
+ picMd5: ProtoField(7, "bytes"),
10943
+ picHeight: ProtoField(8, "uint32"),
10944
+ picWidth: ProtoField(9, "uint32"),
10945
+ resId: ProtoField(10, "string"),
10946
+ flag: ProtoField(11, "bytes"),
10947
+ thumbUrl: ProtoField(12, "string"),
10948
+ original: ProtoField(13, "uint32"),
10949
+ bigUrl: ProtoField(14, "string"),
10950
+ origUrl: ProtoField(15, "string"),
10951
+ bizType: ProtoField(16, "uint32"),
10952
+ result: ProtoField(17, "uint32"),
10953
+ index: ProtoField(18, "uint32"),
10954
+ opFaceBuf: ProtoField(19, "bytes"),
10955
+ oldPicMd5: ProtoField(20, "bool"),
10956
+ thumbWidth: ProtoField(21, "uint32"),
10957
+ thumbHeight: ProtoField(22, "uint32"),
10958
+ fileId: ProtoField(23, "uint32"),
10959
+ showLen: ProtoField(24, "uint32"),
10960
+ downloadLen: ProtoField(25, "uint32"),
10961
+ url400: ProtoField(26, "string"),
10962
+ width400: ProtoField(27, "uint32"),
10963
+ height400: ProtoField(28, "uint32"),
10964
+ pbReserve: ProtoField(29, "bytes")
10946
10965
  }, "optional"),
10947
10966
  transElemInfo: ProtoField(5, {
10948
10967
  elemType: ProtoField(1, "uint32"),
@@ -10960,15 +10979,55 @@ var Msg;
10960
10979
  height: ProtoField(11, "uint32", "optional")
10961
10980
  }, "optional"),
10962
10981
  customFace: ProtoField(8, {
10963
- filePath: ProtoField(2, "string", "optional"),
10964
- fileId: ProtoField(7, "uint32", "optional"),
10965
- md5: ProtoField(13, "bytes", "optional"),
10966
- thumbUrl: ProtoField(14, "string", "optional"),
10967
- bigUrl: ProtoField(15, "string", "optional"),
10968
- origUrl: ProtoField(16, "string", "optional"),
10969
- width: ProtoField(22, "uint32", "optional"),
10970
- height: ProtoField(23, "uint32", "optional"),
10971
- size: ProtoField(25, "uint32", "optional")
10982
+ guid: ProtoField(1, "bytes"),
10983
+ filePath: ProtoField(2, "string"),
10984
+ shortcut: ProtoField(3, "string"),
10985
+ buffer: ProtoField(4, "bytes"),
10986
+ flag: ProtoField(5, "bytes"),
10987
+ oldData: ProtoField(6, "bytes", "optional"),
10988
+ fileId: ProtoField(7, "uint32"),
10989
+ serverIp: ProtoField(8, "int32", "optional"),
10990
+ serverPort: ProtoField(9, "int32", "optional"),
10991
+ fileType: ProtoField(10, "int32"),
10992
+ signature: ProtoField(11, "bytes"),
10993
+ useful: ProtoField(12, "int32"),
10994
+ md5: ProtoField(13, "bytes"),
10995
+ thumbUrl: ProtoField(14, "string"),
10996
+ bigUrl: ProtoField(15, "string"),
10997
+ origUrl: ProtoField(16, "string"),
10998
+ bizType: ProtoField(17, "int32"),
10999
+ repeatIndex: ProtoField(18, "int32"),
11000
+ repeatImage: ProtoField(19, "int32"),
11001
+ imageType: ProtoField(20, "int32"),
11002
+ index: ProtoField(21, "int32"),
11003
+ width: ProtoField(22, "int32"),
11004
+ height: ProtoField(23, "int32"),
11005
+ source: ProtoField(24, "int32"),
11006
+ size: ProtoField(25, "uint32"),
11007
+ origin: ProtoField(26, "int32"),
11008
+ thumbWidth: ProtoField(27, "int32", "optional"),
11009
+ thumbHeight: ProtoField(28, "int32", "optional"),
11010
+ showLen: ProtoField(29, "int32"),
11011
+ downloadLen: ProtoField(30, "int32"),
11012
+ x400Url: ProtoField(31, "string", "optional"),
11013
+ x400Width: ProtoField(32, "int32"),
11014
+ x400Height: ProtoField(33, "int32"),
11015
+ pbReserve: ProtoField(34, {
11016
+ subType: ProtoField(1, "int32"),
11017
+ field3: ProtoField(3, "int32"),
11018
+ field4: ProtoField(4, "int32"),
11019
+ summary: ProtoField(9, "string"),
11020
+ field10: ProtoField(10, "int32"),
11021
+ field21: ProtoField(21, {
11022
+ field1: ProtoField(1, "int32"),
11023
+ field2: ProtoField(2, "string"),
11024
+ field3: ProtoField(3, "int32"),
11025
+ field4: ProtoField(4, "int32"),
11026
+ field5: ProtoField(5, "int32"),
11027
+ md5Str: ProtoField(7, "string")
11028
+ }),
11029
+ field31: ProtoField(31, "string")
11030
+ }, "optional")
10972
11031
  }, "optional"),
10973
11032
  richMsg: ProtoField(12, {
10974
11033
  template: ProtoField(1, "bytes"),
@@ -17248,6 +17307,46 @@ function parseElements(elems) {
17248
17307
  });
17249
17308
  continue;
17250
17309
  }
17310
+ if (elem.notOnlineImage) {
17311
+ const img = elem.notOnlineImage;
17312
+ result.push({
17313
+ elementType: ElementType.Pic,
17314
+ picElement: {
17315
+ fileName: img.filePath,
17316
+ fileSize: img.fileLen,
17317
+ picWidth: img.picWidth,
17318
+ picHeight: img.picHeight,
17319
+ md5HexStr: img.picMd5.toString("hex"),
17320
+ sourcePath: "",
17321
+ picType: img.imgType,
17322
+ picSubType: img.bizType,
17323
+ fileUuid: img.resId.split("-")[1],
17324
+ originImageUrl: img.origUrl,
17325
+ summary: ""
17326
+ }
17327
+ });
17328
+ continue;
17329
+ }
17330
+ if (elem.customFace) {
17331
+ const cf = elem.customFace;
17332
+ result.push({
17333
+ elementType: ElementType.Pic,
17334
+ picElement: {
17335
+ fileName: cf.filePath,
17336
+ fileSize: cf.size,
17337
+ picWidth: cf.width,
17338
+ picHeight: cf.height,
17339
+ md5HexStr: cf.md5.toString("hex"),
17340
+ sourcePath: "",
17341
+ picSubType: cf.bizType,
17342
+ fileUuid: cf.fileId.toString(),
17343
+ originImageUrl: cf.origUrl,
17344
+ picType: cf.imageType,
17345
+ summary: ""
17346
+ }
17347
+ });
17348
+ continue;
17349
+ }
17251
17350
  if (elem.marketFace) {
17252
17351
  const mf = elem.marketFace;
17253
17352
  result.push({
@@ -18857,7 +18956,7 @@ var OB11HeartbeatEvent = class extends OB11BaseMetaEvent {
18857
18956
  };
18858
18957
  //#endregion
18859
18958
  //#region src/version.ts
18860
- var version$3 = "8.0.1";
18959
+ var version$3 = "8.0.2";
18861
18960
  //#endregion
18862
18961
  //#region node_modules/sift/es5m/index.js
18863
18962
  /******************************************************************************
@@ -55974,16 +56073,16 @@ var MessageBuilding = class MessageBuilding {
55974
56073
  attr6Buf: attr6
55975
56074
  } });
55976
56075
  } else if (textElement.atType === 2) {
55977
- const attr6 = Buffer.alloc(20);
55978
- attr6.writeUInt16BE(1, 0);
55979
- attr6.writeUInt16BE(0, 2);
55980
- attr6.writeUInt16BE(textElement.content.length, 4);
55981
- attr6.writeUInt8(0, 6);
55982
- attr6.writeUInt32BE(textElement.atUin, 7);
55983
- attr6.writeUInt16BE(0, 11);
56076
+ const attr6Buf = Buffer.alloc(20);
56077
+ attr6Buf.writeUInt16BE(1, 0);
56078
+ attr6Buf.writeUInt16BE(0, 2);
56079
+ attr6Buf.writeUInt16BE(textElement.content.length, 4);
56080
+ attr6Buf.writeUInt8(0, 6);
56081
+ attr6Buf.writeUInt32BE(textElement.atUin, 7);
56082
+ attr6Buf.writeUInt16BE(0, 11);
55984
56083
  this.outputElems.push({ text: {
55985
56084
  str: textElement.content,
55986
- attr6Buf: attr6
56085
+ attr6Buf
55987
56086
  } });
55988
56087
  } else this.outputElems.push({ text: { str: textElement.content } });
55989
56088
  }
@@ -56071,6 +56170,19 @@ var MessageBuilding = class MessageBuilding {
56071
56170
  attr: { ntMsgSeq: replyElement.replyMsgClientSeq ? replyElement.replyMsgSeq : void 0 },
56072
56171
  srcMsg: replyElement.srcMsg
56073
56172
  } });
56173
+ const attr6Buf = Buffer.alloc(20);
56174
+ attr6Buf.writeUInt16BE(1, 0);
56175
+ attr6Buf.writeUInt16BE(0, 2);
56176
+ attr6Buf.writeUInt16BE(1, 4);
56177
+ attr6Buf.writeUInt8(0, 6);
56178
+ attr6Buf.writeUInt32BE(replyElement.senderUin, 7);
56179
+ attr6Buf.writeUInt16BE(0, 11);
56180
+ const pbReserve = Msg.TextResvAttr.encode({ atMemberUin: 0 });
56181
+ this.outputElems.push({ text: {
56182
+ str: "@",
56183
+ attr6Buf,
56184
+ pbReserve
56185
+ } }, { text: { str: " " } });
56074
56186
  }
56075
56187
  async [ElementType.Pic](data) {
56076
56188
  const { picElement: p } = data;
@@ -56272,6 +56384,7 @@ var NTMsgApi = class extends Service {
56272
56384
  }
56273
56385
  const random = randomBytes(4).readUInt32BE(0);
56274
56386
  const echoP = peer.chatType === ChatType.Group ? this.waitForSelfEcho(peer, random, 7e3) : null;
56387
+ echoP?.catch(() => {});
56275
56388
  const ret = await this.ctx.qqProtocol.sendMessage({
56276
56389
  chatType,
56277
56390
  groupCode,
@@ -73252,7 +73365,34 @@ var DirectProtocolClient = class extends EventEmitter {
73252
73365
  "trpc.o3.ecdh_access.EcdhAccess.SsoEstablishShareKey",
73253
73366
  "trpc.o3.ecdh_access.EcdhAccess.SsoSecureAccess",
73254
73367
  "MessageSvc.PbSendMsg",
73255
- "OidbSvcTrpcTcp.0x6d9_4"
73368
+ "OidbSvcTrpcTcp.0x6d9_4",
73369
+ "OidbSvcTrpcTcp.0x929b_0",
73370
+ "OidbSvcTrpcTcp.0xfe1_2",
73371
+ "OidbSvcTrpcTcp.0xfe1_8",
73372
+ "OidbSvcTrpcTcp.0x102a_1",
73373
+ "OidbSvcTrpcTcp.0x102a_0",
73374
+ "OidbSvcTrpcTcp.0xfd4_1",
73375
+ "OidbSvcTrpcTcp.0xfe5_2",
73376
+ "OidbSvcTrpcTcp.0x5cf_11",
73377
+ "OidbSvcTrpcTcp.0x10c0_1",
73378
+ "OidbSvcTrpcTcp.0x10c0_2",
73379
+ "OidbSvcTrpcTcp.0x10c8_1",
73380
+ "OidbSvcTrpcTcp.0x972_6",
73381
+ "OidbSvcTrpcTcp.0x8fc_3",
73382
+ "OidbSvcTrpcTcp.0x6d6_2",
73383
+ "OidbSvcTrpcTcp.0x6d6_3",
73384
+ "OidbSvcTrpcTcp.0xe37_1700",
73385
+ "OidbSvcTrpcTcp.0xe37_1200",
73386
+ "OidbSvcTrpcTcp.0x11c5_100",
73387
+ "OidbSvcTrpcTcp.0x11c5_200",
73388
+ "OidbSvcTrpcTcp.0x11c4_100",
73389
+ "OidbSvcTrpcTcp.0x11c4_200",
73390
+ "OidbSvcTrpcTcp.0x11e9_100",
73391
+ "OidbSvcTrpcTcp.0x11e9_200",
73392
+ "OidbSvcTrpcTcp.0x126d_200",
73393
+ "OidbSvcTrpcTcp.0x126e_200",
73394
+ "trpc.group.long_msg_interface.MsgService.SsoRecvLongMsg",
73395
+ "OidbSvcTrpcTcp.0x88d_0"
73256
73396
  ]);
73257
73397
  async sendCommand(cmd, payload, encryptType, timeout = 15e3) {
73258
73398
  const seq = this.nextSeq();
@@ -74348,14 +74488,6 @@ function handleLine(socket, line) {
74348
74488
  }
74349
74489
  //#endregion
74350
74490
  //#region src/main/qqProtocol/base.ts
74351
- var requireForVersion = createRequire(import.meta.url);
74352
- function readBotVersion() {
74353
- try {
74354
- return requireForVersion("../../../../package.json").version ?? "unknown";
74355
- } catch {
74356
- return "unknown";
74357
- }
74358
- }
74359
74491
  var QQProtocolBase = class extends Service {
74360
74492
  ctx;
74361
74493
  static inject = ["config"];
@@ -74700,7 +74832,7 @@ var QQProtocolBase = class extends Service {
74700
74832
  const uinForInit = persisted ? Number(persisted.uin) : void 0;
74701
74833
  this.directClient = new DirectProtocolClient({
74702
74834
  authToken,
74703
- botVersion: readBotVersion(),
74835
+ botVersion: `LLBot_${version$3}`,
74704
74836
  uin: Number.isFinite(uinForInit) && uinForInit > 0 ? uinForInit : void 0
74705
74837
  });
74706
74838
  this.directClient.on("error", (err) => {
@@ -77218,8 +77350,7 @@ function UserMixin(Base) {
77218
77350
  const data = Oidb.Base.encode({
77219
77351
  command: 4065,
77220
77352
  subCommand: 2,
77221
- body,
77222
- ...process.env.QQ_USE_PMHQ ? { isReserved: 1 } : {}
77353
+ body
77223
77354
  });
77224
77355
  const res = await this.sendPB("OidbSvcTrpcTcp.0xfe1_2", data);
77225
77356
  const decoded = Oidb.Base.decode(Buffer.from(res.pb, "hex"));
@@ -77738,6 +77869,12 @@ async function onLoad() {
77738
77869
  else ctx.qqProtocol.startHook();
77739
77870
  });
77740
77871
  }
77872
+ process.on("unhandledRejection", (reason) => {
77873
+ console.error("[unhandledRejection]", reason);
77874
+ });
77875
+ process.on("uncaughtException", (err) => {
77876
+ console.error("[uncaughtException]", err);
77877
+ });
77741
77878
  onLoad().catch((e) => console.error(e));
77742
77879
  //#endregion
77743
77880
  export {};