Download the PHP package tarik02/laravel-telegram without Composer
On this page you can find all versions of the php package tarik02/laravel-telegram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-telegram
Laravel Telegram
Telegram Bots framework for Laravel.
Installation
Add the following variables to your .env
:
TELEGRAM_BOT_TOKEN
- your bot's telegram token.TELEGRAM_BOT_USERNAME
- your bot's username.
Option 1. Using laravel-telegram-extra
I recommend you checking out tarik02/laravel-telegram-extra.
Option 2. Setup yourself
Otherwise you need to create necessary configs and classes yourself:
app/Telegram/Dispatcher.php
:
app/Telegram/Kernel.php
:
config/telegram.php
:
Running bot
You can develop your bot using command long polling technique. To start listening for telegram updates, run the following command:
Setting up webhooks
For production bots, webhooks are better way to communicate with telegram servers. To use webhooks, first add Telegram::webhookRoutes()
call to your global routes in app/Providers/RouteServiceProvider.php
:
This helper creates special route for each bot listen in config. Instead, you can manually create webhook route for every bot:
Next, you need to put your webhook to telegram servers. You can do this using special artisan command:
Note: your application needs to be accessible with https protocol from Internet.
Also, there's two other commands to work with webhooks:
Multiple bots
This telegram bot framework supports using multiple bots in single application. You can configure multiple bots in configuration:
Most telegram artisan commands can receive special --bot=
argument which allows to work with multiple bots.
License
The project is released under the MIT license. Read the license for more information.
All versions of laravel-telegram with dependencies
guzzlehttp/guzzle Version ^7.2
tarik02/telegram-types Version ^0.3.0
illuminate/support Version ^7.0|^8.0
illuminate/routing Version ^7.0|^8.0
illuminate/console Version ^7.0|^8.0
illuminate/bus Version ^7.0|^8.0
illuminate/queue Version ^7.0|^8.0