Merge remote-tracking branch 'upstream/main' into feat/song-vip-flag

# Conflicts:
#	src/bot/instance.ts
This commit is contained in:
Slldyd2077 committed 2026-06-28 21:31:17 +08:00
commit d1bd010260
49 files changed
+4361 -174

No files matched your search

+9
View File
@@ -82,6 +82,7 @@ export class BotInstance extends EventEmitter {
private lastSearchResults: Song[] = [];
/** 当前曲实际播放时长(试听片段秒数或完整 duration);resolveAndPlay 赋值。 */
private effectiveDuration: number | undefined;
private playGate: Promise<unknown> = Promise.resolve();
constructor(options: BotInstanceOptions) {
super();
@@ -1057,6 +1058,14 @@ export class BotInstance extends EventEmitter {
return input;
}
/** Serialize queue-mutation + play sequences so concurrent requests can't
* interleave (audible track must match queue.currentIndex). */
runExclusive<T>(fn: () => Promise<T>): Promise<T> {
const next = this.playGate.then(fn, fn);
this.playGate = next.catch(() => {});
return next;
}
getStatus(): BotStatus {
return {
id: this.id,