From 9d949dc649355e7303393eec00bc6c610e5056e7 Mon Sep 17 00:00:00 2001 From: prosolis <5590409+prosolis@users.noreply.github.com> Date: Sun, 26 Apr 2026 20:38:16 -0700 Subject: [PATCH] Hold'em: deduplicate broadcast in solo-vs-bot games MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Win/end announcements were sent twice in solo-vs-bot: once via SendMessage(game.RoomID, ...) for the public room, once via broadcastDM which iterated the human player's DMRoomID — but in solo-vs-bot the game.RoomID IS the player's DM. Skip players whose DMRoomID matches game.RoomID in broadcastDM so the room post isn't echoed. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/plugin/holdem.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/plugin/holdem.go b/internal/plugin/holdem.go index eae6f61..297463c 100644 --- a/internal/plugin/holdem.go +++ b/internal/plugin/holdem.go @@ -971,6 +971,12 @@ func (p *HoldemPlugin) broadcastDM(game *HoldemGame, msg string) { if pl.IsNPC || pl.State == PlayerSatOut { continue } + // Skip players whose DM room IS the game room — they already saw + // the message via the public-room post (solo-vs-bot case, where + // game.RoomID == player's DM). + if pl.DMRoomID == game.RoomID { + continue + } p.SendMessage(pl.DMRoomID, msg) } }