1. Go to this page and download the library: Download maatify/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/ */
maatify / telegram-bot example snippets
use Maatify\TelegramBot\TelegramBotManager;
API_KEY__); // instance of bot manager
$response = $telegram->Methods()->GetMe(); // get bot account information
print_r($response);
$chat = $telegram->GetChat(123456); // set getChat by chat_id
$by_chat = $chat->Get(); // get array of getChat
$chat_id = $chat->GetID(); // get id from getChat by chat_id
$chat_first_name = $chat->GetFirstName(); // get first_name from getChat
$chat_last_name = $chat->GetLastName(); // get last_name from getChat
$chat_username = $chat->GetUsername(); // get username from getChat
$chat_type = $chat->GetType(); // get type from getChat
$chat_active_username = $chat->GetActiveUsername(); // get array of active_username from getChat