telegram-bot/api
Native PHP wrapper for the Telegram Bot API with no extra requirements. Supports all API methods and response types, including sending messages, documents, reply/inline keyboards, and media groups. Install via Composer and start building bots quickly.
Pros:
symfony/http-client and psr/http-client). Laravel’s dependency injection and service container can easily wrap the BotApi or Client classes.Types namespace), reducing runtime errors and improving IDE support (e.g., autocompletion for Update, Message, InlineKeyboardMarkup).Client class provides a reactive programming model (e.g., command(), on()) that maps cleanly to Laravel’s event system or queue workers for async processing.Cons:
Chat/User, no queue job wrappers for async tasks). Requires manual abstraction.Route::post('/telegram-webhook')) must be manually configured to handle updates.composer require telegram-bot/api.BotApi/Client to the container.php artisan telegram:poll).Chat data in a database).Chat, Message, User) to sync Telegram data with Laravel’s database.Update fields like messageReaction) require package updates. The package’s active maintenance (last release: 2023-08-09) mitigates this.telegram.update.received).Chat, User, or Message data be stored in Laravel’s database? If so, how will the package’s types map to Eloquent models?HttpExceptions (e.g., 429 Too Many Requests) be retried? Laravel’s retry helper or a custom decorator can be used.BotApi/Client as singletons or context-bound instances.POST /telegram-webhook (with middleware for validation).Update events to queues for async processing (e.g., TelegramUpdateJob).TelegramMessageReceived) to decouple bot logic from controllers.Http facade or Guzzle for consistency.Chat sessions).Client instance in a Laravel service provider./start, /help) synchronously.TelegramUpdateJob).Chat, User).throttle:60,1)./start).thumb* → thumbnail*) require codebase updates.mail@igusev.ru for security.TelegramPollJob).Chat/User lookups.How can I help you explore Laravel packages today?