koishi-plugin-bilibili-notify 3.2.5-alpha.11 → 3.2.5-alpha.13
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/lib/index.js +32 -22
- package/lib/index.mjs +32 -22
- package/package.json +1 -1
- package/readme.md +2 -0
package/lib/index.js
CHANGED
|
@@ -552,7 +552,7 @@ var ComRegister = class {
|
|
|
552
552
|
subManager = [];
|
|
553
553
|
dynamicTimelineManager = /* @__PURE__ */ new Map();
|
|
554
554
|
liveStatusManager = /* @__PURE__ */ new Map();
|
|
555
|
-
|
|
555
|
+
pushArrMap = /* @__PURE__ */ new Map();
|
|
556
556
|
loginDBData;
|
|
557
557
|
privateBot;
|
|
558
558
|
dynamicJob;
|
|
@@ -797,7 +797,6 @@ var ComRegister = class {
|
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
799
|
initPushRecord(subs) {
|
|
800
|
-
const pushRecord = {};
|
|
801
800
|
for (const sub of subs) {
|
|
802
801
|
const atAllArr = [];
|
|
803
802
|
const dynamicArr = [];
|
|
@@ -809,16 +808,15 @@ var ComRegister = class {
|
|
|
809
808
|
if (channel.live) liveArr.push(`${platform.platform}:${channel.channelId}`);
|
|
810
809
|
if (channel.liveGuardBuy) liveGuardBuyArr.push(`${platform.platform}:${channel.channelId}`);
|
|
811
810
|
}
|
|
812
|
-
|
|
811
|
+
this.pushArrMap.set(sub.uid, {
|
|
813
812
|
atAllArr,
|
|
814
813
|
dynamicArr,
|
|
815
814
|
liveArr,
|
|
816
815
|
liveGuardBuyArr
|
|
817
|
-
};
|
|
816
|
+
});
|
|
818
817
|
}
|
|
819
|
-
this.pushRecord = pushRecord;
|
|
820
818
|
this.logger.info("初始化推送群组/频道信息:");
|
|
821
|
-
this.logger.info(this.
|
|
819
|
+
this.logger.info(this.pushArrMap);
|
|
822
820
|
}
|
|
823
821
|
checkAllBotsAreReady() {
|
|
824
822
|
return !this.ctx.bots.some((bot) => bot.status !== koishi.Universal.Status.ONLINE);
|
|
@@ -832,33 +830,37 @@ var ComRegister = class {
|
|
|
832
830
|
return;
|
|
833
831
|
}
|
|
834
832
|
this.logger.info(`本次推送对象:${uid},推送类型:${PushTypeMsg[type]}`);
|
|
835
|
-
const record = this.
|
|
833
|
+
const record = this.pushArrMap.get(uid);
|
|
836
834
|
this.logger.info("本次推送目标:");
|
|
837
835
|
if (type === PushType.StartBroadcasting && record.atAllArr?.length >= 1) {
|
|
838
836
|
this.logger.info(record.atAllArr);
|
|
837
|
+
const atAllArr = structuredClone(record.atAllArr);
|
|
839
838
|
const success = await withRetry(async () => {
|
|
840
|
-
return await this.ctx.broadcast(
|
|
839
|
+
return await this.ctx.broadcast(atAllArr, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("at", { type: "all" }) }));
|
|
841
840
|
}, 1);
|
|
842
841
|
this.logger.info(`成功推送全体成员消息群组/频道:${success}`);
|
|
843
842
|
}
|
|
844
843
|
if (type === PushType.Dynamic && record.dynamicArr?.length >= 1) {
|
|
845
844
|
this.logger.info(record.dynamicArr);
|
|
845
|
+
const dynamicArr = structuredClone(record.dynamicArr);
|
|
846
846
|
const success = await withRetry(async () => {
|
|
847
|
-
return await this.ctx.broadcast(
|
|
847
|
+
return await this.ctx.broadcast(dynamicArr, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: content }));
|
|
848
848
|
}, 1);
|
|
849
849
|
this.logger.info(`成功推送动态消息群组/频道:${success}`);
|
|
850
850
|
}
|
|
851
851
|
if ((type === PushType.Live || type === PushType.StartBroadcasting) && record.liveArr?.length >= 1) {
|
|
852
852
|
this.logger.info(record.liveArr);
|
|
853
|
+
const liveArr = structuredClone(record.liveArr);
|
|
853
854
|
const success = await withRetry(async () => {
|
|
854
|
-
return await this.ctx.broadcast(
|
|
855
|
+
return await this.ctx.broadcast(liveArr, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: content }));
|
|
855
856
|
}, 1);
|
|
856
857
|
this.logger.info(`成功推送直播消息群组/频道:${success}`);
|
|
857
858
|
}
|
|
858
859
|
if (type === PushType.LiveGuardBuy && record.liveGuardBuyArr?.length >= 1) {
|
|
859
860
|
this.logger.info(record.liveGuardBuyArr);
|
|
861
|
+
const liveGuardBuyArr = structuredClone(record.liveGuardBuyArr);
|
|
860
862
|
const success = await withRetry(async () => {
|
|
861
|
-
return await this.ctx.broadcast(
|
|
863
|
+
return await this.ctx.broadcast(liveGuardBuyArr, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: content }));
|
|
862
864
|
}, 1);
|
|
863
865
|
this.logger.info(`成功推送上舰消息群组/频道:${success}`);
|
|
864
866
|
}
|
|
@@ -912,15 +914,15 @@ var ComRegister = class {
|
|
|
912
914
|
}, 1).catch(async (e$1) => {
|
|
913
915
|
if (e$1.message === "直播开播动态,不做处理") return;
|
|
914
916
|
if (e$1.message === "出现关键词,屏蔽该动态") {
|
|
915
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
917
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [name$3, "发布了一条含有屏蔽关键字的动态"] }), PushType.Dynamic);
|
|
916
918
|
return;
|
|
917
919
|
}
|
|
918
920
|
if (e$1.message === "已屏蔽转发动态") {
|
|
919
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
921
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [name$3, "转发了一条动态,已屏蔽"] }), PushType.Dynamic);
|
|
920
922
|
return;
|
|
921
923
|
}
|
|
922
924
|
if (e$1.message === "已屏蔽专栏动态") {
|
|
923
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
925
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [name$3, "投稿了一条专栏,已屏蔽"] }), PushType.Dynamic);
|
|
924
926
|
return;
|
|
925
927
|
}
|
|
926
928
|
this.logger.error(`dynamicDetect generateDynamicImg() 推送卡片发送失败,原因:${e$1.message}`);
|
|
@@ -934,7 +936,7 @@ var ComRegister = class {
|
|
|
934
936
|
} else dUrl = `${name$3}发布了新视频:https:${item.modules.module_dynamic.major.archive.jump_url}`;
|
|
935
937
|
else dUrl = `${name$3}发布了一条动态:https://t.bilibili.com/${item.id_str}`;
|
|
936
938
|
this.logger.info("推送动态中...");
|
|
937
|
-
await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)(__satorijs_element_jsx_runtime.
|
|
939
|
+
await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [/* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: koishi.h.image(buffer, "image/jpeg") }), /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: dUrl })] }), PushType.Dynamic);
|
|
938
940
|
if (this.config.pushImgsInDynamic) {
|
|
939
941
|
if (item.type === "DYNAMIC_TYPE_DRAW") {
|
|
940
942
|
const pics = item.modules?.module_dynamic?.major?.opus?.pics;
|
|
@@ -1017,15 +1019,15 @@ var ComRegister = class {
|
|
|
1017
1019
|
}, 1).catch(async (e$1) => {
|
|
1018
1020
|
if (e$1.message === "直播开播动态,不做处理") return;
|
|
1019
1021
|
if (e$1.message === "出现关键词,屏蔽该动态") {
|
|
1020
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
1022
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [name$3, "发布了一条含有屏蔽关键字的动态"] }), PushType.Dynamic);
|
|
1021
1023
|
return;
|
|
1022
1024
|
}
|
|
1023
1025
|
if (e$1.message === "已屏蔽转发动态") {
|
|
1024
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
1026
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [name$3, "转发了一条动态,已屏蔽"] }), PushType.Dynamic);
|
|
1025
1027
|
return;
|
|
1026
1028
|
}
|
|
1027
1029
|
if (e$1.message === "已屏蔽专栏动态") {
|
|
1028
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
1030
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [name$3, "投稿了一条专栏,已屏蔽"] }), PushType.Dynamic);
|
|
1029
1031
|
return;
|
|
1030
1032
|
}
|
|
1031
1033
|
this.logger.error(`dynamicDetect generateDynamicImg() 推送卡片发送失败,原因:${e$1.message}`);
|
|
@@ -1044,7 +1046,7 @@ var ComRegister = class {
|
|
|
1044
1046
|
this.logger.info("动态链接生成成功!");
|
|
1045
1047
|
}
|
|
1046
1048
|
this.logger.info("推送动态中...");
|
|
1047
|
-
await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)(__satorijs_element_jsx_runtime.
|
|
1049
|
+
await this.broadcastToTargets(sub.uid, /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [/* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: koishi.h.image(buffer, "image/jpeg") }), /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: dUrl })] }), PushType.Dynamic);
|
|
1048
1050
|
if (this.config.pushImgsInDynamic) {
|
|
1049
1051
|
this.logger.info("需要发送动态中的图片,开始发送...");
|
|
1050
1052
|
if (item.type === "DYNAMIC_TYPE_DRAW") {
|
|
@@ -1116,7 +1118,7 @@ var ComRegister = class {
|
|
|
1116
1118
|
this.logger.error(`liveDetect generateLiveImg() 推送卡片生成失败,原因:${e$1.message}`);
|
|
1117
1119
|
});
|
|
1118
1120
|
if (!buffer) return await this.sendPrivateMsgAndStopService();
|
|
1119
|
-
const msg = /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)(__satorijs_element_jsx_runtime.
|
|
1121
|
+
const msg = /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [/* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: koishi.h.image(buffer, "image/jpeg") }), /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsx)("message", { children: liveNotifyMsg || "" })] });
|
|
1120
1122
|
return await this.broadcastToTargets(uid, msg, liveType === LiveType.StartBroadcasting ? PushType.StartBroadcasting : PushType.Live);
|
|
1121
1123
|
}
|
|
1122
1124
|
async liveDetectWithListener(roomId, uid, cardStyle) {
|
|
@@ -1181,7 +1183,15 @@ var ComRegister = class {
|
|
|
1181
1183
|
watchedNum = body.text_small;
|
|
1182
1184
|
},
|
|
1183
1185
|
onGuardBuy: ({ body }) => {
|
|
1184
|
-
const content =
|
|
1186
|
+
const content = /* @__PURE__ */ (0, __satorijs_element_jsx_runtime.jsxs)("message", { children: [
|
|
1187
|
+
"【",
|
|
1188
|
+
masterInfo.username,
|
|
1189
|
+
"的直播间】",
|
|
1190
|
+
body.user.uname,
|
|
1191
|
+
"加入了大航海(",
|
|
1192
|
+
body.gift_name,
|
|
1193
|
+
")"
|
|
1194
|
+
] });
|
|
1185
1195
|
this.broadcastToTargets(uid, content, PushType.LiveGuardBuy);
|
|
1186
1196
|
},
|
|
1187
1197
|
onLiveStart: async () => {
|
|
@@ -58056,7 +58066,7 @@ var require_helpers$1 = __commonJS$1({ "node_modules/socks/build/common/helpers.
|
|
|
58056
58066
|
}
|
|
58057
58067
|
function ipv4ToInt32(ip) {
|
|
58058
58068
|
const address = new ip_address_1$1.Address4(ip);
|
|
58059
|
-
return address.toArray().reduce((acc, part) => (acc << 8) + part, 0);
|
|
58069
|
+
return address.toArray().reduce((acc, part) => (acc << 8) + part, 0) >>> 0;
|
|
58060
58070
|
}
|
|
58061
58071
|
exports.ipv4ToInt32 = ipv4ToInt32;
|
|
58062
58072
|
function int32ToIpv4(int32) {
|
package/lib/index.mjs
CHANGED
|
@@ -554,7 +554,7 @@ var ComRegister = class {
|
|
|
554
554
|
subManager = [];
|
|
555
555
|
dynamicTimelineManager = /* @__PURE__ */ new Map();
|
|
556
556
|
liveStatusManager = /* @__PURE__ */ new Map();
|
|
557
|
-
|
|
557
|
+
pushArrMap = /* @__PURE__ */ new Map();
|
|
558
558
|
loginDBData;
|
|
559
559
|
privateBot;
|
|
560
560
|
dynamicJob;
|
|
@@ -799,7 +799,6 @@ var ComRegister = class {
|
|
|
799
799
|
});
|
|
800
800
|
}
|
|
801
801
|
initPushRecord(subs) {
|
|
802
|
-
const pushRecord = {};
|
|
803
802
|
for (const sub of subs) {
|
|
804
803
|
const atAllArr = [];
|
|
805
804
|
const dynamicArr = [];
|
|
@@ -811,16 +810,15 @@ var ComRegister = class {
|
|
|
811
810
|
if (channel.live) liveArr.push(`${platform.platform}:${channel.channelId}`);
|
|
812
811
|
if (channel.liveGuardBuy) liveGuardBuyArr.push(`${platform.platform}:${channel.channelId}`);
|
|
813
812
|
}
|
|
814
|
-
|
|
813
|
+
this.pushArrMap.set(sub.uid, {
|
|
815
814
|
atAllArr,
|
|
816
815
|
dynamicArr,
|
|
817
816
|
liveArr,
|
|
818
817
|
liveGuardBuyArr
|
|
819
|
-
};
|
|
818
|
+
});
|
|
820
819
|
}
|
|
821
|
-
this.pushRecord = pushRecord;
|
|
822
820
|
this.logger.info("初始化推送群组/频道信息:");
|
|
823
|
-
this.logger.info(this.
|
|
821
|
+
this.logger.info(this.pushArrMap);
|
|
824
822
|
}
|
|
825
823
|
checkAllBotsAreReady() {
|
|
826
824
|
return !this.ctx.bots.some((bot) => bot.status !== Universal.Status.ONLINE);
|
|
@@ -834,33 +832,37 @@ var ComRegister = class {
|
|
|
834
832
|
return;
|
|
835
833
|
}
|
|
836
834
|
this.logger.info(`本次推送对象:${uid},推送类型:${PushTypeMsg[type]}`);
|
|
837
|
-
const record = this.
|
|
835
|
+
const record = this.pushArrMap.get(uid);
|
|
838
836
|
this.logger.info("本次推送目标:");
|
|
839
837
|
if (type === PushType.StartBroadcasting && record.atAllArr?.length >= 1) {
|
|
840
838
|
this.logger.info(record.atAllArr);
|
|
839
|
+
const atAllArr = structuredClone(record.atAllArr);
|
|
841
840
|
const success = await withRetry(async () => {
|
|
842
|
-
return await this.ctx.broadcast(
|
|
841
|
+
return await this.ctx.broadcast(atAllArr, /* @__PURE__ */ jsx("message", { children: /* @__PURE__ */ jsx("at", { type: "all" }) }));
|
|
843
842
|
}, 1);
|
|
844
843
|
this.logger.info(`成功推送全体成员消息群组/频道:${success}`);
|
|
845
844
|
}
|
|
846
845
|
if (type === PushType.Dynamic && record.dynamicArr?.length >= 1) {
|
|
847
846
|
this.logger.info(record.dynamicArr);
|
|
847
|
+
const dynamicArr = structuredClone(record.dynamicArr);
|
|
848
848
|
const success = await withRetry(async () => {
|
|
849
|
-
return await this.ctx.broadcast(
|
|
849
|
+
return await this.ctx.broadcast(dynamicArr, /* @__PURE__ */ jsx("message", { children: content }));
|
|
850
850
|
}, 1);
|
|
851
851
|
this.logger.info(`成功推送动态消息群组/频道:${success}`);
|
|
852
852
|
}
|
|
853
853
|
if ((type === PushType.Live || type === PushType.StartBroadcasting) && record.liveArr?.length >= 1) {
|
|
854
854
|
this.logger.info(record.liveArr);
|
|
855
|
+
const liveArr = structuredClone(record.liveArr);
|
|
855
856
|
const success = await withRetry(async () => {
|
|
856
|
-
return await this.ctx.broadcast(
|
|
857
|
+
return await this.ctx.broadcast(liveArr, /* @__PURE__ */ jsx("message", { children: content }));
|
|
857
858
|
}, 1);
|
|
858
859
|
this.logger.info(`成功推送直播消息群组/频道:${success}`);
|
|
859
860
|
}
|
|
860
861
|
if (type === PushType.LiveGuardBuy && record.liveGuardBuyArr?.length >= 1) {
|
|
861
862
|
this.logger.info(record.liveGuardBuyArr);
|
|
863
|
+
const liveGuardBuyArr = structuredClone(record.liveGuardBuyArr);
|
|
862
864
|
const success = await withRetry(async () => {
|
|
863
|
-
return await this.ctx.broadcast(
|
|
865
|
+
return await this.ctx.broadcast(liveGuardBuyArr, /* @__PURE__ */ jsx("message", { children: content }));
|
|
864
866
|
}, 1);
|
|
865
867
|
this.logger.info(`成功推送上舰消息群组/频道:${success}`);
|
|
866
868
|
}
|
|
@@ -914,15 +916,15 @@ var ComRegister = class {
|
|
|
914
916
|
}, 1).catch(async (e$1) => {
|
|
915
917
|
if (e$1.message === "直播开播动态,不做处理") return;
|
|
916
918
|
if (e$1.message === "出现关键词,屏蔽该动态") {
|
|
917
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
919
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs("message", { children: [name$3, "发布了一条含有屏蔽关键字的动态"] }), PushType.Dynamic);
|
|
918
920
|
return;
|
|
919
921
|
}
|
|
920
922
|
if (e$1.message === "已屏蔽转发动态") {
|
|
921
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
923
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs("message", { children: [name$3, "转发了一条动态,已屏蔽"] }), PushType.Dynamic);
|
|
922
924
|
return;
|
|
923
925
|
}
|
|
924
926
|
if (e$1.message === "已屏蔽专栏动态") {
|
|
925
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
927
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs("message", { children: [name$3, "投稿了一条专栏,已屏蔽"] }), PushType.Dynamic);
|
|
926
928
|
return;
|
|
927
929
|
}
|
|
928
930
|
this.logger.error(`dynamicDetect generateDynamicImg() 推送卡片发送失败,原因:${e$1.message}`);
|
|
@@ -936,7 +938,7 @@ var ComRegister = class {
|
|
|
936
938
|
} else dUrl = `${name$3}发布了新视频:https:${item.modules.module_dynamic.major.archive.jump_url}`;
|
|
937
939
|
else dUrl = `${name$3}发布了一条动态:https://t.bilibili.com/${item.id_str}`;
|
|
938
940
|
this.logger.info("推送动态中...");
|
|
939
|
-
await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs(
|
|
941
|
+
await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs("message", { children: [/* @__PURE__ */ jsx("message", { children: h.image(buffer, "image/jpeg") }), /* @__PURE__ */ jsx("message", { children: dUrl })] }), PushType.Dynamic);
|
|
940
942
|
if (this.config.pushImgsInDynamic) {
|
|
941
943
|
if (item.type === "DYNAMIC_TYPE_DRAW") {
|
|
942
944
|
const pics = item.modules?.module_dynamic?.major?.opus?.pics;
|
|
@@ -1019,15 +1021,15 @@ var ComRegister = class {
|
|
|
1019
1021
|
}, 1).catch(async (e$1) => {
|
|
1020
1022
|
if (e$1.message === "直播开播动态,不做处理") return;
|
|
1021
1023
|
if (e$1.message === "出现关键词,屏蔽该动态") {
|
|
1022
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
1024
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs("message", { children: [name$3, "发布了一条含有屏蔽关键字的动态"] }), PushType.Dynamic);
|
|
1023
1025
|
return;
|
|
1024
1026
|
}
|
|
1025
1027
|
if (e$1.message === "已屏蔽转发动态") {
|
|
1026
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
1028
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs("message", { children: [name$3, "转发了一条动态,已屏蔽"] }), PushType.Dynamic);
|
|
1027
1029
|
return;
|
|
1028
1030
|
}
|
|
1029
1031
|
if (e$1.message === "已屏蔽专栏动态") {
|
|
1030
|
-
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid,
|
|
1032
|
+
if (this.config.filter.notify) await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs("message", { children: [name$3, "投稿了一条专栏,已屏蔽"] }), PushType.Dynamic);
|
|
1031
1033
|
return;
|
|
1032
1034
|
}
|
|
1033
1035
|
this.logger.error(`dynamicDetect generateDynamicImg() 推送卡片发送失败,原因:${e$1.message}`);
|
|
@@ -1046,7 +1048,7 @@ var ComRegister = class {
|
|
|
1046
1048
|
this.logger.info("动态链接生成成功!");
|
|
1047
1049
|
}
|
|
1048
1050
|
this.logger.info("推送动态中...");
|
|
1049
|
-
await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs(
|
|
1051
|
+
await this.broadcastToTargets(sub.uid, /* @__PURE__ */ jsxs("message", { children: [/* @__PURE__ */ jsx("message", { children: h.image(buffer, "image/jpeg") }), /* @__PURE__ */ jsx("message", { children: dUrl })] }), PushType.Dynamic);
|
|
1050
1052
|
if (this.config.pushImgsInDynamic) {
|
|
1051
1053
|
this.logger.info("需要发送动态中的图片,开始发送...");
|
|
1052
1054
|
if (item.type === "DYNAMIC_TYPE_DRAW") {
|
|
@@ -1118,7 +1120,7 @@ var ComRegister = class {
|
|
|
1118
1120
|
this.logger.error(`liveDetect generateLiveImg() 推送卡片生成失败,原因:${e$1.message}`);
|
|
1119
1121
|
});
|
|
1120
1122
|
if (!buffer) return await this.sendPrivateMsgAndStopService();
|
|
1121
|
-
const msg = /* @__PURE__ */ jsxs(
|
|
1123
|
+
const msg = /* @__PURE__ */ jsxs("message", { children: [/* @__PURE__ */ jsx("message", { children: h.image(buffer, "image/jpeg") }), /* @__PURE__ */ jsx("message", { children: liveNotifyMsg || "" })] });
|
|
1122
1124
|
return await this.broadcastToTargets(uid, msg, liveType === LiveType.StartBroadcasting ? PushType.StartBroadcasting : PushType.Live);
|
|
1123
1125
|
}
|
|
1124
1126
|
async liveDetectWithListener(roomId, uid, cardStyle) {
|
|
@@ -1183,7 +1185,15 @@ var ComRegister = class {
|
|
|
1183
1185
|
watchedNum = body.text_small;
|
|
1184
1186
|
},
|
|
1185
1187
|
onGuardBuy: ({ body }) => {
|
|
1186
|
-
const content =
|
|
1188
|
+
const content = /* @__PURE__ */ jsxs("message", { children: [
|
|
1189
|
+
"【",
|
|
1190
|
+
masterInfo.username,
|
|
1191
|
+
"的直播间】",
|
|
1192
|
+
body.user.uname,
|
|
1193
|
+
"加入了大航海(",
|
|
1194
|
+
body.gift_name,
|
|
1195
|
+
")"
|
|
1196
|
+
] });
|
|
1187
1197
|
this.broadcastToTargets(uid, content, PushType.LiveGuardBuy);
|
|
1188
1198
|
},
|
|
1189
1199
|
onLiveStart: async () => {
|
|
@@ -58058,7 +58068,7 @@ var require_helpers$1 = __commonJS$1({ "node_modules/socks/build/common/helpers.
|
|
|
58058
58068
|
}
|
|
58059
58069
|
function ipv4ToInt32(ip) {
|
|
58060
58070
|
const address = new ip_address_1$1.Address4(ip);
|
|
58061
|
-
return address.toArray().reduce((acc, part) => (acc << 8) + part, 0);
|
|
58071
|
+
return address.toArray().reduce((acc, part) => (acc << 8) + part, 0) >>> 0;
|
|
58062
58072
|
}
|
|
58063
58073
|
exports.ipv4ToInt32 = ipv4ToInt32;
|
|
58064
58074
|
function int32ToIpv4(int32) {
|
package/package.json
CHANGED