UNPKG

koishi-plugin-bilibili-notify

Version:
134 lines (133 loc) 3.24 kB
import { Context, ForkScope, Schema, Service } from "koishi"; //#region src/config.d.ts interface BAConfig { require: {}; key: string; master: {}; basicSettings: {}; userAgent: string; ai: { enable: boolean; apiKey?: string; baseURL?: string; model?: string; persona?: string; }; subTitle: {}; advancedSub: boolean; subs: Array<{ name: string; uid: string; dynamic: boolean; dynamicAtAll: boolean; live: boolean; liveAtAll: boolean; liveGuardBuy: boolean; superchat: boolean; wordcloud: boolean; liveSummary: boolean; platform: string; target: string; }>; dynamic: {}; dynamicUrl: boolean; dynamicCron: string; dynamicVideoUrlToBV: boolean; pushImgsInDynamic: boolean; live: {}; liveDetectType: "WS" | "API"; wordcloudStopWords: string; liveSummary: Array<string>; restartPush: boolean; pushTime: number; customLiveStart: string; customLive: string; customLiveEnd: string; followerDisplay: boolean; hideDesc: boolean; style: {}; removeBorder: boolean; cardColorStart: string; cardColorEnd: string; cardBasePlateColor: string; cardBasePlateBorder: string; enableLargeFont: boolean; font: string; filter: {}; debug: {}; dynamicDebugMode: boolean; } //#endregion //#region src/type/index.d.ts type Channel = { channelId: string; dynamic: boolean; dynamicAtAll: boolean; live: boolean; liveAtAll: boolean; liveGuardBuy: boolean; superchat: boolean; wordcloud: boolean; liveSummary: boolean; }; type ChannelArr = Array<Channel>; type TargetItem = { channelArr: ChannelArr; platform: string; }; type Target = Array<TargetItem>; type CustomCardStyle = { enable: boolean; cardColorStart?: string; cardColorEnd?: string; cardBasePlateColor?: string; cardBasePlateBorder?: string; }; type CustomLiveMsg = { enable: boolean; customLiveStart?: string; customLive?: string; customLiveEnd?: string; }; type CustomLiveSummary = { enable: boolean; liveSummary?: string; }; type Subscription = { uname: string; uid: string; roomid: string; dynamic: boolean; live: boolean; target: Target; customCardStyle: CustomCardStyle; customLiveMsg: CustomLiveMsg; customLiveSummary: CustomLiveSummary; }; type Subscriptions = Record<string, Subscription>; //#endregion //#region src/index.d.ts declare const inject: string[]; declare const name = "bilibili-notify"; declare const usage = "\n\tBilibili-Notify\n\t\u5982\u9047\u5230\u4F7F\u7528\u95EE\u9898\u6216bug\uFF0C\u8BF7\u52A0\u7FA4\u54A8\u8BE2 801338523\n"; declare module "koishi" { interface Context { "bilibili-notify": ServerManager; } interface Events { "bilibili-notify/advanced-sub"(subs: Subscriptions): void; "bilibili-notify/ready-to-recive"(): void; } } declare class ServerManager extends Service { servers: ForkScope[]; constructor(ctx: Context); protected start(): void | Promise<void>; registerPlugin: () => boolean; disposePlugin: () => Promise<boolean>; restartPlugin: () => Promise<boolean>; } declare function apply(ctx: Context, config: BAConfig): void; declare const Config: Schema<BAConfig>; //#endregion export { Config, apply, inject, name, usage };