Skip to content

Commit b18d555

Browse files
exec-astraeaclaude
andcommitted
feat: add Arknights: Endfield support
Add `endfield` (Arknights: Endfield) to the registry as another OpenGachaCodes-only, non-HoYo game (empty ennead/tori slugs, Opengacha: "endfield", in-game redemption), plus gameOrder and docs. Same as wuwa: watching it without opengachaBaseUrl hard-fails at startup. Verified end-to-end against a live OpenGachaCodes instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0221853 commit b18d555

4 files changed

Lines changed: 31 additions & 11 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# hoyo-codes — agent guide
22

33
A small Go service that watches for new gacha **redemption codes** (Genshin
4-
Impact, Honkai: Star Rail, Zenless Zone Zero, Honkai Impact 3rd, and Wuthering
5-
Waves) and posts them to **Discord webhooks** on a cron schedule. Docker-first,
6-
no database, no framework.
4+
Impact, Honkai: Star Rail, Zenless Zone Zero, Honkai Impact 3rd, Wuthering Waves,
5+
and Arknights: Endfield) and posts them to **Discord webhooks** on a cron
6+
schedule. Docker-first, no database, no framework.
77

88
Codes are pulled from up to three APIs and merged/de-duplicated, so a hiccup on
99
one source doesn't cause a miss. A source is skipped for any game it doesn't
@@ -189,7 +189,7 @@ When adding a config knob: add it to `fileConf`, resolve/validate it in
189189
`genshin`, `hkrpg`, `nap`, `honkai3rd`. Shape: `{"codes":[{"code","rewards":"A*60;B*5"}]}`
190190
(active only). Rewards get normalized (`A*60;B*5` → `A ×60, B ×5`).
191191
- **OpenGachaCodes** — `<opengachaBaseUrl>/games/<slug>/codes`, slugs `genshin`,
192-
`starrail`, `zenless`, `wuwa` (also endfield/nte, not yet in the registry).
192+
`starrail`, `zenless`, `wuwa`, `endfield` (also `nte`, not yet in the registry).
193193
Shape: a flat array `[{"code","rewards":["Astrite x50", ...]}]` (active only).
194194
Self-hosted, no auth/CORS, GET-only, strict paths (no trailing slash). A `404`
195195
is treated as "nothing to contribute" (not a source failure). Reward quantities

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# hoyo-codes
22

33
Watches for new **gacha redemption codes** (Genshin Impact, Honkai: Star Rail,
4-
Zenless Zone Zero, Honkai Impact 3rd, and Wuthering Waves) and posts them to
5-
**Discord webhooks** on a schedule. Codes come from community HoYoverse APIs plus
6-
an optional self-hosted [OpenGachaCodes](config.example.yaml) instance
7-
(`opengachaBaseUrl`) — the sole source for non-HoYo games like Wuthering Waves.
4+
Zenless Zone Zero, Honkai Impact 3rd, Wuthering Waves, and Arknights: Endfield)
5+
and posts them to **Discord webhooks** on a schedule. Codes come from community
6+
HoYoverse APIs plus an optional self-hosted [OpenGachaCodes](config.example.yaml)
7+
instance (`opengachaBaseUrl`) — the sole source for non-HoYo games like Wuthering
8+
Waves and Arknights: Endfield.
89

910
## Run
1011

config.example.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ opengachaBaseUrl: "http://localhost:8413"
4040
# comment it out or delete it (there's no enable/disable flag). Each listed game
4141
# REQUIRES both a `webhook` and a `message` (startup fails otherwise). Known keys:
4242
# genshin (Genshin Impact), hsr (Honkai: Star Rail), zzz (Zenless Zone Zero),
43-
# honkai3rd (Honkai Impact 3rd), wuwa (Wuthering Waves)
44-
# `wuwa` is served ONLY by OpenGachaCodes, so it needs opengachaBaseUrl set above.
43+
# honkai3rd (Honkai Impact 3rd), wuwa (Wuthering Waves),
44+
# endfield (Arknights: Endfield)
45+
# `wuwa` and `endfield` are served ONLY by OpenGachaCodes, so they need
46+
# opengachaBaseUrl set above.
4547
games:
4648
genshin:
4749
webhook: "https://discord.com/api/webhooks/xxx/yyy"
@@ -74,3 +76,10 @@ games:
7476
# webhook: "https://discord.com/api/webhooks/eee/fff"
7577
# message: "<@&222222222222222222> {count} new Wuthering Waves {if-singular:code}{if-plural:codes} 🌊"
7678
# username: "Wuthering Waves Codes"
79+
80+
# Arknights: Endfield — also OpenGachaCodes-only (needs opengachaBaseUrl),
81+
# redeemed in-game (no web link).
82+
# endfield:
83+
# webhook: "https://discord.com/api/webhooks/ggg/hhh"
84+
# message: "<@&333333333333333333> {count} new Arknights: Endfield {if-singular:code}{if-plural:codes}"
85+
# username: "Endfield Codes"

games.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type Game struct {
1616

1717
// gameOrder is the canonical iteration order (the games map is unordered, and
1818
// config game keys should resolve deterministically).
19-
var gameOrder = []string{"genshin", "hsr", "zzz", "honkai3rd", "wuwa"}
19+
var gameOrder = []string{"genshin", "hsr", "zzz", "honkai3rd", "wuwa", "endfield"}
2020

2121
// games is the registry of everything we know how to watch.
2222
var games = map[string]Game{
@@ -68,4 +68,14 @@ var games = map[string]Game{
6868
Color: 0x3AC8D4,
6969
Redeem: "", // Wuthering Waves redeems codes in-game (no public web page).
7070
},
71+
"endfield": {
72+
Key: "endfield",
73+
Name: "Arknights: Endfield",
74+
// Not a HoYoverse game — OpenGachaCodes-only, like wuwa.
75+
Ennead: "",
76+
Tori: "",
77+
Opengacha: "endfield",
78+
Color: 0xE8763A,
79+
Redeem: "", // Arknights: Endfield redeems codes in-game (no public web page).
80+
},
7181
}

0 commit comments

Comments
 (0)