PHP code example of egormanakin / telegram-bot-bundle
1. Go to this page and download the library: Download egormanakin/telegram-bot-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
egormanakin / telegram-bot-bundle example snippets
$api = $this->container->get(TelegramBot\Api\BotApi::class);
php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new BoShurik\TelegramBotBundle\BoShurikTelegramBotBundle,
);
// ...
}
php
/**
* @param UpdateEvent $event
*/
public function onUpdate(UpdateEvent $event)
{
$update = $event->getUpdate();
$message = $update->getMessage();
}