PHP code example of phenogram / framework
1. Go to this page and download the library: Download phenogram/framework 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/ */
phenogram / framework example snippets
// bot.php
amework\TelegramBot;
use Phenogram\Bindings\Types\Interfaces\UpdateInterface;
$token = ''; // Ваш токен
$bot = new TelegramBot($token);
$bot->addHandler(fn (UpdateInterface $update, TelegramBot $bot) => $bot->api->sendMessage(
chatId: $update->message->chat->id,
text: $update->message->text
))
->supports(fn (UpdateInterface $update) => $update->message?->text !== null);
$bot->run();