fix(ts-protocol): drop self-echoed text messages

TeamSpeak echoes a bot's own channel/server messages back to itself.
Without filtering, a chunked reply re-entered the command path: !help's
output exceeds the ~1024-byte per-message cap, so splitTextIntoChunks
splits it, and the second chunk (which starts with "!artist ...") was
parsed as a new !artist command, loading 20 search results and starting
playback.

Drop messages whose invokerID matches the bot's own clientId at the
transport boundary, before they reach any consumer.
This commit is contained in:
EvolvedGhost committed 2026-07-18 01:03:25 +08:00
1 parent 8b5a360d8a
commit 3b2d6a7a59
1 file changed
+1
+1
View File
@@ -222,6 +222,7 @@ export class TS3Client extends EventEmitter {
});
this.client.on("textMessage", (msg: TextMessage) => {
if (msg.invokerID === this.clientId) return;
this.emit("textMessage", toTS3TextMessage(msg));
});