koishi-plugin-bilibili-notify 1.2.6 → 1.2.7
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/comRegister.js +19 -26
- package/lib/index.js +3 -1
- package/package.json +1 -1
- package/readme.md +2 -0
package/lib/comRegister.js
CHANGED
|
@@ -103,15 +103,6 @@ class ComRegister {
|
|
|
103
103
|
session.send(await ctx.biliAPI.getTimeNow())
|
|
104
104
|
})
|
|
105
105
|
|
|
106
|
-
testCom
|
|
107
|
-
.subcommand('.exist')
|
|
108
|
-
.usage('测试写法')
|
|
109
|
-
.example('test.exist')
|
|
110
|
-
.action(async () => {
|
|
111
|
-
let num = 1;
|
|
112
|
-
console.log(num && `Hello World`);
|
|
113
|
-
})
|
|
114
|
-
|
|
115
106
|
testCom
|
|
116
107
|
.subcommand('.gimg <uid:string> <index:number>')
|
|
117
108
|
.usage('测试图片生成')
|
|
@@ -854,11 +845,11 @@ class ComRegister {
|
|
|
854
845
|
// 如果pic存在,则直接返回pic
|
|
855
846
|
if (pic) {
|
|
856
847
|
// pic存在,使用的是render模式
|
|
857
|
-
await this.sendMsg(ctx, guildId, bot, pic + dUrl);
|
|
848
|
+
await this.sendMsg(ctx, guildId, bot, pic + (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: dUrl }));
|
|
858
849
|
}
|
|
859
850
|
else {
|
|
860
851
|
// pic不存在,说明使用的是page模式
|
|
861
|
-
await this.sendMsg(ctx, guildId, bot, koishi_1.h.image(buffer, 'image/png'
|
|
852
|
+
await this.sendMsg(ctx, guildId, bot, (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [koishi_1.h.image(buffer, 'image/png'), " ", dUrl] }));
|
|
862
853
|
}
|
|
863
854
|
// 更新时间点为最新发布动态的发布时间
|
|
864
855
|
switch (num) {
|
|
@@ -906,27 +897,29 @@ class ComRegister {
|
|
|
906
897
|
}
|
|
907
898
|
}
|
|
908
899
|
// 推送直播信息
|
|
909
|
-
|
|
900
|
+
// pic 存在,使用的是render模式
|
|
901
|
+
if (pic) {
|
|
902
|
+
let msg = (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [atAll && (0, jsx_runtime_1.jsx)("at", { type: "all" }), " ", liveStartMsg && liveStartMsg] });
|
|
903
|
+
return await this.sendMsg(ctx, guildId, bot, pic + msg);
|
|
904
|
+
}
|
|
905
|
+
// pic不存在,说明使用的是page模式
|
|
906
|
+
await this.sendMsg(ctx, guildId, bot, (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [koishi_1.h.image(buffer, 'image/png'), " ", atAll && (0, jsx_runtime_1.jsx)("at", { type: "all" }), " ", liveStartMsg && liveStartMsg] }));
|
|
907
|
+
/* if (!liveStartMsg) {
|
|
910
908
|
// pic 存在,使用的是render模式
|
|
911
|
-
if (pic)
|
|
912
|
-
return await this.sendMsg(ctx, guildId, bot, pic);
|
|
909
|
+
if (pic) return await this.sendMsg(ctx, guildId, bot, pic)
|
|
913
910
|
// pic不存在,说明使用的是page模式
|
|
914
|
-
await this.sendMsg(ctx, guildId, bot,
|
|
915
|
-
}
|
|
916
|
-
else if (liveStartMsg && atAll) {
|
|
911
|
+
await this.sendMsg(ctx, guildId, bot, h.image(buffer, 'image/png'))
|
|
912
|
+
} else if (liveStartMsg && atAll) {
|
|
917
913
|
// pic 存在,使用的是render模式
|
|
918
|
-
if (pic)
|
|
919
|
-
return await this.sendMsg(ctx, guildId, bot, pic + (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("at", { type: "all" }), " ", liveStartMsg, " "] }));
|
|
914
|
+
if (pic) return await this.sendMsg(ctx, guildId, bot, pic + <><at type="all" /> {liveStartMsg} </>)
|
|
920
915
|
// pic不存在,说明使用的是page模式
|
|
921
|
-
await this.sendMsg(ctx, guildId, bot,
|
|
922
|
-
}
|
|
923
|
-
else {
|
|
916
|
+
await this.sendMsg(ctx, guildId, bot, <>{h.image(buffer, 'image/png')} <at type="all" /> {liveStartMsg}</>)
|
|
917
|
+
} else {
|
|
924
918
|
// pic 存在,使用的是render模式
|
|
925
|
-
if (pic)
|
|
926
|
-
return await this.sendMsg(ctx, guildId, bot, pic + liveStartMsg);
|
|
919
|
+
if (pic) return await this.sendMsg(ctx, guildId, bot, pic + <>{liveStartMsg}</>)
|
|
927
920
|
// pic不存在,说明使用的是page模式
|
|
928
|
-
await this.sendMsg(ctx, guildId, bot,
|
|
929
|
-
}
|
|
921
|
+
await this.sendMsg(ctx, guildId, bot, h.image(buffer, 'image/png' + liveStartMsg))
|
|
922
|
+
} */
|
|
930
923
|
};
|
|
931
924
|
return async () => {
|
|
932
925
|
try {
|
package/lib/index.js
CHANGED
|
@@ -158,7 +158,7 @@ class ServerManager extends koishi_1.Service {
|
|
|
158
158
|
super(ctx, 'sm');
|
|
159
159
|
}
|
|
160
160
|
start() {
|
|
161
|
-
|
|
161
|
+
// 根据用户设置的渲染模式设置
|
|
162
162
|
switch (globalConfig.renderType) {
|
|
163
163
|
case 'render':
|
|
164
164
|
this.renderType = 0;
|
|
@@ -167,6 +167,8 @@ class ServerManager extends koishi_1.Service {
|
|
|
167
167
|
this.renderType = 1;
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
170
|
+
// 注册插件
|
|
171
|
+
this.registerPlugin();
|
|
170
172
|
}
|
|
171
173
|
registerPlugin = () => {
|
|
172
174
|
const biliApi = this.ctx.plugin(biliAPI_1.default);
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -139,6 +139,8 @@
|
|
|
139
139
|
- ver 1.2.3 完善主播下播消息发送头像功能,优化控制台订阅信息显示
|
|
140
140
|
- ver 1.2.4 优化了下播消息发送头像图片的质量和插件重启提示
|
|
141
141
|
- ver 1.2.5 修复了在多群订阅的情况下,其中一个群推送失败会导致其余的群全部重新推送的bug。更换图片处理依赖以解决在插件市场中被标记为不安全插件的问题
|
|
142
|
+
- ver 1.2.6 现在可以随机生成UA,并更新了UA
|
|
143
|
+
- ver 1.2.7 修复不论选择什么渲染模式都是render模式的bug,优化直播卡片推送逻辑
|
|
142
144
|
|
|
143
145
|
## 交流群
|
|
144
146
|
|