PHP code example of rde / php-telegram-connection
1. Go to this page and download the library: Download rde/php-telegram-connection 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/ */
rde / php-telegram-connection example snippets
use Rde\Telegram\Connection;
// 成功建立連線後, $conn->me 會存放此 bot 的 id 資料
$conn = new Connection($token);
use Rde\Telegram\Structure;
$payload = new Structure(array(
'chat_id' => $int
));
$payload->{'text'} = 'some text string';
$telegram_response = $conn->sendMessage($payload);
$conn->method('POST');
//$conn->sendMessage($payload);