Download the PHP package pulpa/laravel-telegram-bot without Composer
On this page you can find all versions of the php package pulpa/laravel-telegram-bot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pulpa/laravel-telegram-bot
More information about pulpa/laravel-telegram-bot
Files in pulpa/laravel-telegram-bot
Package laravel-telegram-bot
Short Description Framework to build Telegram bots
License MIT
Informations about the package laravel-telegram-bot
Laravel Telegram Bot
This is a work in progress, feel free to watch this repo to stay tuned.
Requirements
- Laravel
5.4+
Installation
Install the package with composer:
Add this service provider to your config/app.php file:
Create a configuration file in config/bot.php and a controller
in app\Http\Controllers\BotController.php by running the
vendor:publish artisan command:
Open config/bot.php and set up your bot's name and token.
Once you finish your configuration, your bot's webhook URL will be available at:
Where <BotToken> is obviously the bot token, duh!
Open the URL in your web browser and you should see a friendly message.
Usage
The method catchAll() within your BotController class will receive all
the updates coming from Telegram to your webhook, it will receive a parameter
of type Pulpa\Telegram\Bot\Update that is just a simple wrapper of the
original update object coming from Telegram.
Define methods in your BotController that will handle the incoming bot
commands, for example, method myBotCommand will be called when the
webhook recieves a command named my_bot_command.
If no method is defined for a command then the method catchAll() will be called instead.
More documentation is in progress