How reymontg/tg-keyboard works
tg-keyboard is a PHP builder for Telegram keyboard and button structures, including Bot API and MTProto representations. A caller creates button objects, arranges them into reply or inline keyboards, configures keyboard options, then serializes or converts the result for its target syntax. The README documents row, stack, direct-button and coordinate editing, plus force-reply and hide variants; the tree and source index also show conversion support. Edges reflect explicit README workflows or source-index references; unsampled paths are represented only at their known directory level.
Main entry points: KeyboardMarkup.php Reply keyboard · KeyboardInline.php Inline keyboard · KeyboardButton.php Reply button types · Keyboard.php Keyboard operations
Components 16
Keyboard authoring
- Keyboard operations
src/Keyboard.php - Reply keyboard
src/Keyboard/KeyboardMarkup.php - Inline keyboard
src/Keyboard/KeyboardInline.php - Hide and force reply
src/Keyboard - Keyboard options
src/Keyboard/Utils
Button models
- Button base
src/Button.php - Button colors
src/Button/Color.php - Inline button types
src/Button/InlineButton.php - Inline button variants
src/Button/InlineButton - Reply button types
src/Button/KeyboardButton.php - Reply button variants
src/Button/KeyboardButton - Poll choices
src/Button/PollType.php - URL accessors
src/Button/Utils/Url.php
Conversion and encoding
- API and MTProto output
src/Keyboard.php
Other components
- Library caller
- Telegram API / MTProto consumer
Connections 23
- Library caller → Inline button types: creates buttons
README.md - Library caller → Reply button types: creates buttons
README.md - Library caller → Reply keyboard: builds keyboard
README.md - Library caller → Inline keyboard: builds keyboard
README.md - Library caller → Hide and force reply: chooses variant
README.md - Library caller → Keyboard operations: edits layout
README.md - Reply keyboard → Reply button types: creates buttons
src/Keyboard/KeyboardMarkup.php - Reply keyboard → Keyboard operations: adds buttons
src/Keyboard/KeyboardMarkup.php - Inline keyboard → Inline button types: creates buttons
README.md - Inline keyboard → Keyboard operations: adds buttons
README.md - Hide and force reply → Keyboard options: uses options
src/Keyboard/KeyboardForceReply.php - Button base → Button colors: encodes color
src/Button.php - Inline button types → Inline button variants: instantiates
src/Button/InlineButton.php - Reply button types → Reply button variants: instantiates
src/Button/KeyboardButton.php - Reply button types → Poll choices: sets poll type
src/Button/KeyboardButton.php - Inline button variants → Button base: extends
src/Button/InlineButton.php - Reply button variants → Button base: extends
src/Button/KeyboardButton.php - Inline button variants → URL accessors: uses URL accessors
src/Button/InlineButton/LoginUrl.php - Reply button variants → URL accessors: uses URL accessors
src/Button/KeyboardButton/Webapp.php - Keyboard operations → API and MTProto output: converts keyboards
src/Keyboard.php - Reply keyboard → API and MTProto output: serializes output
src/Keyboard/KeyboardMarkup.php - Inline keyboard → API and MTProto output: serializes output
src/Keyboard/KeyboardInline.php - API and MTProto output → Telegram API / MTProto consumer: emits representations
README.md