dev-master
9999999-dev http://i-gh.irA simple wrapper for telegram-bot-api.
MIT
The Requires
api php symfony2 bot symfony3 symfony telegram telegram-bot-api
A simple wrapper for telegram-bot-api.
A symfony wrapper bundle for Telegram Bot API with some tiny feature., (*1)
Via Composer, (*2)
``` bash $ composer require shaygan/telegram-bot-api-bundle @dev, (*3)
Edit your app/AppKernel.php to register the bundle in the registerBundles() method as above: ```php class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... // register the bundle here new \Shaygan\TelegramBotApiBundle\ShayganTelegramBotApiBundle() ); } }
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., (*4)
# 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 :, (*5)
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:, (*6)
# 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)., (*7)
Wherever you have access to the service container :, (*8)
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:, (*9)
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., (*10)
You can configure you CA root certificate bundle by:, (*11)
Setting a path to it in your php.ini file, e.g. on Windows:, (*12)
curl.cainfo=c:\php\cacert.pem
, (*13)
The MIT License (MIT). Please see License File for more information., (*14)
A simple wrapper for telegram-bot-api.
MIT
api php symfony2 bot symfony3 symfony telegram telegram-bot-api