Adv 2.0: fork !expedition list off zoneCmdList

!expedition list was routing to zoneCmdList, which rendered "Zones
available at L%d" with `!zone enter <id>` CTAs and referenced an active
zone run for the footer — wrong system for an expedition caller. New
expeditionCmdList mirrors the zone-list shape but uses expedition CTAs
(`!expedition start <id>`) and surfaces the active expedition (day
count, `!expedition status` / `!expedition abandon`) via
getActiveExpedition. zoneCmdList stays for !zone list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-09 13:04:07 -07:00
parent 5d98e5684a
commit 9d6e8f6bf2

View File

@@ -55,7 +55,7 @@ func (p *AdventurePlugin) handleDnDExpeditionCmd(ctx MessageContext, args string
case "help", "?": case "help", "?":
return p.SendDM(ctx.Sender, expeditionHelpText()) return p.SendDM(ctx.Sender, expeditionHelpText())
case "list", "ls": case "list", "ls":
return p.zoneCmdList(ctx, c) return p.expeditionCmdList(ctx, c)
case "start", "begin", "go": case "start", "begin", "go":
return p.expeditionCmdStart(ctx, c, rest) return p.expeditionCmdStart(ctx, c, rest)
case "status", "info": case "status", "info":
@@ -92,6 +92,28 @@ func expeditionHelpText() string {
return b.String() return b.String()
} }
// ── list ────────────────────────────────────────────────────────────────────
func (p *AdventurePlugin) expeditionCmdList(ctx MessageContext, c *DnDCharacter) error {
zones := zonesForLevel(c.Level)
if len(zones) == 0 {
return p.SendDM(ctx.Sender, "No zones available at your level. (This shouldn't happen — file a bug.)")
}
var b strings.Builder
b.WriteString(fmt.Sprintf("**Expeditions available at L%d** (you can enter zones up to 2 tiers above your current tier):\n\n", c.Level))
for i, z := range zones {
b.WriteString(fmt.Sprintf("**%d.** %s — _T%d, L%d%d_ `!expedition start %s`\n",
i+1, z.Display, int(z.Tier), z.LevelMin, z.LevelMax, z.ID))
b.WriteString(fmt.Sprintf(" %s\n", z.Atmosphere))
}
if exp, _ := getActiveExpedition(ctx.Sender); exp != nil {
zone := zoneOrFallback(exp.ZoneID)
b.WriteString(fmt.Sprintf("\n_⚠ Active expedition: **%s**, day %d. Use `!expedition status` or `!expedition abandon`._",
zone.Display, exp.CurrentDay))
}
return p.SendDM(ctx.Sender, b.String())
}
// ── start ─────────────────────────────────────────────────────────────────── // ── start ───────────────────────────────────────────────────────────────────
// parseSupplyArgs reads a token stream like "2s 1d" into a SupplyPurchase. // parseSupplyArgs reads a token stream like "2s 1d" into a SupplyPurchase.