mirror of
https://github.com/lukaszraczylo/go-telegram.git
synced 2026-06-06 22:49:32 +00:00
fecef22f48
Sealed-interface union variants whose Type/Source field is declared as bare prose (e.g. "Type of the result, must be article" or "Scope type, must be all_private_chats") were skipped by extractEnumValues because the existing patterns require curly-quoted values. The genapi emitter already extracted these values via discBareRE for marshal-side discriminator injection; lifting the same detection into the scraper populates Field.EnumValues so planUnifiedUnionEnums folds them into shared union-level enums automatically. Unions newly unified (10): BotCommandScope, MenuButton, InputMedia, InputPaidMedia, InputPollMedia, InputPollOptionMedia, InputProfilePhoto, InputStoryContent, InlineQueryResult, PassportElementError. InputMessageContent stays excluded — its variants dispatch structurally on field presence and have no Type/Source field, so planUnifiedUnionEnums correctly skips it. Constants added: 60 typed enum constants across the 10 unions; the corresponding variant struct fields are retyped from string to the shared enum. Internal call-site cleanups: 0 — no internal package referenced these discriminator values via magic strings. False positives the prose detector explicitly rejects: terminal prose-word continuations like "must be sent", "must be shown above", "must be specified", "must be paid", "must be active", "must be one of 3, 6, or 12", "must be between 5 and 100000", "must be a Pay button", "must be repainted". Guarded via terminal-position regex anchor + closed-list isProseWord filter. Determinism verified across two consecutive make regen-from-fixture runs. go test -race ./..., go vet ./..., staticcheck ./... all clean.
API Reference
Auto-generated from Go source comments by gomarkdoc. Do not edit by hand — run make docs to regenerate.
Packages
| Package | Description |
|---|---|
api |
Telegram Bot API types and method wrappers — 176 methods, 301 types, fully generated |
client |
Bot client, codec, HTTP doer, retry middleware |
transport |
Long-poll and webhook transports |
dispatch |
Update router, filters, handler groups, named handlers |
dispatch/conversation |
Multi-step conversation state machines |
dispatch/filters/message |
Message filters — Command, Text, IsReply, etc. |
dispatch/filters/callback |
Callback query filters |
dispatch/filters/inline |
Inline query filters |
dispatch/filters/chatmember |
Chat member update filters |
dispatch/filters/chatjoinrequest |
Join request filters |
dispatch/filters/precheckoutquery |
Pre-checkout filters for payments |
Also see
- Project home — landing page with examples and overview
- GitHub repository
- pkg.go.dev — official Go package documentation