mioki 0.15.0 → 0.16.0
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/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -3
- package/dist/index.d.mts +13 -3
- package/dist/index.mjs +12 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{package-49Rgph2M.cjs → package-Cs8cEndC.cjs} +2 -2
- package/dist/package-Cs8cEndC.cjs.map +1 -0
- package/dist/package-UYRX612w.mjs +6 -0
- package/dist/package-UYRX612w.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/package-49Rgph2M.cjs.map +0 -1
- package/dist/package-B4h-fhCq.mjs +0 -6
- package/dist/package-B4h-fhCq.mjs.map +0 -1
package/dist/cli.cjs
CHANGED
package/dist/cli.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_package = require('./package-
|
|
1
|
+
const require_package = require('./package-Cs8cEndC.cjs');
|
|
2
2
|
let node_fs = require("node:fs");
|
|
3
3
|
node_fs = require_package.__toESM(node_fs);
|
|
4
4
|
let node_util = require("node:util");
|
|
@@ -1253,6 +1253,13 @@ var Deduplicator = class {
|
|
|
1253
1253
|
const raw = e.raw_message ?? "_";
|
|
1254
1254
|
return `msg:group:${groupId}:${userId}:${time}:${node_crypto.default.createHash("md5").update(raw).digest("hex")}`;
|
|
1255
1255
|
}
|
|
1256
|
+
getPrivateMessageKey(e) {
|
|
1257
|
+
const userId = e.user_id ?? "_";
|
|
1258
|
+
const targetId = e.target_id ?? "_";
|
|
1259
|
+
const time = e.time ?? "_";
|
|
1260
|
+
const raw = e.raw_message ?? "_";
|
|
1261
|
+
return `msg:private:${userId}:${targetId}:${time}:${node_crypto.default.createHash("md5").update(raw).digest("hex")}`;
|
|
1262
|
+
}
|
|
1256
1263
|
getNoticeGroupKey(e) {
|
|
1257
1264
|
return `${this.getEventTypeKey(e)}:${e.group_id ?? "_"}:${e.user_id ?? "_"}:${"operator_id" in e ? e.operator_id ?? "_" : "_"}:${"target_id" in e ? e.target_id ?? "_" : "_"}:${e.sub_type ?? "_"}:${"action_type" in e ? e.action_type ?? "_" : "_"}:${"duration" in e ? e.duration ?? "_" : "_"}:${e.time ?? "_"}`;
|
|
1258
1265
|
}
|
|
@@ -1270,6 +1277,7 @@ var Deduplicator = class {
|
|
|
1270
1277
|
getKey(e) {
|
|
1271
1278
|
const typeKey = this.getEventTypeKey(e);
|
|
1272
1279
|
if (typeKey === "msg:group") return this.getGroupMessageKey(e);
|
|
1280
|
+
if (typeKey === "msg:private") return this.getPrivateMessageKey(e);
|
|
1273
1281
|
if (typeKey.startsWith("notice:group:")) return this.getNoticeGroupKey(e);
|
|
1274
1282
|
if (typeKey.startsWith("req:")) return this.getRequestKey(e);
|
|
1275
1283
|
return "";
|
|
@@ -1383,13 +1391,15 @@ async function enablePlugin(bots, plugin, type = "external") {
|
|
|
1383
1391
|
const createContext = (bot) => {
|
|
1384
1392
|
return {
|
|
1385
1393
|
bot,
|
|
1386
|
-
bots,
|
|
1387
1394
|
self_id: bot.bot_id,
|
|
1395
|
+
bots,
|
|
1396
|
+
pickBot: (id) => bots.find((b) => b.bot_id === id),
|
|
1388
1397
|
segment: bot.segment,
|
|
1389
1398
|
getCookie: bot.getCookie.bind(bot),
|
|
1390
1399
|
...utils_exports,
|
|
1391
1400
|
...config_exports,
|
|
1392
1401
|
...buildRemovedActions(bot),
|
|
1402
|
+
actions: actions_exports,
|
|
1393
1403
|
logger: logger$1,
|
|
1394
1404
|
services,
|
|
1395
1405
|
clears: userClears,
|