telegram-bot-sdk / laravel-starter
Telegram Bot SDK Laravel Starter Project
Requires
- php: ^7.4
- fideloper/proxy: ^4.2
- fruitcake/laravel-cors: ^2.0
- guzzlehttp/guzzle: ^7.0.1
- laravel/framework: ^8.0
- laravel/tinker: ^2.0
- telegram-bot-sdk/laravel: ^4.0@dev
- telegram-bot-sdk/telegram-bot-sdk: ^4.0@dev
Requires (Dev)
- facade/ignition: ^2.3.6
- fzaninotto/faker: ^1.9.1
- mockery/mockery: ^1.3.1
- nunomaduro/collision: ^5.0
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2021-11-18 00:47:52 UTC
README
This repo has been archived in favor of the scaffolding feature in our Laravel package.
Laravel starter for Telegram Bot SDK.
It comes with sample code to get you started developing Telegram Bots in Laravel.
Features
- Multi-Bots.
- Webhook.
- Updates Polling.
- Commands.
- Event Listener.
Built with
- Laravel 8.x.
- Telegram Bot SDK 4.x.
- Telegram Bot SDK Laravel 4.x.
Installation
- Create a new bot project using this starter project.
composer create-project telegram-bot-sdk/laravel-starter mybot
-
Install Laravel Valet and use
valet secure && valet share
to retrieve a HTTPS URL that you can use it to setup a webhook with Telegram for testing. -
Edit your
.env
file and set your bot token inTELEGRAM_BOT_TOKEN=
&& ngrok hostname inTELEGRAM_WEBHOOK_DOMAIN=
(Ex:randomstring.ap.ngrok.io
) -
Setup the webhook with Telegram by firing the artisan command
php artisan telegram:webhook:setup
. -
Explore
app
directory for some examples. -
Build awesome bots and don't forget to list them on our Awesome Telegram Bots list.
Read docs to learn more about Telegram Bot SDK.
Webhook
If you've fired the above webhook setup artisan command, then a webhook will automatically be set with Telegram.
The webhook URL looks like: https://YOUR_DOMAIN/telegram/YOUR_BOT_TOKEN/YOUR_BOT_NAME
Incoming webhook requests from Telegram will automatically be verified, processed, and acknowledged to Telegram for you. You can listen to various events the SDK dispatches to process inbound updates. You'll find an example in this repo as you explore.
License
The Laravel Starter is open-sourced software licensed under the MIT license.