koishi-plugin-bilibili-notify 1.2.0-rc.4 → 1.2.0-rc.5
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.d.ts +6 -0
- package/lib/comRegister.js +9 -2
- package/lib/generateImg.d.ts +0 -1
- package/lib/generateImg.js +1 -1
- package/lib/index.js +6 -3
- package/package.json +1 -1
- package/readme.md +2 -0
package/lib/comRegister.d.ts
CHANGED
|
@@ -44,6 +44,12 @@ declare namespace ComRegister {
|
|
|
44
44
|
customLiveEnd: string;
|
|
45
45
|
dynamicLoopTime: number;
|
|
46
46
|
dynamicCheckNumber: number;
|
|
47
|
+
filter: {
|
|
48
|
+
enable: boolean;
|
|
49
|
+
regex: string;
|
|
50
|
+
keywords: Array<string>;
|
|
51
|
+
notify: boolean;
|
|
52
|
+
};
|
|
47
53
|
}
|
|
48
54
|
const Config: Schema<Config>;
|
|
49
55
|
}
|
package/lib/comRegister.js
CHANGED
|
@@ -673,7 +673,8 @@ class ComRegister {
|
|
|
673
673
|
if (e.message === '直播开播动态,不做处理')
|
|
674
674
|
break;
|
|
675
675
|
if (e.message === '出现关键词,屏蔽该动态') {
|
|
676
|
-
|
|
676
|
+
// 如果需要发送才发送
|
|
677
|
+
this.config.filter.notify && await this.sendMsg(guildId, bot, `UID:${uid} 发布了一条含有屏蔽关键字的动态`);
|
|
677
678
|
break;
|
|
678
679
|
}
|
|
679
680
|
}
|
|
@@ -1167,7 +1168,13 @@ class ComRegister {
|
|
|
1167
1168
|
customLiveStart: koishi_1.Schema.string().required(),
|
|
1168
1169
|
customLiveEnd: koishi_1.Schema.string().required(),
|
|
1169
1170
|
dynamicLoopTime: koishi_1.Schema.number().default(60),
|
|
1170
|
-
dynamicCheckNumber: koishi_1.Schema.number().required()
|
|
1171
|
+
dynamicCheckNumber: koishi_1.Schema.number().required(),
|
|
1172
|
+
filter: koishi_1.Schema.object({
|
|
1173
|
+
enable: koishi_1.Schema.boolean(),
|
|
1174
|
+
regex: koishi_1.Schema.string(),
|
|
1175
|
+
keywords: koishi_1.Schema.array(String),
|
|
1176
|
+
notify: koishi_1.Schema.boolean(),
|
|
1177
|
+
}),
|
|
1171
1178
|
});
|
|
1172
1179
|
})(ComRegister || (ComRegister = {}));
|
|
1173
1180
|
exports.default = ComRegister;
|
package/lib/generateImg.d.ts
CHANGED
package/lib/generateImg.js
CHANGED
|
@@ -1367,7 +1367,7 @@ class GenerateImg extends koishi_1.Service {
|
|
|
1367
1367
|
enable: koishi_1.Schema.boolean(),
|
|
1368
1368
|
regex: koishi_1.Schema.string(),
|
|
1369
1369
|
keywords: koishi_1.Schema.array(String),
|
|
1370
|
-
|
|
1370
|
+
notify: koishi_1.Schema.boolean(),
|
|
1371
1371
|
}),
|
|
1372
1372
|
removeBorder: koishi_1.Schema.boolean(),
|
|
1373
1373
|
cardColorStart: koishi_1.Schema.string(),
|
package/lib/index.js
CHANGED
|
@@ -114,7 +114,9 @@ exports.Config = koishi_1.Schema.object({
|
|
|
114
114
|
regex: koishi_1.Schema.string()
|
|
115
115
|
.description('正则表达式屏蔽'),
|
|
116
116
|
keywords: koishi_1.Schema.array(String)
|
|
117
|
-
.description('关键字屏蔽,一个关键字为一项')
|
|
117
|
+
.description('关键字屏蔽,一个关键字为一项'),
|
|
118
|
+
notify: koishi_1.Schema.boolean()
|
|
119
|
+
.description('动态被屏蔽是否发送提示')
|
|
118
120
|
}),
|
|
119
121
|
koishi_1.Schema.object({})
|
|
120
122
|
])
|
|
@@ -182,12 +184,13 @@ function apply(ctx, config) {
|
|
|
182
184
|
customLiveStart: config.customLiveStart,
|
|
183
185
|
customLiveEnd: config.customLiveEnd,
|
|
184
186
|
dynamicCheckNumber: config.dynamicCheckNumber,
|
|
185
|
-
dynamicLoopTime
|
|
187
|
+
dynamicLoopTime,
|
|
188
|
+
filter: config.filter
|
|
186
189
|
});
|
|
187
190
|
// 当用户输入“恶魔兔,启动!”时,执行 help 指令
|
|
188
191
|
ctx.middleware((session, next) => {
|
|
189
192
|
if (session.content === '恶魔兔,启动!') {
|
|
190
|
-
return session.
|
|
193
|
+
return session.send('启动不了一点');
|
|
191
194
|
}
|
|
192
195
|
else {
|
|
193
196
|
return next();
|
package/package.json
CHANGED
package/readme.md
CHANGED