Repository navigation
fix(markup): adapt button helpers to layer 229 button types - #1855
Closed
OCharnyshevich wants to merge 1 commit into
Closed
OCharnyshevich wants to merge 1 commit into
OCharnyshevich wants to merge 1 commit into
Conversation
OCharnyshevich
force-pushed
the
fix/layer-229-markup
branch
from
September 15, 2026 19:10
45ac22f to
49837bc
Compare
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.
Fixes the build of #1850 (layer 229). CI there fails because
telegram/message/markupstill uses thekeyboardButton*constructors that layer 229 removed.Layer 229 splits buttons into two concrete types:
keyboardButtonwith aButtonTypefor reply keyboards, andkeyboardInlineButtonwith anInlineButtonTypefor inline keyboards. This PR ports the helpers to that model.API changes
tg.KeyboardButton:Button,RequestPhone,RequestGeoLocation,RequestPoll,RequestPeer,SimpleWebViewtg.KeyboardInlineButton:URL,Callback,SwitchInline,Game,Buy,URLAuth,InputURLAuth,UserProfile,InputUserProfile,WebViewKeyboardButton(text, tg.ButtonTypeClass, style...)andInlineButton(text, tg.InlineButtonTypeClass, style...)cover any button type, including ones added later. The named helpers are built on them.Copy,Disabled.InlineButtonRow.Row/SingleRowtake reply buttons;InlineRow,InlineKeyboardand theRowmethods inmessageandmessage/inlinetake inline buttons.URLAuthandUserProfilewere reply-keyboard buttons. Layer 229 only has inline forms, so they are inline now.Code that mixed reply and inline buttons in one row no longer compiles. The protocol no longer allows that either.
Tests
CopyandDisabled.go build ./...,go vet ./telegram/...andgo test ./...pass locally on top of #1850.telegram/message/audio.gois not gofmt-clean on the #1850 branch. I left it out because it's unrelated.Motivation
We need layer 229 for ephemeral bot messages. On layer 228 the server sends
updateEphemeralBotCallbackQuery#9b380762, which is only in_schema/tdlib.tl. gotd can't decode it and drops the wholeupdatescontainer, so callback buttons on ephemeral messages can't be handled.