PHP code example of malvik-lab / telegram-sender
1. Go to this page and download the library: Download malvik-lab/telegram-sender 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/ */
malvik-lab / telegram-sender example snippets
uzzleHttp\Client;
use MalvikLab\TelegramSender\TelegramSender;
$telegramSender = new TelegramSender('YOUR_BOT_KEY', new Client());
$telegramSender->sendMessage('CHAT_ID', 'Message');
$telegramSender->sendPhoto('CHAT_ID', 'PHOTO', 'Caption'); // PHOTO: image path or external url
$telegramSender->sendLocation('CHAT_ID', 'LATITUDE', 'LONGITUDE');
$telegramSender->sendDocument('CHAT_ID', 'DOCUMENT', 'Caption'); // DOCUMENT: document path or external url