PHP code example of mvs / phbot
1. Go to this page and download the library: Download mvs/phbot 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/ */
mvs / phbot example snippets
$app = new ApiConnectTelegram([
'token' => '<SEU TOKEN>'
]);
try {
$request = $app->getUpdates();
} catch (\Exception $exception) {
echo $exception->getMessage();
}
$data = [
'chat_id' => 0,
'text' => '<SUA MENSAGEM>'
];
try {
$request = $app->sendMessage($data);
} catch (\Exception $exception) {
echo $exception->getMessage();
}