r-everse/telegram-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony integration for Telegram SDK

v0.1.0 2020-06-19 15:42 UTC

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.

Latest Stable Version Total Downloads Latest Unstable Version License

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!');