aymericcucherousset/telegram-bot
A simple PHP Telegram Bot library for sending messages, handling updates, and interacting with Telegram’s Bot API. Includes helpers for requests, webhooks/long polling, keyboards, and common methods to build bots quickly and cleanly.
laravel-horizon for queues).BotService::sendOrderUpdate()).queue:work or supervisor).irazasyed/laravel-telegram-bot (more stars, but older) or raw API calls.monolog or laravel-sentry.config/app.php and bind it to the container.BotMessageReceived) to decouple bot logic from controllers.telegram:send jobs (uses bus:queue).OnlyAdminUpdates middleware).telegram-bot as a Symfony bundle).composer require aymericcucherousset/telegram-bot./start, sendMessage) in a local Laravel app.POST /telegram-webhook).file_get_contents/curl calls to Telegram’s API.BotUpdated::dispatch($update)).BotMessage::dispatch($chatId, $text)->delay(3600))./status) via Laravel routes or package hooks.@auth in bot responses).sendPhoto, getUpdates).getMe → getChat).laravel-horizon or cron for polling).| Phase | Task | Tools/Libraries |
|---|---|---|
| Setup | Install package, configure .env (BOT_TOKEN). |
Composer, Laravel config |
| Basic Functionality | Implement /start command and message handler. |
Routes, Controllers |
| Event-Driven | Replace controllers with events (e.g., BotMessageReceived). |
Laravel Events, Listeners |
| Scalability | Queue non-critical messages; add rate-limiting. | Laravel Queues, Guzzle middleware |
| Monitoring | Log updates/errors; set up alerts. | Monolog, Sentry, Laravel Telescope |
| Security | Validate webhook signatures; sanitize inputs. | Middleware, Laravel Validation |
^1.0) until stability is proven.Http::post('https://api.telegram.org/...')).mockery for Telegram API).irazasyed/laravel-telegram-bot).redis->hset("bot:user:{$chatId}", "step", 1)).laravel-horizon to monitor job failures (e.g., Telegram API timeouts).| Failure Scenario | Impact | Mitigation Strategy | |---------------------------|
How can I help you explore Laravel packages today?