appto-team / telegram-bot
Multi-bot Telegram framework for Laravel — dialogs, command/callback routing, webhook & long-polling delivery
Fund package maintenance!
Requires
- php: ^8.3
- appto-team/telegram-bot-cast-laravel: ^3.0
- illuminate/cache: ^12.0|^13.0
- illuminate/console: ^12.0|^13.0
- illuminate/database: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/queue: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- laravel/prompts: ^0.3.23
- spatie/laravel-data: ^4.23
Requires (Dev)
- laravel/framework: ^12.0|^13.0
- laravel/pint: ^1.17
- phpunit/phpunit: ^11.0
README
🇷🇺 Русский · 🇬🇧 English
Мульти-бот фреймворк для Telegram на Laravel: декларативная маршрутизация (команды,
callback-паттерны, текстовые триггеры, произвольные типы апдейтов), движок пошаговых диалогов,
встроенная авторизация и /help, доставка апдейтов через webhook или long polling — из коробки.
📖 Полная документация: Русский · English
Требования
- PHP 8.3+
- Laravel 12+
Установка
composer require appto-team/telegram-bot php artisan vendor:publish --tag=telegram-bot-config php artisan migrate
Быстрый старт
// app/GreetBot/GreetBot.php final class GreetBot extends Bot { protected function boot(): void { $this->onCommand('start', StartCommand::class); } }
// app/GreetBot/Commands/StartCommand.php final class StartCommand implements CommandHandler { public function handle(UpdateContext $context): void { $context->reply('Привет! Я на связи 👋'); } }
// config/telegram-bot.php 'bots' => [ 'greet' => [ 'token' => env('TELEGRAM_BOT_TOKEN'), 'webhook_secret' => env('TELEGRAM_BOT_WEBHOOK_SECRET'), 'handler' => \App\GreetBot\GreetBot::class, ], ],
php artisan telegram:poll greet
Отправьте боту /start — должен прийти ответ. Дальше — команды, кнопки, клавиатуры, диалоги,
права доступа и деплой через webhook подробно расписаны в
документации на русском, начиная с
4. Быстрого старта.
Поддержать проект
Если пакет оказался полезен — можно поддержать разработку в крипте:
| Валюта | Адрес |
|---|---|
| USDT (TRC-20) | TWpVojBJ97h1X3JcZwAQRNEQjx7u1E3uZs |
| BTC | bc1qu592r93ch2yhwj6tw5ttctx3fg39ydem43ch3t |
| ETH | 0x406F46D4c42ff77f74047Fc5672fc3Bc32ADB9d0 |
| TON | UQCeqwcvE9DAjHKHPHw2MHVD-FworhAYEs8BEy56lJhfX9nr |
Лицензия
MIT
English
⬆ Русский · 🇬🇧 English
Multi-bot Telegram framework for Laravel: declarative routing (commands, callback patterns, text
triggers, arbitrary update types), a step-by-step dialog engine, built-in authorization and
/help, webhook and long-polling delivery — out of the box.
📖 Full documentation: English · Русский
Requirements
- PHP 8.3+
- Laravel 12+
Installation
composer require appto-team/telegram-bot php artisan vendor:publish --tag=telegram-bot-config php artisan migrate
Quick start
// app/GreetBot/GreetBot.php final class GreetBot extends Bot { protected function boot(): void { $this->onCommand('start', StartCommand::class); } }
// app/GreetBot/Commands/StartCommand.php final class StartCommand implements CommandHandler { public function handle(UpdateContext $context): void { $context->reply('Hi! I\'m here 👋'); } }
// config/telegram-bot.php 'bots' => [ 'greet' => [ 'token' => env('TELEGRAM_BOT_TOKEN'), 'webhook_secret' => env('TELEGRAM_BOT_WEBHOOK_SECRET'), 'handler' => \App\GreetBot\GreetBot::class, ], ],
php artisan telegram:poll greet
Send /start to the bot — you should get a reply. Commands, buttons, keyboards, dialogs,
permissions and webhook deployment are covered in full in the
English documentation, starting with
4. Quick start.
Support the project
If this package has been useful, you can support development with crypto:
| Currency | Address |
|---|---|
| USDT (TRC-20) | TWpVojBJ97h1X3JcZwAQRNEQjx7u1E3uZs |
| BTC | bc1qu592r93ch2yhwj6tw5ttctx3fg39ydem43ch3t |
| ETH | 0x406F46D4c42ff77f74047Fc5672fc3Bc32ADB9d0 |
| TON | UQCeqwcvE9DAjHKHPHw2MHVD-FworhAYEs8BEy56lJhfX9nr |
License
MIT
