adventure: stay out of the room when TwinBee already said it

gogobee announces treasure finds, duels, mischief contracts and the
Siege to the games room in TwinBee's voice, and files the same moments
here as facts. Both land in the same room, so the realm heard every one
of them twice, in two voices, minutes apart.

Hold those types back from Matrix. They are stored and published on the
site exactly as before, and the push alerts still fire; only the live
priority beat and the digest sweep skip them, retired against the digest
the same way a no_push backfill is. Types with no room announce behind
them (zone clears, arrivals, deaths, milestones) are untouched and stay
Pete's to report.

room_silent_types overrides the default set; an explicit empty list
turns the suppression off.
This commit is contained in:
prosolis
2026-07-25 10:21:43 -07:00
parent 5b07199631
commit 15e229b6c3
4 changed files with 111 additions and 10 deletions
+42
View File
@@ -38,6 +38,48 @@ type AdventureConfig struct {
// 17. A pointer so digest_hour = 0 (midnight UTC) is distinguishable from
// "unset" and doesn't get silently rewritten to the default.
DigestHour *int `toml:"digest_hour"`
// RoomSilentTypes lists event types gogobee already announces in the games
// room in TwinBee's own voice. Pete stores them and publishes them on the
// site, but never posts them to Matrix — neither the live priority beat nor
// the daily digest — so the room hears each moment once.
//
// Unset falls back to defaultRoomSilentTypes; an explicit empty list turns
// the suppression off and restores the double-post.
RoomSilentTypes []string `toml:"room_silent_types"`
}
// defaultRoomSilentTypes are the event types TwinBee announces to the games room
// itself as of gogobee HEAD. Each has a matching room announce on the gogobee
// side (announceTreasureToRoom, the duel broadcast, announceMischief*,
// announceWorldBoss), so a Pete post is a second telling of the same beat.
//
// Types NOT listed here have no room announce behind them and are Pete's alone
// to report: zone_clear, zone_first, boss_kill, arrival, departure, death,
// retreat, milestone, companion_hire.
var defaultRoomSilentTypes = []string{
"treasure_found",
"rival_result",
"mischief_contract",
"mischief_survived",
"mischief_downed",
"mischief_fizzled",
"siege_start",
"siege_win",
"siege_loss",
}
// RoomSilentSet returns the room-suppressed event types as a lookup set,
// resolving the unset case. Safe on a zero-value AdventureConfig.
func (a AdventureConfig) RoomSilentSet() map[string]bool {
types := a.RoomSilentTypes
if types == nil {
types = defaultRoomSilentTypes
}
set := make(map[string]bool, len(types))
for _, t := range types {
set[t] = true
}
return set
}
// DigestHourOrDefault is the UTC hour the daily digest posts, resolving the