From d037d4e6897963fa89e24485e0de8ded34c127e3 Mon Sep 17 00:00:00 2001 From: AK Date: Sat, 8 Aug 2026 04:03:12 -0700 Subject: [PATCH] feat: add Duck Hunt command aliases --- docs/games.md | 14 +++++++------- plugins/duckhunt.go | 16 ++++++++-------- plugins/duckhunt_test.go | 7 ++++++- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/docs/games.md b/docs/games.md index 981b370..49a667d 100644 --- a/docs/games.md +++ b/docs/games.md @@ -208,7 +208,7 @@ Commands: !bang shoot an active duck !bef befriend an active duck, if enabled !befriend same as !bef -!ducklaunch flock launch a random flock manually +!ducklaunch flock launch a random flock manually (`!launch` also works) !shop / !store list arcade gear, consumables, and point prices !buy peashooter buy the starter Peashooter (!buy gun also works) !buy quacker buy the larger Quacker Blaster @@ -218,13 +218,13 @@ Commands: !use <1-7|item> use a Duck Hunt consumable !ammo show ammo, spare magazines, and points !reload load a spare magazine -!unjam clear a jammed weapon without using ammunition -!ducks [nickname] show persistent scores, points, level, and XP -!duckstats [nickname] show detailed title, accuracy, gear, and item stats -!achievements [nickname] show one-time Duck Hunt achievements -!level [nickname] show level, XP, points, and Duck Hunt scores +!unjam clear a jammed weapon without using ammunition (`!clearjam` also works) +!ducks [nickname] show persistent scores, points, level, and XP (`!duckscore` also works) +!duckstats [nickname] show detailed title, accuracy, gear, and item stats (`!dstats` also works) +!achievements [nickname] show one-time Duck Hunt achievements (`!achieve`/`!ach` also work) +!level [nickname] show level, XP, points, and Duck Hunt scores (`!lvl` also works) !xp [nickname] alias for !level -!profile [nickname] alias for !level +!profile [nickname] alias for !level (`!prof` also works) !dh show Duck Hunt status !dh status show Duck Hunt status !dh start enable automatic activity for this channel (owner only) diff --git a/plugins/duckhunt.go b/plugins/duckhunt.go index fa7a4e3..4bc7335 100644 --- a/plugins/duckhunt.go +++ b/plugins/duckhunt.go @@ -167,10 +167,10 @@ type DuckHunt struct { func (p *DuckHunt) Name() string { return "duckhunt" } func (p *DuckHunt) Commands() []string { - return []string{"duckhunt", "dh", "ducklaunch", "bang", "befriend", "bef", "ducks", "duckstats", "achievements", "level", "xp", "profile", "shop", "store", "buy", "use", "reload", "unjam", "ammo"} + return []string{"duckhunt", "dh", "ducklaunch", "launch", "bang", "befriend", "bef", "ducks", "duckscore", "duckstats", "dstats", "achievements", "achieve", "ach", "level", "lvl", "xp", "profile", "prof", "shop", "store", "buy", "use", "reload", "unjam", "clearjam", "ammo"} } func (p *DuckHunt) Help() string { - return "!bang shoots an active duck; !bef befriends it; !ducklaunch flock starts a random flock; !shop lists gear and items; !buy (weapons, magazine/mag/ammo, or items 1-7); !use <1-7|item> activates a Duck Hunt item; !ammo, !reload, and !unjam manage gear; !ducks [nick] shows scores; !duckstats [nick] shows a detailed title, accuracy, gear, and inventory profile; !achievements [nick] shows unlocked achievements; !level [nick] shows XP and level; !dh status|start|stop controls activity" + return "!bang shoots an active duck; !bef/!befriend befriends it; !ducklaunch/!launch flock starts a random flock; !shop/!store lists gear and items; !buy (weapons, magazine/mag/ammo, or items 1-7); !use <1-7|item> activates a Duck Hunt item; !ammo, !reload, and !unjam/!clearjam manage gear; !ducks/!duckscore [nick] shows scores; !duckstats/!dstats [nick] shows a detailed title, accuracy, gear, and inventory profile; !achievements/!achieve/!ach [nick] shows unlocked achievements; !level/!lvl [nick] shows XP and level; !profile/!prof [nick] aliases !level; !dh status|start|stop controls activity" } // shopWeapons keeps the arsenal deliberately arcade-like. The names are game @@ -520,7 +520,7 @@ func (p *DuckHunt) Handle(b *bot.Bot, m bot.Message) bool { case "duckhunt", "dh": p.control(b, m, arg) return true - case "ducklaunch": + case "ducklaunch", "launch": p.launch(b, m, arg) return true case "bang": @@ -533,16 +533,16 @@ func (p *DuckHunt) Handle(b *bot.Bot, m bot.Message) bool { b.Send(m.ReplyTarget(), ircColor(ircYellow, "befriending is disabled")) } return true - case "ducks": + case "ducks", "duckscore": p.ducks(b, m, arg) return true - case "duckstats": + case "duckstats", "dstats": p.duckStats(b, m, arg) return true - case "achievements": + case "achievements", "achieve", "ach": p.achievements(b, m, arg) return true - case "level", "xp", "profile": + case "level", "lvl", "xp", "profile", "prof": p.profile(b, m, arg) return true case "shop", "store": @@ -557,7 +557,7 @@ func (p *DuckHunt) Handle(b *bot.Bot, m bot.Message) bool { case "reload": p.reload(b, m) return true - case "unjam": + case "unjam", "clearjam": p.unjam(b, m) return true case "ammo": diff --git a/plugins/duckhunt_test.go b/plugins/duckhunt_test.go index 950cb6a..bb8d075 100644 --- a/plugins/duckhunt_test.go +++ b/plugins/duckhunt_test.go @@ -137,7 +137,7 @@ func TestDuckHuntIncludesBefriendAlias(t *testing.T) { if !found { t.Fatal("expected !bef command alias") } - for _, command := range []string{"ducklaunch", "shop", "store", "buy", "use", "reload", "unjam", "ammo", "duckstats", "achievements", "level", "xp", "profile"} { + for _, command := range []string{"ducklaunch", "launch", "shop", "store", "buy", "use", "reload", "unjam", "clearjam", "ammo", "ducks", "duckscore", "duckstats", "dstats", "achievements", "achieve", "ach", "level", "lvl", "xp", "profile", "prof"} { found = false for _, candidate := range plugin.Commands() { if candidate == command { @@ -164,6 +164,11 @@ func TestDuckHuntIncludesBefriendAlias(t *testing.T) { if !strings.Contains(plugin.Help(), "!achievements") { t.Fatal("expected achievements command in help") } + for _, alias := range []string{"!achieve", "!ach", "!launch", "!duckscore", "!dstats", "!lvl", "!prof", "!clearjam"} { + if !strings.Contains(plugin.Help(), alias) { + t.Fatalf("expected %s alias in help", alias) + } + } } func TestDuckHuntUseItemAliases(t *testing.T) {