dev-master
9999999-devA PHP Wrapper for the Telegram Bot Api
MIT
The Requires
by Sven Drewniok
1.3.0
1.3.0.0A PHP Wrapper for the Telegram Bot Api
MIT
The Requires
by Sven Drewniok
Wallogit.com
2017 © Pedro Peláez
A PHP Wrapper for the Telegram Bot Api
A PHP Wrapper for the Telegram Bot Api
Currently being refactored, see the latest releases for a stable version., (*1)
When using composer you can just require this library: composer require whitebock/telegramapi, (*3)
Manual installation without composer is being worked on., (*4)
Set your token from @BotFather in the constructor., (*5)
use Whitebock\TelegramApi\Bot;
use Whitebock\TelegramApi\Photo;
$bot = new Bot('');
$me = $bot->getMe();
echo $me->getUsername().PHP_EOL;
$updates = $bot->getUpdates();
foreach ($updates as $update) {
$chat = $update->getMessage()->getChat();
echo $chat->getUsername().': '.$update->getMessage()->getText().PHP_EOL;
$bot->sendMessage($chat, 'Hello World');
$bot->sendChatAction($chat, 'upload_photo');
$bot->sendMedia($chat, Photo::fromFile('test/bird.jpg'));
$bot->sendLocation($chat, 52.520038, 13.404799);
$bot->sendContact($chat,'+49123456789', 'John');
$bot->sendVenue($chat, 51.496797, 7.455505, 'Westfalenhallen', 'Rheinlanddamm 200, 44139 Dortmund');
}
All notable changes to this project will be documented here., (*6)
The format is based on Keep a Changelog and this project adheres to Semantic Versioning., (*7)
A PHP Wrapper for the Telegram Bot Api
MIT
A PHP Wrapper for the Telegram Bot Api
MIT