1. Go to this page and download the library: Download mk4u/tgram 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/ */
use Mk4U\TGram\Bot;
$bot = new Bot();
$bot->run();
namespace Bot\Commands;
use Mk4U\TGram\Core\Actions\Commands;
use Mk4U\TGram\Attributes\Command;
#[Command('/start')]
class Start extends Commands
{
public function execute(): void
{
$this->reply('Hey there! Welcome to our bot!');
}
public static function description(): string
{
return 'Start Command to get you started';
}
}