Skip to content

Releases: al3x5dev/xbot-devkit

v0.4.2

12 May 02:37

Choose a tag to compare

🆕 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

06 May 03:49

Choose a tag to compare

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|null

These 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

16 Apr 05:02

Choose a tag to compare

🚀 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

18 Mar 04:17

Choose a tag to compare

Changelog

  • The relationship with the sub-entities has been added.

v0.3

16 Mar 03:15

Choose a tag to compare

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.

v0.2.4

07 Aug 04:10

Choose a tag to compare

Changelog

  • The visibility of resolver methods for subentities has been made public.
  • The library documentation has been improved.

v0.2.3

25 Jul 00:20

Choose a tag to compare

Changelog

  • Completion message is added
  • Installation and use of this library is documented

v0.2.2

24 Jul 23:52

Choose a tag to compare

Changelog

  • Improved custom entity errors.
  • Added support for determining the type of update returned by Telegram.
  • Added support for determining command type messages.

v0.2.1

10 Jul 02:30

Choose a tag to compare

Changelog

Add support for custom methods

v0.2.0

10 Jul 00:30
f52b228

Choose a tag to compare

Changelog

  • Fix autoload bug