docs: align samples with the 1.0 API - #39
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
PRTelegramBot.Helpers.Message.Send→MessageSender.SendPRTelegramBot.Helpers.Message.Edit→MessageEditor.EditModels.TCommands→Models.CallbackCommandsAutoEditMessageСycle→AutoEditMessageCycle(the old name held a Cyrillic С)The
Helpers.Messagefacade was deleted in 1.0. The signatures ofMessageSender.SendandMessageEditor.Editare 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 readsEntityTCommand<string>while the button carriedEntityTCommand<long>. Pressing "Yes" therefore threwwhich the inline converter caught, logged and turned into
null, so the handler quietly did nothing and the button looked broken. The sample now usesExampleTwo, whose handler reads the type the button actually carries. This matches the fix already applied toExampleInlineConfirmation.csin the example project.Verification
Helpers.Message,Models.TCommandsorAutoEditMessageСycleremain anywhere underdocs/.Two earlier suspicions turned out to be false alarms and were deliberately left alone: the
InlineButton(hits on two API pages areGetInlineButton(, not the deleted type; and theCustomTHeader.ExampleThreesample 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