Create powerful app integrations with this Telegram Bot SDK. It's as easy as incredible!!
See an example of how easy it is to use:
<?php
/**
* Inject the composer's autoload file.
*/
require_once __DIR__ . '/vendor/autoload.php';
/**
* Assuming you already have the token created using the BotFather.
*/
$token = '[SOME TOKEN HASH]';
/**
* And that you have the chat ID too, you can simply define the text you'd like to send, for instance.
*/
$chatId = [SOME CHAT ID];
$text = \Faker\Factory::create()->sentence(20);
/**
* Create and instance of the API by using the ApiFactory.
* @var \Telegram\ApiInterface $api
*/
$api = \Telegram\ApiFactory::create($token);
/**
* And call the proper method.
* @var \Telegram\Service\ResultInterface $response
*/
$response = $api->methods()->sendMessage($chatId, $text);
This link to BotFather will guide you to create your Telegram Bot.
Tiago Sampaio - tiago@tiagosampaio.com
Telegram Bot PHP is a personal project initiated in late 2018 by Tiago Sampaio. It's free for use.
The Open Software License 3.0 (OSL-3.0).
Pelase, see the file LICENSE.txt to a complete description of the OSL License.