PHP code example of telegram-bot-essentials / essence
1. Go to this page and download the library: Download telegram-bot-essentials/essence 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/ */
telegram-bot-essentials / essence example snippets
use TelegramBotEssentials\Essence\Testing\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(TestCase::class, RefreshDatabase::class);
it('replies when the button is pressed', function () {
$bot = $this->makeBot();
$this->postWebhookUpdate($bot, $this->makeMessageUpdate('Main Menu 🔰'))
->assertOk();
$this->assertTelegramSent(fn ($request) => str_contains($request['text'], 'Main Menu loaded'));
});