PHP code example of spherepack / bot-creator
1. Go to this page and download the library: Download spherepack/bot-creator 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/ */
spherepack / bot-creator example snippets
php
$bot = new TelegramBot(TOKEN)
php
$bot = new TelegramBot(TG_TOKEN);
if (!$bot->isAnswer()){
$bot->setUserId(TG_TEST_USER_ID);
$bot->setMessage('регистрация');
}
$command = new BotRouter(new TelegramCommands());
$message = $command->call($bot->getMessage(), $bot->getUserId());
$bot->setMessage($message);
$bot->setKeyboard(['Регистрация']);
echo json_encode($bot->send(), JSON_UNESCAPED_UNICODE);