Skip to content
This repository was archived by the owner on Aug 18, 2026. It is now read-only.

V4.x - #24

Merged
al3x5dev merged 4 commits into
mainfrom
v4.x
Jul 29, 2026
Merged

V4.x#24
al3x5dev merged 4 commits into
mainfrom
v4.x

Conversation

@al3x5dev

Copy link
Copy Markdown
Owner

No description provided.

al3x5dev added 4 commits July 24, 2026 01:26
…e keyboards to subdir; drop FormatHelper

- Fix inheritance: 25 RichText subclasses now extend `RichText` instead of `Entity`,
  preventing PHP type coercion to string in `string|RichText|array` union hints
- Add `type` field to `InputRichBlockTable` in `Table::build()` (was missing, causing
  Telegram "Can't find field 'type'" error)
- Add `Factories/RichMessage.php` — fluent builder with `block()`, `html()`, `markdown()`,
  `rtl()`, `build()` methods
- Add `Factories/Rich/Block.php` — factory for all 20 rich block types (paragraph,
  heading, table, photo, video, etc.)
- Add `Factories/Rich/Table.php` — table builder with `header()`, `body()`, `footer()`,
  `bordered()`, `striped()`, `caption()` chain
- Add `Text.php` — replaces `FormatHelper` with string helpers (`bold()`, `italic()`, etc.)
  and rich object methods (`richBold()`, `richItalic()`, etc.)
- Move keyboard factories to `Factories/Keyboard/` (Inline, Reply, InlineButton,
  ReplyButton) with namespaced classes; update `Keyboard` facade
- Delete `FormatHelper.php` and its test
- Update constants in `InputRichBlock.php` and `RichBlock.php` to match Telegram API 7.0+:
  `heading`, `pre`, `blockquote`, `pullquote`
- Add `tests/Unit/TextTest.php`; update `KeyboardTest.php` and docs
- Regenerate all entity subclasses via updated devkit so they extend their
  correct base type (RichText*, InputRichBlock*, RichBlock*, BackgroundType*,
  ChatMember*, MessageOrigin*, InlineQueryResult*, InputMedia*, etc.) instead
  of Entity directly
- This prevents PHP type coercion in union hints (e.g. string|RichText|array
  was silently converting RichTextBold to its JSON string representation)
- Bump version to 4.6.0
…atetime type, and document keyboards and rich message examples
@al3x5dev
al3x5dev merged commit b359212 into main Jul 29, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant