PHP code example of zafarjonovich / yii2-telegram-bot-scelation

1. Go to this page and download the library: Download zafarjonovich/yii2-telegram-bot-scelation 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/ */

    

zafarjonovich / yii2-telegram-bot-scelation example snippets





oken = '1111111:AAABBBBCCCDDDDEEEERRRRTTTT';

$telegram = new \zafarjonovich\Telegram\BotApi($bot_token);

$telegram->query('sendMessage',[
    'chat_id' => 1122,
    'text' => 'Hello world!'
]);

$telegram->query('sendPhoto',[
    'chat_id' => 1122,
    'photo' => 'photo_url'
]);




token = '1111111:AAABBBBCCCDDDDEEEERRRRTTTT';

$telegram = new \zafarjonovich\Telegram\BotApi($bot_token);

$telegram->sendMessage($chat_id,$text);

$telegram->sendMessage($chat_id,$text,[
    'parse_mode' => 'markdown'
]);

$telegram->sendPhoto($chat_id,$photo,[
    'caption' => 'Hello world!'
])