mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
fix: edge case bugs + toggle lyrics from player bar and lyrics button
Bugs fixed: - play-at: stop current playback before jumping to queue index - playNext retry: use break instead of return to ensure stateChange emits - sendVoiceData: skip if disconnecting to avoid errors during teardown UI: player-left and lyrics button now toggle lyrics page (open/close) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
90019e7424
commit
eb0088d110
4 files changed
+18
-7
No files matched your search
+1
-1
@@ -491,7 +491,7 @@ export class BotInstance extends EventEmitter {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const retry = this.queue.next();
|
||||
if (!retry) break;
|
||||
if (await this.resolveAndPlay(retry)) return;
|
||||
if (await this.resolveAndPlay(retry)) break;
|
||||
}
|
||||
this.player.stop();
|
||||
}
|
||||
|
||||
@@ -154,8 +154,7 @@ export class TS3Client extends EventEmitter {
|
||||
}
|
||||
|
||||
sendVoiceData(opusFrame: Buffer): void {
|
||||
if (!this.client) return;
|
||||
// Codec 5 = CODEC_OPUS_MUSIC
|
||||
if (!this.client || this.disconnecting) return;
|
||||
this.client.sendVoice(opusFrame, 5);
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ export function createPlayerRouter(
|
||||
return;
|
||||
}
|
||||
const queue = bot.getQueueManager();
|
||||
bot.getPlayer().stop(); // Stop current playback first
|
||||
const song = queue.playAt(index);
|
||||
if (!song) {
|
||||
res.status(400).json({ error: "Invalid queue index" });
|
||||
|
||||
Reference in new issue
Block a user