llonebot-dist 7.12.8 → 7.12.9
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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import * as path$4 from "node:path";
|
|
3
3
|
import path, { dirname, join } from "node:path";
|
|
4
|
-
import
|
|
5
|
-
import fs
|
|
6
|
-
import * as fs$
|
|
7
|
-
import fs$
|
|
4
|
+
import fsPromise, { access, copyFile, mkdir, readFile, stat, unlink, writeFile } from "node:fs/promises";
|
|
5
|
+
import fs, { existsSync } from "fs";
|
|
6
|
+
import * as fs$5 from "node:fs";
|
|
7
|
+
import fs$1, { appendFile, appendFileSync, createReadStream, existsSync as existsSync$1, mkdirSync, promises, stat as stat$1, statSync, watch } from "node:fs";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
import { Binary, Time, camelize, clone, deduplicate, deepEqual, defineProperty, difference, filterKeys, hyphenate, is, isNonNullable, isNullable, isPlainObject, makeArray, mapValues, noop, omit, pick, remove, valueMap } from "cosmokit";
|
|
10
10
|
import { Exporter, Factory } from "reggol";
|
|
@@ -21,7 +21,7 @@ import http, { STATUS_CODES, createServer, request } from "node:http";
|
|
|
21
21
|
import { Http2ServerRequest, constants as constants$1 } from "node:http2";
|
|
22
22
|
import { Readable, Transform } from "node:stream";
|
|
23
23
|
import { deflateSync, gunzipSync, gzipSync, inflateSync } from "node:zlib";
|
|
24
|
-
import fsPromise, { stat as stat$2, unlink as unlink$1 } from "fs/promises";
|
|
24
|
+
import fsPromise$1, { stat as stat$2, unlink as unlink$1 } from "fs/promises";
|
|
25
25
|
import { inspect, isDeepStrictEqual } from "node:util";
|
|
26
26
|
import net, { connect } from "node:net";
|
|
27
27
|
import https from "node:https";
|
|
@@ -3973,7 +3973,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3973
3973
|
//#endregion
|
|
3974
3974
|
//#region node_modules/qrcode/lib/renderer/png.js
|
|
3975
3975
|
var require_png = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3976
|
-
var fs$
|
|
3976
|
+
var fs$10 = __require("fs");
|
|
3977
3977
|
var PNG = require_png$1().PNG;
|
|
3978
3978
|
var Utils = require_utils$1();
|
|
3979
3979
|
exports.render = function render(qrData, options) {
|
|
@@ -4025,7 +4025,7 @@ var require_png = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4025
4025
|
called = true;
|
|
4026
4026
|
cb.apply(null, args);
|
|
4027
4027
|
};
|
|
4028
|
-
const stream = fs$
|
|
4028
|
+
const stream = fs$10.createWriteStream(path);
|
|
4029
4029
|
stream.on("error", done);
|
|
4030
4030
|
stream.on("close", done);
|
|
4031
4031
|
exports.renderToFileStream(stream, qrData, options);
|
|
@@ -6624,7 +6624,7 @@ async function logSummaryMessage(ctx, message) {
|
|
|
6624
6624
|
var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6625
6625
|
module.exports = isexe;
|
|
6626
6626
|
isexe.sync = sync;
|
|
6627
|
-
var fs$
|
|
6627
|
+
var fs$9 = __require("fs");
|
|
6628
6628
|
function checkPathExt(path, options) {
|
|
6629
6629
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
6630
6630
|
if (!pathext) return true;
|
|
@@ -6641,12 +6641,12 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6641
6641
|
return checkPathExt(path, options);
|
|
6642
6642
|
}
|
|
6643
6643
|
function isexe(path, options, cb) {
|
|
6644
|
-
fs$
|
|
6644
|
+
fs$9.stat(path, function(er, stat) {
|
|
6645
6645
|
cb(er, er ? false : checkStat(stat, path, options));
|
|
6646
6646
|
});
|
|
6647
6647
|
}
|
|
6648
6648
|
function sync(path, options) {
|
|
6649
|
-
return checkStat(fs$
|
|
6649
|
+
return checkStat(fs$9.statSync(path), path, options);
|
|
6650
6650
|
}
|
|
6651
6651
|
}));
|
|
6652
6652
|
//#endregion
|
|
@@ -6654,14 +6654,14 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6654
6654
|
var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6655
6655
|
module.exports = isexe;
|
|
6656
6656
|
isexe.sync = sync;
|
|
6657
|
-
var fs$
|
|
6657
|
+
var fs$8 = __require("fs");
|
|
6658
6658
|
function isexe(path, options, cb) {
|
|
6659
|
-
fs$
|
|
6659
|
+
fs$8.stat(path, function(er, stat) {
|
|
6660
6660
|
cb(er, er ? false : checkStat(stat, options));
|
|
6661
6661
|
});
|
|
6662
6662
|
}
|
|
6663
6663
|
function sync(path, options) {
|
|
6664
|
-
return checkStat(fs$
|
|
6664
|
+
return checkStat(fs$8.statSync(path), options);
|
|
6665
6665
|
}
|
|
6666
6666
|
function checkStat(stat, options) {
|
|
6667
6667
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -9153,7 +9153,7 @@ var require_processor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9153
9153
|
//#endregion
|
|
9154
9154
|
//#region node_modules/fluent-ffmpeg/lib/capabilities.js
|
|
9155
9155
|
var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9156
|
-
var fs$
|
|
9156
|
+
var fs$7 = __require("fs");
|
|
9157
9157
|
var path$7 = __require("path");
|
|
9158
9158
|
var async = require_async();
|
|
9159
9159
|
var utils = require_utils();
|
|
@@ -9229,7 +9229,7 @@ var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9229
9229
|
proto._getFfmpegPath = function(callback) {
|
|
9230
9230
|
if ("ffmpegPath" in cache) return callback(null, cache.ffmpegPath);
|
|
9231
9231
|
async.waterfall([function(cb) {
|
|
9232
|
-
if (process.env.FFMPEG_PATH) fs$
|
|
9232
|
+
if (process.env.FFMPEG_PATH) fs$7.exists(process.env.FFMPEG_PATH, function(exists) {
|
|
9233
9233
|
if (exists) cb(null, process.env.FFMPEG_PATH);
|
|
9234
9234
|
else cb(null, "");
|
|
9235
9235
|
});
|
|
@@ -9260,7 +9260,7 @@ var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9260
9260
|
if ("ffprobePath" in cache) return callback(null, cache.ffprobePath);
|
|
9261
9261
|
async.waterfall([
|
|
9262
9262
|
function(cb) {
|
|
9263
|
-
if (process.env.FFPROBE_PATH) fs$
|
|
9263
|
+
if (process.env.FFPROBE_PATH) fs$7.exists(process.env.FFPROBE_PATH, function(exists) {
|
|
9264
9264
|
cb(null, exists ? process.env.FFPROBE_PATH : "");
|
|
9265
9265
|
});
|
|
9266
9266
|
else cb(null, "");
|
|
@@ -9278,7 +9278,7 @@ var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9278
9278
|
else if (ffmpeg.length) {
|
|
9279
9279
|
var name = utils.isWindows ? "ffprobe.exe" : "ffprobe";
|
|
9280
9280
|
var ffprobe = path$7.join(path$7.dirname(ffmpeg), name);
|
|
9281
|
-
fs$
|
|
9281
|
+
fs$7.exists(ffprobe, function(exists) {
|
|
9282
9282
|
cb(null, exists ? ffprobe : "");
|
|
9283
9283
|
});
|
|
9284
9284
|
} else cb(null, "");
|
|
@@ -9303,14 +9303,14 @@ var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9303
9303
|
if ("flvtoolPath" in cache) return callback(null, cache.flvtoolPath);
|
|
9304
9304
|
async.waterfall([
|
|
9305
9305
|
function(cb) {
|
|
9306
|
-
if (process.env.FLVMETA_PATH) fs$
|
|
9306
|
+
if (process.env.FLVMETA_PATH) fs$7.exists(process.env.FLVMETA_PATH, function(exists) {
|
|
9307
9307
|
cb(null, exists ? process.env.FLVMETA_PATH : "");
|
|
9308
9308
|
});
|
|
9309
9309
|
else cb(null, "");
|
|
9310
9310
|
},
|
|
9311
9311
|
function(flvtool, cb) {
|
|
9312
9312
|
if (flvtool.length) return cb(null, flvtool);
|
|
9313
|
-
if (process.env.FLVTOOL2_PATH) fs$
|
|
9313
|
+
if (process.env.FLVTOOL2_PATH) fs$7.exists(process.env.FLVTOOL2_PATH, function(exists) {
|
|
9314
9314
|
cb(null, exists ? process.env.FLVTOOL2_PATH : "");
|
|
9315
9315
|
});
|
|
9316
9316
|
else cb(null, "");
|
|
@@ -9815,7 +9815,7 @@ var require_ffprobe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9815
9815
|
//#endregion
|
|
9816
9816
|
//#region node_modules/fluent-ffmpeg/lib/recipes.js
|
|
9817
9817
|
var require_recipes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9818
|
-
var fs$
|
|
9818
|
+
var fs$6 = __require("fs");
|
|
9819
9819
|
var path$6 = __require("path");
|
|
9820
9820
|
var PassThrough$4 = __require("stream").PassThrough;
|
|
9821
9821
|
var async = require_async();
|
|
@@ -10021,8 +10021,8 @@ var require_recipes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10021
10021
|
next(null, filenames);
|
|
10022
10022
|
},
|
|
10023
10023
|
function createDirectory(filenames, next) {
|
|
10024
|
-
fs$
|
|
10025
|
-
if (!exists) fs$
|
|
10024
|
+
fs$6.exists(config.folder, function(exists) {
|
|
10025
|
+
if (!exists) fs$6.mkdir(config.folder, function(err) {
|
|
10026
10026
|
if (err) next(err);
|
|
10027
10027
|
else next(null, filenames);
|
|
10028
10028
|
});
|
|
@@ -10270,7 +10270,7 @@ function setFFMpegPath(ffmpegPath) {
|
|
|
10270
10270
|
path.join(import.meta.dirname, "ffmpeg.exe"),
|
|
10271
10271
|
process.env["FFMPEG_PATH"] || ""
|
|
10272
10272
|
];
|
|
10273
|
-
for (const p of paths) if (fs$
|
|
10273
|
+
for (const p of paths) if (fs$1.existsSync(p)) {
|
|
10274
10274
|
import_fluent_ffmpeg.default.setFfmpegPath(p);
|
|
10275
10275
|
console.log("set ffmpeg successfully", p);
|
|
10276
10276
|
break;
|
|
@@ -11385,7 +11385,7 @@ var OB11HeartbeatEvent = class extends OB11BaseMetaEvent {
|
|
|
11385
11385
|
};
|
|
11386
11386
|
//#endregion
|
|
11387
11387
|
//#region src/version.ts
|
|
11388
|
-
var version$2 = "7.12.
|
|
11388
|
+
var version$2 = "7.12.9";
|
|
11389
11389
|
//#endregion
|
|
11390
11390
|
//#region node_modules/sift/es5m/index.js
|
|
11391
11391
|
/******************************************************************************
|
|
@@ -17045,7 +17045,7 @@ var processQueue = async () => {
|
|
|
17045
17045
|
const promises = queue.splice(0, concurrency).map(async ({ filePath, resolve, reject }) => {
|
|
17046
17046
|
let handle;
|
|
17047
17047
|
try {
|
|
17048
|
-
handle = await fs$
|
|
17048
|
+
handle = await fs$5.promises.open(path$4.resolve(filePath), "r");
|
|
17049
17049
|
} catch (err) {
|
|
17050
17050
|
return reject(err);
|
|
17051
17051
|
}
|
|
@@ -17092,7 +17092,7 @@ function checkUriType(uri) {
|
|
|
17092
17092
|
if (uri.startsWith("data:")) return { type: FileUriType.DataURL };
|
|
17093
17093
|
if (uri.startsWith("http://") || uri.startsWith("https://")) return { type: FileUriType.RemoteURL };
|
|
17094
17094
|
if (uri.startsWith("file://")) return { type: FileUriType.FileURL };
|
|
17095
|
-
if (fs$
|
|
17095
|
+
if (fs$1.existsSync(uri)) return { type: FileUriType.Path };
|
|
17096
17096
|
return { type: FileUriType.Unknown };
|
|
17097
17097
|
}
|
|
17098
17098
|
async function fetchFile(url, headersInit) {
|
|
@@ -17122,7 +17122,7 @@ async function uri2local(ctx, uri, needExt) {
|
|
|
17122
17122
|
const { type } = checkUriType(uri);
|
|
17123
17123
|
if (type === FileUriType.FileURL) {
|
|
17124
17124
|
const filePath = fileURLToPath(uri);
|
|
17125
|
-
if (!fs$
|
|
17125
|
+
if (!fs$1.existsSync(filePath)) return {
|
|
17126
17126
|
success: false,
|
|
17127
17127
|
errMsg: "路径不存在",
|
|
17128
17128
|
fileName: "",
|
|
@@ -17148,12 +17148,12 @@ async function uri2local(ctx, uri, needExt) {
|
|
|
17148
17148
|
const res = await fetchFile(uri);
|
|
17149
17149
|
let fileName = randomUUID();
|
|
17150
17150
|
let filePath = path.join(TEMP_DIR, fileName);
|
|
17151
|
-
await
|
|
17151
|
+
await fsPromise.writeFile(filePath, res.data);
|
|
17152
17152
|
if (needExt) {
|
|
17153
17153
|
const ext = (await ctx.ntFileApi.getFileType(filePath)).ext;
|
|
17154
17154
|
fileName += `.${ext}`;
|
|
17155
17155
|
const newPath = `${filePath}.${ext}`;
|
|
17156
|
-
await
|
|
17156
|
+
await fsPromise.rename(filePath, newPath);
|
|
17157
17157
|
filePath = newPath;
|
|
17158
17158
|
}
|
|
17159
17159
|
return {
|
|
@@ -17176,11 +17176,11 @@ async function uri2local(ctx, uri, needExt) {
|
|
|
17176
17176
|
let filename = randomUUID();
|
|
17177
17177
|
let filePath = path.join(TEMP_DIR, filename);
|
|
17178
17178
|
const base64 = uri.replace(/^base64:\/\//, "");
|
|
17179
|
-
await
|
|
17179
|
+
await fsPromise.writeFile(filePath, base64, "base64");
|
|
17180
17180
|
if (needExt) {
|
|
17181
17181
|
const ext = (await ctx.ntFileApi.getFileType(filePath)).ext;
|
|
17182
17182
|
filename += `.${ext}`;
|
|
17183
|
-
await
|
|
17183
|
+
await fsPromise.rename(filePath, `${filePath}.${ext}`);
|
|
17184
17184
|
filePath = `${filePath}.${ext}`;
|
|
17185
17185
|
}
|
|
17186
17186
|
return {
|
|
@@ -17197,11 +17197,11 @@ async function uri2local(ctx, uri, needExt) {
|
|
|
17197
17197
|
let filename = randomUUID();
|
|
17198
17198
|
const [, _type, base64] = capture;
|
|
17199
17199
|
let filePath = path.join(TEMP_DIR, filename);
|
|
17200
|
-
await
|
|
17200
|
+
await fsPromise.writeFile(filePath, base64, "base64");
|
|
17201
17201
|
if (needExt) {
|
|
17202
17202
|
const ext = (await ctx.ntFileApi.getFileType(filePath)).ext;
|
|
17203
17203
|
filename += `.${ext}`;
|
|
17204
|
-
await
|
|
17204
|
+
await fsPromise.rename(filePath, `${filePath}.${ext}`);
|
|
17205
17205
|
filePath = `${filePath}.${ext}`;
|
|
17206
17206
|
}
|
|
17207
17207
|
return {
|
|
@@ -17265,13 +17265,13 @@ function getSha1HexFromBuffer(buf) {
|
|
|
17265
17265
|
}
|
|
17266
17266
|
async function getMd5HexFromFile(filePath) {
|
|
17267
17267
|
const hash = createHash("md5");
|
|
17268
|
-
const stream = fs$
|
|
17268
|
+
const stream = fs$1.createReadStream(filePath);
|
|
17269
17269
|
for await (const chunk of stream) hash.update(chunk);
|
|
17270
17270
|
return hash.digest("hex");
|
|
17271
17271
|
}
|
|
17272
17272
|
async function getSha1HexFromFile(filePath) {
|
|
17273
17273
|
const hash = createHash("sha1");
|
|
17274
|
-
const stream = fs$
|
|
17274
|
+
const stream = fs$1.createReadStream(filePath);
|
|
17275
17275
|
for await (const chunk of stream) hash.update(chunk);
|
|
17276
17276
|
return hash.digest("hex");
|
|
17277
17277
|
}
|
|
@@ -17280,13 +17280,13 @@ function getMd5BufferFromBuffer(buf) {
|
|
|
17280
17280
|
}
|
|
17281
17281
|
async function getMd5BufferFromFile(filePath) {
|
|
17282
17282
|
const hash = createHash("md5");
|
|
17283
|
-
const stream = fs$
|
|
17283
|
+
const stream = fs$1.createReadStream(filePath);
|
|
17284
17284
|
for await (const chunk of stream) hash.update(chunk);
|
|
17285
17285
|
return hash.digest();
|
|
17286
17286
|
}
|
|
17287
17287
|
async function getSha1BufferFromFile(filePath) {
|
|
17288
17288
|
const hash = createHash("sha1");
|
|
17289
|
-
const stream = fs$
|
|
17289
|
+
const stream = fs$1.createReadStream(filePath);
|
|
17290
17290
|
for await (const chunk of stream) hash.update(chunk);
|
|
17291
17291
|
return hash.digest();
|
|
17292
17292
|
}
|
|
@@ -17522,7 +17522,7 @@ async function calculateSha1StreamBytes(filePath) {
|
|
|
17522
17522
|
let bytesRead = 0;
|
|
17523
17523
|
let nextBlockBoundary = blockSize;
|
|
17524
17524
|
const byteArrayList = [];
|
|
17525
|
-
const readable = fs$
|
|
17525
|
+
const readable = fs$1.createReadStream(filePath);
|
|
17526
17526
|
for await (const chunk of readable) {
|
|
17527
17527
|
let buf;
|
|
17528
17528
|
if (tail.length > 0) {
|
|
@@ -17547,7 +17547,7 @@ async function calculateSha1StreamBytes(filePath) {
|
|
|
17547
17547
|
}
|
|
17548
17548
|
async function readAndHash10M(filePath) {
|
|
17549
17549
|
const maxSize = 10002432;
|
|
17550
|
-
const fd = await
|
|
17550
|
+
const fd = await fsPromise.open(filePath, "r");
|
|
17551
17551
|
const buffer = Buffer.allocUnsafe(maxSize);
|
|
17552
17552
|
const { bytesRead } = await fd.read(buffer, 0, maxSize, 0);
|
|
17553
17553
|
await fd.close();
|
|
@@ -17589,13 +17589,13 @@ var TriSha1 = class {
|
|
|
17589
17589
|
};
|
|
17590
17590
|
async function calculateTriSha1(filePath, fileSize) {
|
|
17591
17591
|
const hash = new TriSha1(fileSize);
|
|
17592
|
-
const stream = fs$
|
|
17592
|
+
const stream = fs$1.createReadStream(filePath);
|
|
17593
17593
|
for await (const chunk of stream) hash.update(chunk);
|
|
17594
17594
|
return hash.finalize();
|
|
17595
17595
|
}
|
|
17596
17596
|
var defaultVideoThumb = Buffer.from("/9j/4AAQSkZJRgABAQAAAQABAAD//gAXR2VuZXJhdGVkIGJ5IFNuaXBhc3Rl/9sAhAAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47AQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCAF/APADAREAAhEBAxEB/8QBogAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoLEAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVL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oAQ0ANNMQhoEJQAlMBaQDgaAFBoAcDTAdmgQuaADNAgzQBPWZqFAgoAWgBaYC0CGmmBG1AyM0ANJoATNACZoAXNABmgAzQAUAJQAhoAQ0xDTQISmAUALQAUgHA0AKDTAdmgQuaBBQAtAFiszQKACgBaAFFMAoEIaYEbUDI2oAYaAEoASgAzQAuaACgAoAKAENMQ00AJTEFAhKACgAoAXNACg0AOBoAWgQtAC0AWazNAoAKACgBaYBQIQ0AMNMYw0AMIoAbQAlMAoAKACgAzSAKYhKAENACUxBQIKACgBKACgBaAHCgQ4UALQAUAWqzNAoAKACgApgFACGgQ00xjTQAwigBCKAG4pgJQAlABQAUCCgBKACgBKYgoEFABQISgAoAWgBRQA4UALQAUCLdZmoUAFABQAlMAoASgBDQA00wENACYoATFMBpFADSKAEoEJQAUAFABQAlMQtAgoASgQUAJQAUAKKAHCgBaBBQBbrM1CgAoAKACmAUAJQAlADaYBQAlACYpgIRQA0igBpFAhtABQAUAFMAoEFABQIKAEoASgQUALQAooAWgQUAW81mbC0CCgApgFACUAIaAEpgJQAUAFABQAhFMBpFADSKAGkUCExQAYoAMUAGKADFMQYoAMUCExSATFABQIKYBQAtABQIt5qDYM0ALmgQtIApgIaAENADaACmAlAC0ALQAUwGkUANIoAaRQAmKBBigAxQAYoAMUAGKBBigBMUAJigQmKAExTAKBC0AFAFnNQaig0AKDQAtAgoASgBDQAlMBKACgAFADhQAtMBCKAGkUAIRQAmKADFABigQmKADFACYoAXFABigQmKAExQAmKBCYpgJigAoAnzUGgZoAcDQAuaBC0AJQAhoASmAlABQAtADhQAtMAoATFACEUAJigAxQAYoATFAhMUAFABQAuKADFABigBpWgBCKBCYpgJigB+ag0DNADgaBDgaAFzQITNACUAJTAKACgBRQAopgOoAWgBKAEoAKACgAoASgBpoEJQAooAWgBaBhigBMUCEIoAQigBMUAJSLCgBQaBDgaQC5oEFACUwCgBKACmAtADhQA4UALQAUAJQAUAJQAUAJQAhoENoAWgBRQAooGLQAUAGKAGkUA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AhoAQ0DEoAKADNAC5oEGaBhmgAoAkpGgUCCgQooELQIKYhKACgBKAGmgBpoGMNAxDQAlAwzQIUUAOFAhwoAcKBC0AJQAhoGNNACUAFABQAZoAXNABQAUAS0ixKACgQoNAhaYgoEFACUABoAaaAGmgYw0DENAxtABQAooEOFADhQIcKAFoASgBDQAhoGJQAUAFACUALQIKBi0CJDSLEoATNAhc0CHZpiCgQUAJQIKBjTQAhoGNNAxpoATFABigBQKAHCgBwoAWgAoAKACgBKAEoASgAoASgBaAAUAOoEONIoaTQAZoAUGmIUGgQtAgzQISgAoAQ0DGmgYlAxKACgAxQAtACigBRQAtAxaACgAoATFABigBCKAG0CEoAWgBRTAUUAf//Z", "base64");
|
|
17597
17597
|
async function getVideoInfo(filePath) {
|
|
17598
|
-
const size = fs$
|
|
17598
|
+
const size = fs$1.statSync(filePath).size;
|
|
17599
17599
|
return new Promise((resolve, reject) => {
|
|
17600
17600
|
(0, import_fluent_ffmpeg.default)(filePath).ffprobe((err, metadata) => {
|
|
17601
17601
|
if (err) reject(err);
|
|
@@ -17672,7 +17672,7 @@ function convert(ctx, input, options, outputPath) {
|
|
|
17672
17672
|
});
|
|
17673
17673
|
}
|
|
17674
17674
|
async function encodeSilk(ctx, filePath) {
|
|
17675
|
-
const file = await
|
|
17675
|
+
const file = await fsPromise.readFile(filePath);
|
|
17676
17676
|
if (!isSilk(file)) {
|
|
17677
17677
|
ctx.logger.info(`语音文件${filePath}需要转换成silk`);
|
|
17678
17678
|
let result;
|
|
@@ -17691,7 +17691,7 @@ async function encodeSilk(ctx, filePath) {
|
|
|
17691
17691
|
"-f s16le"
|
|
17692
17692
|
] }), 24e3);
|
|
17693
17693
|
const pttPath = path.join(TEMP_DIR, randomUUID());
|
|
17694
|
-
await
|
|
17694
|
+
await fsPromise.writeFile(pttPath, result.data);
|
|
17695
17695
|
ctx.logger.info(`语音文件${filePath}转换成功!`, pttPath, `时长:`, result.duration);
|
|
17696
17696
|
return {
|
|
17697
17697
|
converted: true,
|
|
@@ -17714,11 +17714,11 @@ async function encodeSilk(ctx, filePath) {
|
|
|
17714
17714
|
}
|
|
17715
17715
|
}
|
|
17716
17716
|
async function decodeSilk(ctx, inputFilePath, outFormat) {
|
|
17717
|
-
const { data } = await decode(await
|
|
17717
|
+
const { data } = await decode(await fsPromise.readFile(inputFilePath), 24e3);
|
|
17718
17718
|
const tmpPath = path.join(TEMP_DIR, path.basename(inputFilePath));
|
|
17719
17719
|
const outFilePath = tmpPath + `.${outFormat}`;
|
|
17720
17720
|
const pcmFilePath = tmpPath + ".pcm";
|
|
17721
|
-
await
|
|
17721
|
+
await fsPromise.writeFile(pcmFilePath, data);
|
|
17722
17722
|
return convert(ctx, pcmFilePath, { input: [
|
|
17723
17723
|
"-f s16le",
|
|
17724
17724
|
"-ar 24000",
|
|
@@ -21901,20 +21901,22 @@ var GetGroupMemberInfo$1 = class extends BaseAction {
|
|
|
21901
21901
|
let info;
|
|
21902
21902
|
try {
|
|
21903
21903
|
info = await this.ctx.ntUserApi.getUserDetailInfoWithBizInfo(member.uid);
|
|
21904
|
-
this.ctx.logger.info("getUserDetailInfoWithBizInfo");
|
|
21905
21904
|
} catch (e) {
|
|
21906
21905
|
try {
|
|
21907
21906
|
info = (await this.ctx.ntUserApi.fetchUserDetailInfo(member.uid)).detail.get(member.uid);
|
|
21908
|
-
this.ctx.logger.info("fetchUserDetailInfo");
|
|
21909
21907
|
} catch (e) {}
|
|
21910
21908
|
}
|
|
21911
|
-
if (info) {
|
|
21912
|
-
this.ctx.logger.info(info);
|
|
21909
|
+
if (info?.commonExt) {
|
|
21913
21910
|
ret.sex = OB11Entities.sex(info.simpleInfo.baseInfo.sex);
|
|
21914
|
-
ret.qq_level =
|
|
21915
|
-
ret.age = info.simpleInfo.baseInfo.age
|
|
21911
|
+
ret.qq_level = calcQQLevel(info.commonExt.qqLevel);
|
|
21912
|
+
ret.age = info.simpleInfo.baseInfo.age;
|
|
21913
|
+
if (ret.qq_level === 0) ret.qq_level = (await this.ctx.pmhq.fetchUserInfo(+payload.user_id)).level;
|
|
21914
|
+
} else {
|
|
21915
|
+
const info = await this.ctx.pmhq.fetchUserInfo(+payload.user_id);
|
|
21916
|
+
ret.sex = OB11Entities.sex(info.sex);
|
|
21917
|
+
ret.qq_level = info.level;
|
|
21918
|
+
ret.age = info.age;
|
|
21916
21919
|
}
|
|
21917
|
-
if (ret.qq_level === 0) ret.qq_level = (await this.ctx.pmhq.fetchUserInfo(+payload.user_id)).level;
|
|
21918
21920
|
return ret;
|
|
21919
21921
|
}
|
|
21920
21922
|
};
|
|
@@ -23853,6 +23855,18 @@ var Msg;
|
|
|
23853
23855
|
var Misc;
|
|
23854
23856
|
(function(_Misc) {
|
|
23855
23857
|
_Misc.UserInfoLabel = ProtoMessage.of({ labels: ProtoField(1, { content: ProtoField(4, "string") }, "repeated") });
|
|
23858
|
+
_Misc.UserInfoBusiness = ProtoMessage.of({ body: ProtoField(3, {
|
|
23859
|
+
msg: ProtoField(1, "string"),
|
|
23860
|
+
lists: ProtoField(3, {
|
|
23861
|
+
type: ProtoField(1, "uint32"),
|
|
23862
|
+
field2: ProtoField(2, "uint32"),
|
|
23863
|
+
isYear: ProtoField(3, "uint32"),
|
|
23864
|
+
level: ProtoField(4, "uint32"),
|
|
23865
|
+
isPro: ProtoField(5, "uint32"),
|
|
23866
|
+
icon1: ProtoField(6, "string"),
|
|
23867
|
+
icon2: ProtoField(7, "string")
|
|
23868
|
+
}, "repeated")
|
|
23869
|
+
}) });
|
|
23856
23870
|
})(Misc || (Misc = {}));
|
|
23857
23871
|
//#endregion
|
|
23858
23872
|
//#region src/onebot11/helper/createMultiMessage.ts
|
|
@@ -24494,7 +24508,11 @@ var GetStrangerInfo = class extends BaseAction {
|
|
|
24494
24508
|
birthday_year: info.birthdayYear,
|
|
24495
24509
|
birthday_month: info.birthdayMonth,
|
|
24496
24510
|
birthday_day: info.birthdayDay,
|
|
24497
|
-
labels: info.labels
|
|
24511
|
+
labels: info.labels,
|
|
24512
|
+
is_vip: info.isVip,
|
|
24513
|
+
is_years_vip: info.isYearsVip,
|
|
24514
|
+
vip_level: info.vipLevel,
|
|
24515
|
+
remark: info.remark
|
|
24498
24516
|
};
|
|
24499
24517
|
}
|
|
24500
24518
|
};
|
|
@@ -24883,17 +24901,17 @@ var DownloadFile = class extends BaseAction {
|
|
|
24883
24901
|
const isRandomName = !payload.name;
|
|
24884
24902
|
const name = payload.name ? path.basename(payload.name) : randomUUID();
|
|
24885
24903
|
const filePath = path.join(TEMP_DIR, name);
|
|
24886
|
-
if (payload.base64) await fsPromise.writeFile(filePath, payload.base64, "base64");
|
|
24904
|
+
if (payload.base64) await fsPromise$1.writeFile(filePath, payload.base64, "base64");
|
|
24887
24905
|
else if (payload.url) {
|
|
24888
24906
|
const headers = this.getHeaders(payload.headers);
|
|
24889
24907
|
const res = await fetchFile(payload.url, headers);
|
|
24890
|
-
await fsPromise.writeFile(filePath, res.data);
|
|
24908
|
+
await fsPromise$1.writeFile(filePath, res.data);
|
|
24891
24909
|
} else throw new Error("不存在任何文件, 无法下载");
|
|
24892
|
-
if (fs
|
|
24910
|
+
if (fs.existsSync(filePath)) {
|
|
24893
24911
|
if (isRandomName) {
|
|
24894
24912
|
const md5 = await getMd5HexFromFile(filePath);
|
|
24895
24913
|
const newPath = path.join(TEMP_DIR, md5);
|
|
24896
|
-
await fsPromise.rename(filePath, newPath);
|
|
24914
|
+
await fsPromise$1.rename(filePath, newPath);
|
|
24897
24915
|
return { file: newPath };
|
|
24898
24916
|
}
|
|
24899
24917
|
return { file: filePath };
|
|
@@ -43432,7 +43450,7 @@ async function download(url, headers) {
|
|
|
43432
43450
|
return Buffer.from(bytes);
|
|
43433
43451
|
}
|
|
43434
43452
|
async function resolveMilkyUri(uri) {
|
|
43435
|
-
if (uri.startsWith("file://")) return await
|
|
43453
|
+
if (uri.startsWith("file://")) return await fsPromise.readFile(fileURLToPath(uri));
|
|
43436
43454
|
if (uri.startsWith("http://") || uri.startsWith("https://")) return await download(uri);
|
|
43437
43455
|
if (uri.startsWith("base64://")) return Buffer.from(uri.slice(9), "base64");
|
|
43438
43456
|
throw new Error(`Unsupported URI scheme: ${uri}`);
|
|
@@ -43461,22 +43479,19 @@ var SystemApi = [
|
|
|
43461
43479
|
});
|
|
43462
43480
|
}),
|
|
43463
43481
|
defineApi("get_user_profile", GetUserProfileInput, GetUserProfileOutput, async (ctx, payload) => {
|
|
43464
|
-
const
|
|
43465
|
-
|
|
43466
|
-
|
|
43467
|
-
|
|
43468
|
-
|
|
43469
|
-
|
|
43470
|
-
|
|
43471
|
-
|
|
43472
|
-
|
|
43473
|
-
|
|
43474
|
-
|
|
43475
|
-
|
|
43476
|
-
|
|
43477
|
-
};
|
|
43478
|
-
if (profile.level === 0) profile.level = (await ctx.pmhq.fetchUserInfo(payload.user_id)).level;
|
|
43479
|
-
return Ok(profile);
|
|
43482
|
+
const info = await ctx.pmhq.fetchUserInfo(payload.user_id);
|
|
43483
|
+
return Ok({
|
|
43484
|
+
nickname: info.nick,
|
|
43485
|
+
qid: info.qid,
|
|
43486
|
+
age: info.age,
|
|
43487
|
+
sex: transformGender(info.sex),
|
|
43488
|
+
remark: info.remark,
|
|
43489
|
+
bio: info.longNick,
|
|
43490
|
+
level: info.level,
|
|
43491
|
+
country: info.country,
|
|
43492
|
+
city: info.city,
|
|
43493
|
+
school: info.school
|
|
43494
|
+
});
|
|
43480
43495
|
}),
|
|
43481
43496
|
defineApi("get_friend_list", GetFriendListInput, GetFriendListOutput, async (ctx) => {
|
|
43482
43497
|
const friends = await ctx.ntFriendApi.getBuddyList();
|
|
@@ -54298,7 +54313,7 @@ var NTQQWebApi = class extends Service {
|
|
|
54298
54313
|
const iBatchID = Math.floor(Date.now() / 1e3);
|
|
54299
54314
|
for (let i = 0; i < filePathList.length; i++) {
|
|
54300
54315
|
const filePath = filePathList[i];
|
|
54301
|
-
const fileBuffer = await
|
|
54316
|
+
const fileBuffer = await fsPromise.readFile(filePath);
|
|
54302
54317
|
const fileSize = fileBuffer.length;
|
|
54303
54318
|
const fileType = await fileTypeFromBuffer(fileBuffer);
|
|
54304
54319
|
const timestamp = Math.floor(Date.now() / 1e3);
|
|
@@ -54483,7 +54498,7 @@ var NTQQWebApi = class extends Service {
|
|
|
54483
54498
|
}
|
|
54484
54499
|
if (sVid) {
|
|
54485
54500
|
const filePath = await createThumb(this.ctx, filePathList[i]);
|
|
54486
|
-
const fileBuffer = await
|
|
54501
|
+
const fileBuffer = await fsPromise.readFile(filePath);
|
|
54487
54502
|
const fileSize = fileBuffer.length;
|
|
54488
54503
|
const timestamp = Math.floor(Date.now() / 1e3);
|
|
54489
54504
|
const checksum = getMd5HexFromBuffer(fileBuffer);
|
|
@@ -55975,7 +55990,7 @@ var Config = class extends Service {
|
|
|
55975
55990
|
this.logger.info("配置文件位于", this.configPath);
|
|
55976
55991
|
this.config = this.get();
|
|
55977
55992
|
if (this.configPath) {
|
|
55978
|
-
fs$
|
|
55993
|
+
fs$1.watchFile(this.configPath, {
|
|
55979
55994
|
persistent: true,
|
|
55980
55995
|
interval: 1e3
|
|
55981
55996
|
}, () => {
|
|
@@ -55993,7 +56008,7 @@ var Config = class extends Service {
|
|
|
55993
56008
|
}
|
|
55994
56009
|
getDefaultConfig() {
|
|
55995
56010
|
const _defaultConfig = { ...defaultConfig };
|
|
55996
|
-
const defaultConfigFromFile = fs$
|
|
56011
|
+
const defaultConfigFromFile = fs$1.readFileSync(this.defaultConfigPath, "utf-8");
|
|
55997
56012
|
try {
|
|
55998
56013
|
const parsedDefaultConfig = import_dist.default.parse(defaultConfigFromFile);
|
|
55999
56014
|
Object.assign(_defaultConfig, parsedDefaultConfig);
|
|
@@ -56004,12 +56019,12 @@ var Config = class extends Service {
|
|
|
56004
56019
|
}
|
|
56005
56020
|
reloadConfig() {
|
|
56006
56021
|
if (!this.configPath) return this.getDefaultConfig();
|
|
56007
|
-
if (!fs$
|
|
56022
|
+
if (!fs$1.existsSync(this.configPath)) {
|
|
56008
56023
|
this.config = this.getDefaultConfig();
|
|
56009
56024
|
this.set(this.config);
|
|
56010
56025
|
return this.config;
|
|
56011
56026
|
} else {
|
|
56012
|
-
const data = fs$
|
|
56027
|
+
const data = fs$1.readFileSync(this.configPath, "utf-8");
|
|
56013
56028
|
let jsonData = defaultConfig;
|
|
56014
56029
|
try {
|
|
56015
56030
|
jsonData = import_dist.default.parse(data);
|
|
@@ -56035,7 +56050,7 @@ var Config = class extends Service {
|
|
|
56035
56050
|
writeConfig(config) {
|
|
56036
56051
|
if (!this.configPath) return;
|
|
56037
56052
|
this.watch = false;
|
|
56038
|
-
fs$
|
|
56053
|
+
fs$1.writeFileSync(this.configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
56039
56054
|
setTimeout(() => {
|
|
56040
56055
|
this.watch = true;
|
|
56041
56056
|
}, 1500);
|
|
@@ -56141,13 +56156,13 @@ var WebUITokenUtil = class {
|
|
|
56141
56156
|
}
|
|
56142
56157
|
getToken() {
|
|
56143
56158
|
if (!this.token) {
|
|
56144
|
-
if (fs$
|
|
56159
|
+
if (fs$1.existsSync(this.tokenPath)) this.token = fs$1.readFileSync(this.tokenPath, "utf-8").trim();
|
|
56145
56160
|
}
|
|
56146
56161
|
return this.token;
|
|
56147
56162
|
}
|
|
56148
56163
|
setToken(token) {
|
|
56149
56164
|
this.token = token.trim();
|
|
56150
|
-
fs$
|
|
56165
|
+
fs$1.writeFileSync(this.tokenPath, token, "utf-8");
|
|
56151
56166
|
}
|
|
56152
56167
|
};
|
|
56153
56168
|
var webuiTokenUtil = new WebUITokenUtil(path.join(DATA_DIR, "webui_token.txt"));
|
|
@@ -58422,7 +58437,7 @@ var require_fetch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
58422
58437
|
var require_shared = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
58423
58438
|
var urllib$2 = __require("url");
|
|
58424
58439
|
var util$1 = __require("util");
|
|
58425
|
-
var fs$
|
|
58440
|
+
var fs$4 = __require("fs");
|
|
58426
58441
|
var nmfetch = require_fetch();
|
|
58427
58442
|
var dns$1 = __require("dns");
|
|
58428
58443
|
var net$4 = __require("net");
|
|
@@ -58758,7 +58773,7 @@ var require_shared = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
58758
58773
|
const parsedDataUri = module.exports.parseDataURI(content.path || content.href);
|
|
58759
58774
|
if (!parsedDataUri || !parsedDataUri.data) return callback(null, Buffer.from(0));
|
|
58760
58775
|
return callback(null, parsedDataUri.data);
|
|
58761
|
-
} else if (content.path) return resolveStream(fs$
|
|
58776
|
+
} else if (content.path) return resolveStream(fs$4.createReadStream(content.path), callback);
|
|
58762
58777
|
}
|
|
58763
58778
|
if (typeof data[key].content === "string" && ![
|
|
58764
58779
|
"utf8",
|
|
@@ -62698,7 +62713,7 @@ var require_le_unix = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
62698
62713
|
//#region node_modules/nodemailer/lib/mime-node/index.js
|
|
62699
62714
|
var require_mime_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
62700
62715
|
var crypto$8 = __require("crypto");
|
|
62701
|
-
var fs$
|
|
62716
|
+
var fs$3 = __require("fs");
|
|
62702
62717
|
var punycode = require_punycode();
|
|
62703
62718
|
var { PassThrough: PassThrough$2 } = __require("stream");
|
|
62704
62719
|
var shared = require_shared();
|
|
@@ -63407,7 +63422,7 @@ var require_mime_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
63407
63422
|
});
|
|
63408
63423
|
return contentStream;
|
|
63409
63424
|
}
|
|
63410
|
-
return fs$
|
|
63425
|
+
return fs$3.createReadStream(content.path);
|
|
63411
63426
|
}
|
|
63412
63427
|
if (content && typeof content.href === "string") {
|
|
63413
63428
|
if (this.disableUrlAccess) {
|
|
@@ -64246,7 +64261,7 @@ var require_dkim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
64246
64261
|
var RelaxedBody = require_relaxed_body();
|
|
64247
64262
|
var sign = require_sign();
|
|
64248
64263
|
var { PassThrough: PassThrough$1 } = __require("stream");
|
|
64249
|
-
var fs$
|
|
64264
|
+
var fs$2 = __require("fs");
|
|
64250
64265
|
var path$2 = __require("path");
|
|
64251
64266
|
var crypto$5 = __require("crypto");
|
|
64252
64267
|
var DKIM_ALGO = "sha256";
|
|
@@ -64279,10 +64294,10 @@ var require_dkim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
64279
64294
|
}
|
|
64280
64295
|
cleanup() {
|
|
64281
64296
|
if (!this.cache || !this.cachePath) return;
|
|
64282
|
-
fs$
|
|
64297
|
+
fs$2.unlink(this.cachePath, () => false);
|
|
64283
64298
|
}
|
|
64284
64299
|
createReadCache() {
|
|
64285
|
-
this.cache = fs$
|
|
64300
|
+
this.cache = fs$2.createReadStream(this.cachePath);
|
|
64286
64301
|
this.cache.once("error", (err) => {
|
|
64287
64302
|
this.cleanup();
|
|
64288
64303
|
this.output.emit("error", err);
|
|
@@ -64328,7 +64343,7 @@ var require_dkim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
64328
64343
|
}
|
|
64329
64344
|
createWriteCache() {
|
|
64330
64345
|
this.output.usingCache = true;
|
|
64331
|
-
this.cache = fs$
|
|
64346
|
+
this.cache = fs$2.createWriteStream(this.cachePath);
|
|
64332
64347
|
this.cache.once("error", (err) => {
|
|
64333
64348
|
this.cleanup();
|
|
64334
64349
|
this.relaxedBody.unpipe(this.cache);
|
|
@@ -70336,12 +70351,15 @@ function UserMixin(Base) {
|
|
|
70336
70351
|
uin,
|
|
70337
70352
|
keys: [
|
|
70338
70353
|
{ key: 102 },
|
|
70354
|
+
{ key: 103 },
|
|
70339
70355
|
{ key: 104 },
|
|
70340
70356
|
{ key: 105 },
|
|
70357
|
+
{ key: 107 },
|
|
70341
70358
|
{ key: 20002 },
|
|
70342
70359
|
{ key: 20003 },
|
|
70343
70360
|
{ key: 20009 },
|
|
70344
70361
|
{ key: 20020 },
|
|
70362
|
+
{ key: 20021 },
|
|
70345
70363
|
{ key: 20026 },
|
|
70346
70364
|
{ key: 20031 },
|
|
70347
70365
|
{ key: 20037 },
|
|
@@ -70359,6 +70377,7 @@ function UserMixin(Base) {
|
|
|
70359
70377
|
const info = Oidb.FetchUserInfoResp.decode(oidbRespBody);
|
|
70360
70378
|
const numbers = Object.fromEntries(info.body.properties.numberProperties.map((p) => [p.key, p.value]));
|
|
70361
70379
|
const bytes = Object.fromEntries(info.body.properties.bytesProperties.map((p) => [p.key, p.value]));
|
|
70380
|
+
const business = bytes[107] ? Misc.UserInfoBusiness.decode(bytes[107]) : void 0;
|
|
70362
70381
|
return {
|
|
70363
70382
|
uin: info.body.uin,
|
|
70364
70383
|
nick: bytes[20002]?.toString() ?? "",
|
|
@@ -70373,7 +70392,12 @@ function UserMixin(Base) {
|
|
|
70373
70392
|
birthdayYear: bytes[20031]?.[0] << 8 | bytes[20031]?.[1],
|
|
70374
70393
|
birthdayMonth: bytes[20031]?.[2] ?? 0,
|
|
70375
70394
|
birthdayDay: bytes[20031]?.[3] ?? 0,
|
|
70376
|
-
labels: bytes[104] ? Misc.UserInfoLabel.decode(bytes[104]).labels.map((e) => e.content) : []
|
|
70395
|
+
labels: bytes[104] ? Misc.UserInfoLabel.decode(bytes[104]).labels.map((e) => e.content) : [],
|
|
70396
|
+
school: bytes[20021]?.toString() ?? "",
|
|
70397
|
+
remark: bytes[103]?.toString() ?? "",
|
|
70398
|
+
isVip: !!business?.body.lists[0],
|
|
70399
|
+
isYearsVip: !!business?.body.lists[0]?.isYear,
|
|
70400
|
+
vipLevel: business?.body.lists[0]?.level ?? 0
|
|
70377
70401
|
};
|
|
70378
70402
|
}
|
|
70379
70403
|
async fetchUserLoginDays(uin) {
|