PHP code example of tsvetkov / telegram_bot

1. Go to this page and download the library: Download tsvetkov/telegram_bot 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/ */

    

tsvetkov / telegram_bot example snippets


php composer.phar 

$data = json_decode(file_get_contents('php://input'));

$update = new \tsvetkov\telegram_bot\entities\update\Update($data);

$media = [
    new \tsvetkov\telegram_bot\entities\inputMedia\InputMediaPhoto([
        'media' => 'attach://file-photo',
    ]),
    new \tsvetkov\telegram_bot\entities\inputMedia\InputMediaVideo([
        'media' => 'attach://file-video',
    ]),
];