PHP code example of taknone / phptgcalls
1. Go to this page and download the library: Download taknone/phptgcalls 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/ */
taknone / phptgcalls example snippets
ak\Liveproto\Utils\Settings;
use Tak\Liveproto\Network\Client;
use Tak\Tgcalls\Driver;
use Tak\Asyncio\Loop;
Loop::queue(static function() : void {
try {
$settings = new Settings();
$settings->setApiId(21724);
$settings->setApiHash('3e0cb5efcd52300aec5994fdfc5bdc16');
$client = new Client('phptgcalls','sqlite',$settings);
$client->start(false);
$tgcalls = new Driver(client : $client,chat_id : -100123456789);
$params_json = $tgcalls->create();
// Both MTProto and TgCalls clients are ready to use... //
} finally {
$client->stop();
}
});
Loop::run();