mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
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:
1 parent
8b5a360d8a
commit
3b2d6a7a59
1 file changed
+1
@@ -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));
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user