PHPackages                             shaygan/telegram-bot-api-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. shaygan/telegram-bot-api-bundle

ActiveSymfony-bundle[API Development](/categories/api)

shaygan/telegram-bot-api-bundle
===============================

A simple wrapper for telegram-bot-api.

235.1k11[2 issues](https://github.com/Shaygan/TelegramBotApiBundle/issues)[1 PRs](https://github.com/Shaygan/TelegramBotApiBundle/pulls)PHP

Since Sep 23Pushed 5y ago2 watchersCompare

[ Source](https://github.com/Shaygan/TelegramBotApiBundle)[ Packagist](https://packagist.org/packages/shaygan/telegram-bot-api-bundle)[ RSS](/packages/shaygan-telegram-bot-api-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ShayganTelegramBotApiBundle
===========================

[](#shaygantelegrambotapibundle)

A symfony wrapper bundle for [Telegram Bot API](https://core.telegram.org/bots/api) with some tiny feature.

Install
-------

[](#install)

Via Composer

```
$ composer require shaygan/telegram-bot-api-bundle @dev
```

Edit your app/AppKernel.php to register the bundle in the registerBundles() method as above:

```
class AppKernel extends Kernel
{

    public function registerBundles()
    {
        $bundles = array(
            // ...
            // register the bundle here
            new \Shaygan\TelegramBotApiBundle\ShayganTelegramBotApiBundle()
        );
    }
}
```

Configure the bundle
--------------------

[](#configure-the-bundle)

This bundle was designed to just work out of the box. The only thing you have to configure in order to get this bundle up and running is your bot [token](https://core.telegram.org/bots#botfather).

```
# app/config/config.yml

shaygan_telegram_bot_api:
    token: xxxxx:yyyyyyyyyyyyyyyyyyyy
```

If you want to use web-hook, add the bundle's routing configuration in app/config/routing.yml :

```
shaygan_telegram_bot_api:
    resource: @ShayganTelegramBotApiBundle/Resources/config/routing.yml
```

And add your domain name, url prefix (if needed) and you update receiver service name (a sample update receiver is included) to the configuration file:

```
# app/config/config.yml

shaygan_telegram_bot_api:
    #...
    webhook:
        domain: example.com
        path_prefix: ~ # you can add prefix, if your web site is not on the root
        update_receiver: shaygan.my_update_receiver # sample update receiver
```

*note: Telegram do not support http, your site should have valid SSL (HTTPS).*

Usage
-----

[](#usage)

Wherever you have access to the service container :

```
