Download the PHP package telegram-bot-essentials/essence without Composer
On this page you can find all versions of the php package telegram-bot-essentials/essence. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download telegram-bot-essentials/essence
More information about telegram-bot-essentials/essence
Files in telegram-bot-essentials/essence
Package essence
Short Description A Laravel framework for building multi-bot Telegram applications: command, reply-key and callback-query buses, conversational state, and per-bot tenancy.
License MIT
Informations about the package essence
Telegram Bot Essentials (Essence)
A Laravel package for running many Telegram bots from one codebase, each bot its own tenant. Instead of one giant update handler per bot, incoming webhook updates are dispatched through typed buses - Commands, ReplyKeys, CallbackQueries, and StateAnswers - so a multi-tenant, multi-locale bot platform stays organized as it grows past a handful of features.
Requirements
- PHP ^8.3
- Laravel ^12 or ^13
- irazasyed/telegram-bot-sdk ^3.15
- stancl/tenancy ^3.9 (each bot is a tenant)
Installation
Publish config and translations:
Initialize your main bot and set the webhook:
Configure config/tbe-essence.php and .env values (MAIN_TELEGRAM_BOT_TOKEN, MAIN_UNIQUE_ID, MAIN_ADMIN_CHAT_ID, etc.) before running init.
Webhook URL
Each bot receives updates at:
Authentication uses the Telegram secret_token header, verified against the hashed token stored on the bots table when you run tbe:set-webhook.
Core Concepts
| Concept | Trigger | Purpose |
|---|---|---|
| Commands | /start, /help, … |
Slash-command handlers |
| ReplyKeys | Keyboard button text | Main menu and navigation |
| CallbackQueries | Inline button presses | Menus, actions, starting input flows |
| StateAnswers | Text/media while user has active state | Multi-step input, form wizards |
| Features | Called from queries/answers | Build TelegramResponse messages |
| MessageMeta | Associated with messages | Lock, revert, and update bot messages |
| StateData | Referenced by ID | JSON payload storage for wizards and deeplinks |
Project Layout (in your Laravel app)
Handlers are discovered from app/Telegram/** once per process/worker at boot, after every companion package has registered its own - so your app's handlers always win a naming collision. Package defaults are loaded from vendor/telegram-bot-essentials/essence/src/Telegram/.
Documentation
The full documentation site — the single source of truth — is maintained separately and being published. It covers:
- Architecture — webhook flow, buses, encoding formats
- State & StateData —
bot_users.statevs thestate_datatable - Extending — building CallbackQueries, StateAnswers, Features
- Commands — CommandBus, aliases, programmatic routing
- Events & Listeners — the bot event bus
- Reference — helpers, config, database, artisan commands
Artisan Generators
Testing
Extend TelegramBotEssentials\Essence\Testing\TestCase (a Testbench base essence ships in src/) instead of wiring up Testbench yourself - every companion package already depends on essence, so no extra dependency is needed:
postWebhookUpdate() sends a real request through routing, TelegramBotAuthentication, and the controller - not a hand-wired shortcut. Outbound Telegram API calls are faked automatically (Http::fake() in setUp()): LaravelHttpClient, essence's default http_client_handler, routes every SDK call through Illuminate\Support\Facades\Http, so no bespoke SDK mocking is needed.
Related Packages
Essence is the core framework. Optional companion packages, all on Packagist under
telegram-bot-essentials/*, extend it:
telegram-bot-essentials/settings— per-bot typed key/value settingstelegram-bot-essentials/billing— invoices, payments, gateway registrytelegram-bot-essentials/gateway-card— manual card-to-card gateway for Billingtelegram-bot-essentials/gateway-zibal— Zibal gateway for Billingtelegram-bot-essentials/user-wallet— per-user balance/credit wallettelegram-bot-essentials/user-management— admin user list, sortable/filterabletelegram-bot-essentials/affiliates— referral tracking and wallet payoutstelegram-bot-essentials/announcements— bulk broadcast with live progress
Register their CallbackQueries and StateAnswers in each package's service provider via callbackQueryBus() and stateAnswerBus().
Contributing
See CONTRIBUTING.md for local setup, the test/lint/analyse commands CI runs, and commit conventions.
License
MIT
All versions of essence with dependencies
irazasyed/telegram-bot-sdk Version ^3.15
laravel/framework Version ^12 || ^13
ramsey/uuid Version ^4.7
stancl/tenancy Version ^3.9