Releases: al3x5dev/xbot-devkit
Releases · al3x5dev/xbot-devkit
v0.4.2
🆕 New Types
Added support for Telegram Bot API v10 poll media types:
InputPollMedia
Factory method and constants for poll description content types:
InputPollMedia::create(['type' => InputPollMedia::TYPE_PHOTO, 'media' => '...']);InputPollOptionMedia
Factory method and constants for poll option media types:
InputPollOptionMedia::create(['type' => InputPollOptionMedia::TYPE_STICKER, 'media' => '...']);📋 Affected Types
InputPollMedia - 8 subtypes (animation, audio, document, live_photo, location, photo, venue, video)
InputPollOptionMedia - 7 subtypes (animation, live_photo, location, photo, sticker, venue, video)
v0.4.1
v0.4.1
✨ Features
Helper Methods for Update Entity
Added two new convenience methods to the Update entity for common operations:
// Get user ID from any update type (message, callback_query, inline_query, etc.)
$update->fromId(); // Returns: int|null
// Get chat ID from any update type
$update->chatId(); // Returns: int|string|nullThese methods automatically detect the update type and extract the corresponding ID, simplifying common bot development patterns.
📦 Upgrade Notes
No breaking changes. Fully backward compatible.
v0.4.0
🚀 What's New
This release introduces factory methods and type constants for all 21 polymorphic entity types in the Telegram Bot API.
✨ Features
Factory Methods
Added static create() factory method to all polymorphic entities, allowing developers to easily instantiate the correct subtype without manually selecting the class:
// Before - manual class selection
$content = new InputTextMessageContent([
'message_text' => 'Hello'
]);
// Now - automatic type detection
$content = InputMessageContent::create([
'message_text' => 'Hello'
]);v0.3.1
v0.3
Changelog
Changed
- Replaced the old api.json-based method system with a generated Methods trait.
- Methods are now directly available in the codebase, improving IDE support and static analysis.
- Entities directory has been moved to a new location to simplify the project structure.
Removed
- Removed automatic generation and usage of api.json.
- Removed runtime parsing of method definitions from JSON.
Added
- Generated API methods now include:
- PHP type hints
- Return types
- Improved PHPDoc comments
- Full IDE autocompletion support for Telegram Bot API methods.
Fixed
- Fixed incorrect nullable union type generation (?TypeA|TypeB).
- Fixed parameter ordering issues that broke named arguments.
- Fixed incorrect return type parsing from Telegram documentation.