Skip to content

docs: align samples with the 1.0 API - #39

Merged
prethink merged 1 commit into
masterfrom
docs/align-with-1.0
Aug 23, 2026
Merged

prethink merged 1 commit into
masterfrom
docs/align-with-1.0

Conversation

@prethink

Copy link
Copy Markdown
Owner

The documentation still taught APIs that 1.0 removed or renamed. Every code sample below would fail to compile against the 1.0 package.

Changes

Replacement Call sites
PRTelegramBot.Helpers.Message.Send → MessageSender.Send 61
PRTelegramBot.Helpers.Message.Edit → MessageEditor.Edit 3
The same facade named in prose 1
Models.TCommands → Models.CallbackCommands 1
AutoEditMessageСycle → AutoEditMessageCycle (the old name held a Cyrillic С) 1
The confirmation sample 2

The Helpers.Message facade was deleted in 1.0. The signatures of MessageSender.Send and MessageEditor.Edit are identical to the ones it forwarded to, so only the type name changes — no argument was touched.

The confirmation sample

It wrapped a button under CustomTHeaderTwo.ExampleThree, but the handler for that header reads EntityTCommand<string> while the button carried EntityTCommand<long>. Pressing "Yes" therefore threw

System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $.d.1

which the inline converter caught, logged and turned into null, so the handler quietly did nothing and the button looked broken. The sample now uses ExampleTwo, whose handler reads the type the button actually carries. This matches the fix already applied to ExampleInlineConfirmation.cs in the example project.

Verification

  • 21 files changed, 69 insertions, 69 deletions — every added line is one of the replacements above and nothing else.
  • No occurrences of Helpers.Message, Models.TCommands or AutoEditMessageСycle remain anywhere under docs/.
  • CRLF line endings and the absence of a BOM are preserved, matching what GitBook exported.

Two earlier suspicions turned out to be false alarms and were deliberately left alone: the InlineButton( hits on two API pages are GetInlineButton(, not the deleted type; and the CustomTHeader.ExampleThree sample on the inline-menu page uses a different enum that has no handler at all, so there is no type mismatch there.

Note on GitBook

docs/ is synced with GitBook, which is the source of truth for that directory. While this PR is open, avoid editing these 21 pages in the GitBook web editor to prevent a conflict.

🤖 Generated with Claude Code

The documentation still taught APIs that 1.0 removed or renamed.

- PRTelegramBot.Helpers.Message.Send -> MessageSender.Send (61 call sites)
- PRTelegramBot.Helpers.Message.Edit -> MessageEditor.Edit (3 call sites)
  The facade was deleted in 1.0; the signatures of the replacements are
  identical, so only the type name changes.
- Models.TCommands -> Models.CallbackCommands
- AutoEditMessageCycle: the old name contained a Cyrillic letter
- The confirmation sample wrapped a button under CustomTHeaderTwo.ExampleThree,
  whose handler reads EntityTCommand<string> while the button carried
  EntityTCommand<long>. Pressing "Yes" threw a JsonException that the converter
  swallowed, so the button silently did nothing. It now uses ExampleTwo, whose
  handler reads the type the button actually carries, matching the fix applied
  to the example project.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@prethink
prethink merged commit e9eb135 into master Aug 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants