diff --git a/src/bot/instance.ts b/src/bot/instance.ts index 553e7aa..1bc61b7 100755 --- a/src/bot/instance.ts +++ b/src/bot/instance.ts @@ -61,11 +61,9 @@ export class BotInstance extends EventEmitter { private disconnectEmitted = false; private voteSkipUsers = new Set(); private isAdvancing = false; -<<<<<<< HEAD private idleTimer: ReturnType | null = null; private channelUserCount = 0; private profileManager: BotProfileManager; ->>>>>>> origin/main constructor(options: BotInstanceOptions) { super(); diff --git a/src/music/api-server.ts b/src/music/api-server.ts index 4ed45b7..3f95a75 100644 --- a/src/music/api-server.ts +++ b/src/music/api-server.ts @@ -76,7 +76,14 @@ export function createApiServerManager( ); } else { const qqModule = (await import("@sansenjian/qq-music-api")) as any; - const koaApp = qqModule.default ?? qqModule; + // The module's export structure varies between versions: + // 2.2.11+: default → Koa app (has .listen) + // 2.2.10: default → wrapper object whose .default is the Koa app + // older: module itself may be the Koa app + const candidate = qqModule.default ?? qqModule; + const koaApp = typeof candidate.listen === "function" + ? candidate + : candidate.default ?? null; if (koaApp && typeof koaApp.listen === "function") { qqMusicServer = await new Promise((resolve, reject) => { const srv = koaApp.listen(options.qqMusicPort, "127.0.0.1", () =>