|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project are documented here. The format is based on |
| 4 | +[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project aims to |
| 5 | +follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Commit |
| 6 | +messages follow [Conventional Commits](https://www.conventionalcommits.org/). |
| 7 | + |
| 8 | +## [Unreleased] |
| 9 | + |
| 10 | +`botapi` was rebuilt from a codegen-first OpenAPI/ogen project into a |
| 11 | +hand-written, MTProto-backed Bot API **library** built on |
| 12 | +[`gotd/td`](https://github.com/gotd/td). It exposes the familiar Bot API surface |
| 13 | +but speaks MTProto directly — no `api.telegram.org`, no `getUpdates`/webhooks. |
| 14 | + |
| 15 | +### Added |
| 16 | + |
| 17 | +- **Client** — `Bot` with `New`/`Run`/`Raw`, a persistent MTProto connection and |
| 18 | + gap-aware update stream. Optional bbolt `Storage` for session/peers/state. |
| 19 | +- **Types** — hand-written Bot API types and sealed-interface unions (`ChatID`, |
| 20 | + `InputFile`, `ReplyMarkup`, `InputMedia`, `ChatMember`, `MessageOrigin`, |
| 21 | + `InlineQueryResult`, `InputMessageContent`, `BotCommandScope`, |
| 22 | + `PassportElementError`, …) with compile-time exhaustiveness checks. |
| 23 | +- **Sending** — `SendMessage` (HTML/MarkdownV2/Markdown), photo/document/video/ |
| 24 | + audio/voice/animation/video-note/sticker, media groups, location/venue/ |
| 25 | + contact/poll/dice, chat actions; edits (text/caption/markup/media, live |
| 26 | + location), forward/copy/delete, `StopPoll`. |
| 27 | +- **Receiving** — a handler framework (`On*`, predicates, middleware, `Group`, |
| 28 | + `Context`) over the native update stream; messages, edits, channel posts, |
| 29 | + callback/inline queries, shipping/pre-checkout queries; incoming media, polls, |
| 30 | + contacts and forward origins mapped to the typed `Message`. |
| 31 | +- **Files** — `GetFile`, `DownloadFile`/`DownloadFileToPath`, local |
| 32 | + `file_unique_id` derivation. |
| 33 | +- **Queries** — `AnswerCallbackQuery`, `AnswerInlineQuery`, |
| 34 | + `AnswerShippingQuery`, `AnswerPreCheckoutQuery`. |
| 35 | +- **Chat management** — members (ban/unban/restrict/promote, get member(s)/ |
| 36 | + admins/count, custom title), admin (pin/unpin, title/description/photo/ |
| 37 | + permissions, sticker set, leave), invite links, `GetChat`, |
| 38 | + `GetUserProfilePhotos`. |
| 39 | +- **Commands** — `Set`/`Get`/`DeleteMyCommands` with scopes; `OnCommand` |
| 40 | + auto-publishes the command menu. |
| 41 | +- **Stickers** — `UploadStickerFile`, sticker-set create/add/delete/reorder, |
| 42 | + `GetStickerSet`, `SetStickerSetThumb`. |
| 43 | +- **Payments & games** — `SendInvoice`, `SetPassportDataErrors`, `SendGame`, |
| 44 | + `SetGameScore`, `GetGameHighScores`. |
| 45 | +- **Resilience** — Bot-API-shaped errors with a comprehensive `tgerr` mapping |
| 46 | + and `AsFloodWait`/`AsChatMigrated`/`Code` helpers; opt-in flood-wait retry and |
| 47 | + a proactive rate limiter. |
| 48 | +- **Multi-bot** — `pool.Pool` runs and multiplexes many bots by token with idle |
| 49 | + GC. |
| 50 | +- **Tooling & docs** — `cmd/botdoc` (fetch/inspect the published API), a |
| 51 | + method-drift conformance test, hot-path benchmarks, package docs, a usage |
| 52 | + guide and runnable examples (`echo`, `buttons`, `inline`, `media`, |
| 53 | + `advanced`). |
| 54 | + |
| 55 | +[Unreleased]: https://github.com/gotd/botapi/commits/main |
0 commit comments