r-everse / telegram-bundle
Symfony integration for Telegram SDK
Installs: 515
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.1
- irazasyed/telegram-bot-sdk: ^2.0
- symfony/config: ^3.4
- symfony/console: ^3.4
- symfony/dependency-injection: ^3.4
- symfony/http-kernel: ^3.4
This package is auto-updated.
Last update: 2021-08-26 17:38:16 UTC
README
This package is deprecated and will soon be removed. We suggest using irazasyed/telegram-bot-sdk directly.
Telegram Bundle
Symfony integration for Telegram SDK.
Installation
Step 1: Download the Bundle
You can install this bundle using Composer:
composer require r-everse/telegram-bundle:^0.1
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new Telegram\TelegramBundle\TelegramBundle(), ]; // ... } // ... }
Configuration
Add it to app/config/config.yml
.
telegram: token: 'YOUR BOT TOKEN HERE' chats: my_chat_alias: -0000000
Add it to app/config/config_dev.yml
.
parameters: // ... telegram.chat.class: Telegram\TelegramBundle\Service\NullChat // ...
Usage
$this->getContainer()->get('telegram.chat.my_chat_alias')->sendMessage('Hello world!');