Download the PHP package luzrain/telegram-bot-bundle without Composer
On this page you can find all versions of the php package luzrain/telegram-bot-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download luzrain/telegram-bot-bundle
More information about luzrain/telegram-bot-bundle
Files in luzrain/telegram-bot-bundle
Package telegram-bot-bundle
Short Description Symfony bundle for Telegram Bot API
License MIT
Homepage https://github.com/luzrain/telegram-bot-bundle
Informations about the package telegram-bot-bundle
Symfony Bundle for Telegram Bot API
A symfony bundle for luzrain/telegram-bot-api library.
Getting Started
Install Composer Packages
Enable the Bundle
Configure the Bundle
Note that symfony/http-client and nyholm/psr7 are not required. You may use any PSR-18 http client and PSR-17 factory implementations.
To use your own services, set the http_client, request_factory, and stream_factory options in the telegram_bot.yaml configuration file.
Here is an example how to use Guzzle http client:
For a full list of available configuration options and their documentation, run:
Receiving Messages from Telegram
There are two ways to receive updates from Telegram:
1. Webhook (recommended)
-
Configure a webhook and make sure the endpoint is publicly accessible.
- Set the
webhook.urloption in yourtelegram_bot.yamlconfiguration file. - Apply the webhook settings to your bot:
Whenever you change the webhook or allowed_updates configuration options, run this command again to update the bot's webhook settings.
2. Polling Daemon
Useful during development or when you cannot expose a public URL.
Start the polling daemon:
Examples
Command Controller
Any Event Controller
Publishing Commands to the Bot Menu Button
You can publish your bot commands so they appear in the bot’s menu button.
To do this, set both the description and publish arguments in the OnCommand attribute:
Publish commands list to the menu button:
To remove menu button:
All versions of telegram-bot-bundle with dependencies
luzrain/telegram-bot-api Version ^3.11.0
symfony/config Version ^7.0|^8.0
symfony/console Version ^7.0|^8.0
symfony/dependency-injection Version ^7.0|^8.0
symfony/http-kernel Version ^7.0|^8.0