Coop: substitute {count} and {leader} placeholders in gift flavor

The TwinBeeGiftArrival pool entries each end with a templated footer
authored to the spec format ("Open: {count} · Leave it: {count}\nMajority
rules. Ties go to {leader}."), but the placeholders were never being
substituted — players saw the literal "{count}" and "{leader}" strings.

Substitute in renderCoopGiftPost: ordered Replace for the two {count}
positions (opens, then leaves), ReplaceAll for {leader}. Also dropped
the redundant "Current votes:" line my code was appending — the flavor's
own tally line covers it after substitution.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-04-28 18:14:49 -07:00
parent 9f094549b7
commit b7077eeea1
2 changed files with 28 additions and 19 deletions

View File

@@ -412,7 +412,7 @@ func (p *AdventurePlugin) handleCoopAdmGift(ctx MessageContext, args string) err
gift, _ := loadCoopGift(giftID)
members, _ := loadCoopMembers(runID)
if gift != nil {
postID, perr := p.SendMessageID(gr, renderCoopGiftPost(run, gift, members))
postID, perr := p.SendMessageID(gr, renderCoopGiftPost(p, run, gift, members))
if perr == nil {
_ = saveCoopGiftPostID(giftID, postID)
}