koishi-plugin-bilibili-notify 3.2.4-alpha.0 → 3.2.4
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 +10 -3
- package/lib/index.d.ts +1 -0
- package/lib/index.js +5 -6
- package/package.json +1 -1
- package/readme.md +4 -3
package/lib/comRegister.js
CHANGED
|
@@ -177,6 +177,14 @@ class ComRegister {
|
|
|
177
177
|
bili_refresh_token: encryptedRefreshToken,
|
|
178
178
|
},
|
|
179
179
|
]);
|
|
180
|
+
// 检查登录数据库是否有数据
|
|
181
|
+
this.loginDBData = (await this.ctx.database.get("loginBili", 1, [
|
|
182
|
+
"dynamic_group_id",
|
|
183
|
+
]))[0];
|
|
184
|
+
// ba重新加载登录信息
|
|
185
|
+
await this.ctx.ba.loadCookiesFromDatabase();
|
|
186
|
+
// 判断登录信息是否已加载完毕
|
|
187
|
+
await this.checkIfLoginInfoIsLoaded();
|
|
180
188
|
// 销毁定时器
|
|
181
189
|
this.loginTimer();
|
|
182
190
|
// 订阅手动订阅中的订阅
|
|
@@ -189,7 +197,7 @@ class ComRegister {
|
|
|
189
197
|
// 发送成功登录推送
|
|
190
198
|
await session.send("登录成功");
|
|
191
199
|
// bili show
|
|
192
|
-
await session.execute("bili
|
|
200
|
+
await session.execute("bili list");
|
|
193
201
|
// 开启cookies刷新检测
|
|
194
202
|
ctx.ba.enableRefreshCookiesDetect();
|
|
195
203
|
}
|
|
@@ -513,7 +521,7 @@ class ComRegister {
|
|
|
513
521
|
// 获取机器人实例
|
|
514
522
|
const bot = this.getBot(targets[0].platform, targetChannel.bot);
|
|
515
523
|
// 判断bot是否存在
|
|
516
|
-
if (!bot) {
|
|
524
|
+
if (!bot || !bot.isActive) {
|
|
517
525
|
// 发送私聊消息
|
|
518
526
|
this.sendPrivateMsg("未找到对应bot实例,本次消息推送取消!");
|
|
519
527
|
// logger
|
|
@@ -938,7 +946,6 @@ class ComRegister {
|
|
|
938
946
|
// 返回一个闭包函数
|
|
939
947
|
return (0, utils_1.withLock)(handler);
|
|
940
948
|
}
|
|
941
|
-
// 定义获取主播信息方法
|
|
942
949
|
async useMasterInfo(uid, masterInfo, liveType) {
|
|
943
950
|
// 获取主播信息
|
|
944
951
|
const { data } = await this.ctx.ba.getMasterInfo(uid);
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Context, type ForkScope, Schema, Service } from "koishi";
|
|
2
2
|
export declare const inject: string[];
|
|
3
3
|
export declare const name = "bilibili-notify";
|
|
4
|
+
export declare const usage = "\n\tBilibili-Notify\n\t\u5982\u9047\u5230\u4F7F\u7528\u95EE\u9898\u6216bug\uFF0C\u8BF7\u52A0\u7FA4\u54A8\u8BE2 801338523\n";
|
|
4
5
|
declare module "koishi" {
|
|
5
6
|
interface Context {
|
|
6
7
|
sm: ServerManager;
|
package/lib/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Config = exports.name = exports.inject = void 0;
|
|
39
|
+
exports.Config = exports.usage = exports.name = exports.inject = void 0;
|
|
40
40
|
exports.apply = apply;
|
|
41
41
|
const koishi_1 = require("koishi");
|
|
42
42
|
// import plugins
|
|
@@ -48,6 +48,10 @@ const biliAPI_1 = __importDefault(require("./biliAPI"));
|
|
|
48
48
|
const blive_1 = __importDefault(require("./blive"));
|
|
49
49
|
exports.inject = ["puppeteer", "database", "notifier"];
|
|
50
50
|
exports.name = "bilibili-notify";
|
|
51
|
+
exports.usage = `
|
|
52
|
+
Bilibili-Notify
|
|
53
|
+
如遇到使用问题或bug,请加群咨询 801338523
|
|
54
|
+
`;
|
|
51
55
|
let globalConfig;
|
|
52
56
|
class ServerManager extends koishi_1.Service {
|
|
53
57
|
// 服务
|
|
@@ -193,11 +197,6 @@ class ServerManager extends koishi_1.Service {
|
|
|
193
197
|
function apply(ctx, config) {
|
|
194
198
|
// 设置config
|
|
195
199
|
globalConfig = config;
|
|
196
|
-
// 设置提示
|
|
197
|
-
ctx.notifier.create({
|
|
198
|
-
type: "warning",
|
|
199
|
-
content: "请使用Auth插件创建超级管理员账号,没有权限将无法使用该插件提供的指令",
|
|
200
|
-
});
|
|
201
200
|
// load database
|
|
202
201
|
ctx.plugin(Database);
|
|
203
202
|
// Register ServerManager
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -255,8 +255,8 @@ uid为必填参数,为要推送的UP主的UID,index为可选参数,为要
|
|
|
255
255
|
- ver 3.2.0-alpha.4 修复:直播卡片推送时间会是设置的 `pushTime` 的两倍;
|
|
256
256
|
- ver 3.2.0-alpha.5 修复:直播检测 `WS` 模式下,直播中推送卡片 `累计观看人数` 位置错误显示为 `粉丝数变化` 、转发动态的留言文字不显示; 优化:直播检测 `API` 模式下,直播推送语 `-watched` 固定显示为 `API模式无法获取`;
|
|
257
257
|
- ver 3.2.0-alpha.6 优化:调整配置项;
|
|
258
|
-
- ver 3.2.0-alpha.7 修复:自 `3.1.7` 版本 `
|
|
259
|
-
- ver 3.2.1-alpha.0 新增:多个相同平台bot可以选择某个群聊/频道指定机器人发送; 优化:直播检测 `WS` 模式下播后仍推送、添加依赖 `cacheable-lookup` 优化网络; 修复:打开 `
|
|
258
|
+
- ver 3.2.0-alpha.7 修复:自 `3.1.7` 版本 `pushImgsInDynamic` 功能失效;
|
|
259
|
+
- ver 3.2.1-alpha.0 新增:多个相同平台bot可以选择某个群聊/频道指定机器人发送; 优化:直播检测 `WS` 模式下播后仍推送、添加依赖 `cacheable-lookup` 优化网络; 修复:打开 `pushImgsInDynamic` 功能时,如果发送的动态里没有图片则会报错 `TypeError: Cannot read properties of null (reading 'opus')`
|
|
260
260
|
- ver 3.2.1-alpha.1 调整:将项目构建产物调整为 `esm`;
|
|
261
261
|
- ver 3.2.1-alpha.2 调整:将项目构建产物调整回 `cjs` 、将依赖 `cacheable-lookup` 导入方式更改为动态导入;
|
|
262
262
|
- ver 3.2.1-alpha.3 修复:直播检测 `WS` 初始化后自动断开连接;
|
|
@@ -268,7 +268,8 @@ uid为必填参数,为要推送的UP主的UID,index为可选参数,为要
|
|
|
268
268
|
- ver 3.2.1 优化:移除不必要成员变量、创建自动上传npm `github actions`,添加相关开发依赖;
|
|
269
269
|
- ver 3.2.2 调整:修改 `github actions`;
|
|
270
270
|
- ver 3.2.3 优化:移除不必要的代码;
|
|
271
|
-
- ver 3.2.4-alpha.0 优化:选项 `
|
|
271
|
+
- ver 3.2.4-alpha.0 优化:选项 `pushImgsInDynamic` 发送多图会以转发消息的格式发送; 新增:选项 `dynamicVideoUrlToBV` 开启后将链接转换为bv号以用作特殊用途;
|
|
272
|
+
- ver 3.2.4 修复:第一次使用插件时,使用登录指令报错; 插件配置页新增和删除提示信息;
|
|
272
273
|
|
|
273
274
|
## 交流群
|
|
274
275
|
|