koishi-plugin-bilibili-notify 3.0.0-alpha.15 → 3.0.0-alpha.17
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 +4 -43
- package/lib/comRegister.js +204 -834
- package/lib/database.d.ts +0 -11
- package/lib/database.js +0 -11
- package/lib/generateImg.d.ts +2 -1
- package/lib/generateImg.js +31 -26
- package/lib/index.d.ts +1 -1
- package/lib/index.js +18 -22
- package/lib/type/index.d.ts +37 -0
- package/lib/type/index.js +11 -0
- package/package.json +1 -1
- package/readme.md +4 -34
package/lib/comRegister.d.ts
CHANGED
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
import { type Bot, type Context, type FlatPick, type Logger, Schema
|
|
1
|
+
import { type Bot, type Context, type FlatPick, type Logger, Schema } from "koishi";
|
|
2
2
|
import type { Notifier } from "@koishijs/plugin-notifier";
|
|
3
3
|
import type { LoginBili } from "./database";
|
|
4
|
-
|
|
5
|
-
NotLiveBroadcast = 0,
|
|
6
|
-
StartBroadcasting = 1,
|
|
7
|
-
LiveBroadcast = 2,
|
|
8
|
-
StopBroadcast = 3
|
|
9
|
-
}
|
|
10
|
-
type ChannelIdArr = Array<{
|
|
11
|
-
channelId: string;
|
|
12
|
-
dynamic: boolean;
|
|
13
|
-
live: boolean;
|
|
14
|
-
liveGuardBuy: boolean;
|
|
15
|
-
atAll: boolean;
|
|
16
|
-
}>;
|
|
17
|
-
type TargetItem = {
|
|
18
|
-
channelIdArr: ChannelIdArr;
|
|
19
|
-
platform: string;
|
|
20
|
-
};
|
|
21
|
-
type Target = Array<TargetItem>;
|
|
22
|
-
type SubItem = {
|
|
23
|
-
id: number;
|
|
24
|
-
uid: string;
|
|
25
|
-
roomId: string;
|
|
26
|
-
target: Target;
|
|
27
|
-
platform: string;
|
|
28
|
-
live: boolean;
|
|
29
|
-
dynamic: boolean;
|
|
30
|
-
};
|
|
31
|
-
type SubManager = Array<SubItem>;
|
|
4
|
+
import { LiveType, type MasterInfo, type SubManager, type Target } from "./type";
|
|
32
5
|
declare class ComRegister {
|
|
33
6
|
static inject: string[];
|
|
34
7
|
qqRelatedBotList: Array<string>;
|
|
@@ -47,7 +20,6 @@ declare class ComRegister {
|
|
|
47
20
|
sendMsgFunc: (bot: Bot<Context, any>, channelId: string, content: any) => Promise<void>;
|
|
48
21
|
constructor(ctx: Context, config: ComRegister.Config);
|
|
49
22
|
init(config: ComRegister.Config): Promise<void>;
|
|
50
|
-
splitMultiPlatformStr(str: string): Target;
|
|
51
23
|
getBot(pf: string): Bot<Context, any>;
|
|
52
24
|
sendPrivateMsg(content: string): Promise<void>;
|
|
53
25
|
sendPrivateMsgAndRebootService(): Promise<void>;
|
|
@@ -60,17 +32,11 @@ declare class ComRegister {
|
|
|
60
32
|
userface: string;
|
|
61
33
|
target: Target;
|
|
62
34
|
data: any;
|
|
63
|
-
}, liveType: LiveType, liveNotifyMsg?: string): Promise<void>;
|
|
64
|
-
useMasterInfo(uid: string): Promise<
|
|
65
|
-
username: string;
|
|
66
|
-
userface: string;
|
|
67
|
-
roomId: number;
|
|
68
|
-
}>;
|
|
35
|
+
}, liveType: LiveType, followerDisplay: string, liveNotifyMsg?: string): Promise<void>;
|
|
36
|
+
useMasterInfo(uid: string, masterInfo: MasterInfo, liveType: LiveType): Promise<MasterInfo>;
|
|
69
37
|
useLiveRoomInfo(roomId: string): Promise<any>;
|
|
70
|
-
liveDetectWithAPI(): Promise<() => Promise<void>>;
|
|
71
38
|
liveDetectWithListener(roomId: string, target: Target): Promise<void>;
|
|
72
39
|
subShow(): string;
|
|
73
|
-
checkIfNeedSub(liveSub: boolean, dynamicSub: boolean, session: Session, liveRoomData: any): Promise<Array<boolean>>;
|
|
74
40
|
updateSubNotifier(): void;
|
|
75
41
|
checkIfLoginInfoIsLoaded(): Promise<unknown>;
|
|
76
42
|
subUserInBili(mid: string): Promise<{
|
|
@@ -78,12 +44,8 @@ declare class ComRegister {
|
|
|
78
44
|
msg: string;
|
|
79
45
|
}>;
|
|
80
46
|
loadSubFromConfig(subs: ComRegister.Config["sub"]): Promise<void>;
|
|
81
|
-
loadSubFromDatabase(): Promise<void>;
|
|
82
47
|
checkIfDynamicDetectIsNeeded(): void;
|
|
83
48
|
enableDynamicDetect(): void;
|
|
84
|
-
unsubSingle(id: string, type: number): string;
|
|
85
|
-
checkIfUserIsTheLastOneWhoSubDyn(): void;
|
|
86
|
-
unsubAll(uid: string): void;
|
|
87
49
|
checkIfIsLogin(): Promise<boolean>;
|
|
88
50
|
}
|
|
89
51
|
declare namespace ComRegister {
|
|
@@ -109,7 +71,6 @@ declare namespace ComRegister {
|
|
|
109
71
|
masterAccount: string;
|
|
110
72
|
masterAccountGuildId: string;
|
|
111
73
|
};
|
|
112
|
-
unlockSubLimits: boolean;
|
|
113
74
|
automaticResend: boolean;
|
|
114
75
|
liveDetectMode: "API" | "WS";
|
|
115
76
|
restartPush: boolean;
|