Skip to content

Commit 87f1c07

Browse files
committed
refactor: rename distro.go -> pkgs.go (onDistro -> onPkgs) to match the /pkgs command
/pkgs is the advertised command (with /distro as an alias), so name the file and handler after it. No behaviour change.
1 parent 711ab78 commit 87f1c07

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project are documented here. The format is based on
44
[Keep a Changelog](https://keepachangelog.com/), and this project adheres to
55
[Semantic Versioning](https://semver.org/).
66

7+
## [2.5.1] - 2026-06-20
8+
9+
### Internal
10+
- Renamed `distro.go``pkgs.go` and the handler `onDistro``onPkgs` so the file
11+
matches the now-primary `/pkgs` command (`/distro` stays an alias). No behaviour change.
12+
713
## [2.5.0] - 2026-06-20
814

915
### Added
@@ -261,6 +267,7 @@ First stable release.
261267
long polling, no inbound port; ships a hardened `systemd` unit (`DynamicUser` +
262268
sandboxing) and reads its token from the environment.
263269

270+
[2.5.1]: https://github.com/Zakkaus/gentoo-zh-verify-bot/releases/tag/v2.5.1
264271
[2.5.0]: https://github.com/Zakkaus/gentoo-zh-verify-bot/releases/tag/v2.5.0
265272
[2.4.0]: https://github.com/Zakkaus/gentoo-zh-verify-bot/releases/tag/v2.4.0
266273
[2.3.0]: https://github.com/Zakkaus/gentoo-zh-verify-bot/releases/tag/v2.3.0

distro.go renamed to pkgs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ func fetchRepology(ctx context.Context, name string) (proj string, pkgs []repolo
206206
return cands[0].name, found[cands[0].name], alts, false
207207
}
208208

209-
// onDistro handles /distro <pkg> — cross-distro package versions via Repology.
210-
func (v *Verifier) onDistro(ctx *th.Context, update telego.Update) error {
209+
// onPkgs handles /pkgs (and its alias /distro) — cross-distro package versions via Repology.
210+
func (v *Verifier) onPkgs(ctx *th.Context, update telego.Update) error {
211211
msg := update.Message
212212
if msg == nil || !v.cfg.IsGroup(msg.Chat.ID) {
213213
return nil
File renamed without changes.

verify.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ func (v *Verifier) register(bh *th.BotHandler) {
292292
bh.Handle(v.onNews, th.CommandEqual("news"))
293293
bh.Handle(v.onWiki, th.CommandEqual("wiki"))
294294
bh.Handle(v.onBbs, th.CommandEqual("bbs"))
295-
bh.Handle(v.onDistro, th.CommandEqual("distro"))
296-
bh.Handle(v.onDistro, th.CommandEqual("pkgs")) // memorable alias for /distro
295+
bh.Handle(v.onPkgs, th.CommandEqual("pkgs"))
296+
bh.Handle(v.onPkgs, th.CommandEqual("distro")) // /distro kept as an alias
297297
bh.Handle(v.onArm, th.CommandEqual("arm"))
298298
bh.Handle(v.onArmpkgs, th.CommandEqual("armpkgs"))
299299
bh.Handle(v.onRich, th.CommandEqual("rich"))

0 commit comments

Comments
 (0)