A simple wrapper for telegram-bot-api.

Installs: 5 013

Dependents: 0

Suggesters: 0

Security: 0

Stars: 23

Watchers: 3

Forks: 11

Open Issues: 3


dev-master 2020-09-23 20:25 UTC

This package is auto-updated.

Last update: 2022-09-24 00:33:25 UTC


A symfony wrapper bundle for Telegram Bot API with some tiny feature.


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

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.

# app/config/config.yml

    token: xxxxx:yyyyyyyyyyyyyyyyyyyy

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

    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

        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).


Wherever you have access to the service container :

    // get the telegram api as a service
    $api = $this->container->get('shaygan.telegram_bot_api');

    // test the API by calling getMe method
    $user = $api->getMe();



Please refer to Telegram Bot API Official Document for getting infomration about available methods and other informations:


If you did all the configurations correctly but still getting errors (Http error 500) even on getMe method, it might be because of SSL Verification. Please make sure you have up-to-date CA root certificate bundle to be used with cURL.

You can configure you CA root certificate bundle by:

  1. Downloading up-to-date cacert.pem file from cURL website and
  2. Setting a path to it in your php.ini file, e.g. on Windows:



The MIT License (MIT). Please see License File for more information.