PHPackages                             vet1kk/telegram-bot-core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vet1kk/telegram-bot-core

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vet1kk/telegram-bot-core
========================

Lightweight Telegram Bot PHP Core Library

v1.1.0(3mo ago)101MITPHPPHP ~8.3CI passing

Since Feb 16Pushed 3mo agoCompare

[ Source](https://github.com/vet1kk/telegram-bot-core)[ Packagist](https://packagist.org/packages/vet1kk/telegram-bot-core)[ Docs](https://github.com/vet1kk/telegram-bot-core)[ RSS](/packages/vet1kk-telegram-bot-core/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (18)Versions (3)Used By (0)

Telegram Bot Core
=================

[](#telegram-bot-core)

[![PHP 8.3+](https://camo.githubusercontent.com/38027453aeb7eb818641c9de8f82b7624c3558d92634f1946edc715c3ddf8956/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/)[![Packagist Version](https://camo.githubusercontent.com/068faa1d60beb39afb95cfac48b03c59dc6e89b1184774e8bd255634d6d65c45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766574316b6b2f74656c656772616d2d626f742d636f72653f6c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/vet1kk/telegram-bot-core)[![GitHub Release](https://camo.githubusercontent.com/9a24e70b3ef36794b76fe08fba84c3196133f57a213aae16e17681f3365d9baa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f766574316b6b2f74656c656772616d2d626f742d636f72653f646973706c61795f6e616d653d746167)](https://github.com/vet1kk/telegram-bot-core/releases)[![Packagist Downloads](https://camo.githubusercontent.com/dcfffd1b164d8d6f6fbd02712e7a98aa94327a0ab2ad39db9a97498c31f95fcd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766574316b6b2f74656c656772616d2d626f742d636f72653f6c6f676f3d636f6d706f736572266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/vet1kk/telegram-bot-core)[![Telegram Bot API](https://camo.githubusercontent.com/4cb663e203dae038da6b9f2e43729e15cd52365a646b3a041f83cae823d293b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54656c656772616d2d426f742532304150492d3236413545343f6c6f676f3d74656c656772616d266c6f676f436f6c6f723d7768697465)](https://core.telegram.org/bots/api)[![PHPUnit](https://camo.githubusercontent.com/ff3e3510ec1980798a04c7f026062fc1cfa060d02e534278248a3e8cd34e7987/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d504850556e6974253230392d3041394544433f6c6f676f3d706870756e6974266c6f676f436f6c6f723d7768697465)](./phpunit.xml)[![Psalm](https://camo.githubusercontent.com/aab6d668dc287cb5ecca98c3241584161298845e0383f095b6d97fdc655b58ce/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737461746963253230616e616c797369732d5073616c6d2d344632443746)](./psalm.xml)[![Type Coverage](https://camo.githubusercontent.com/3724e6f31aa10557d837f1ec71c713637791199cc2d886a258d0403ae8e1b513/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74797065253230636f7665726167652d39392e372532352d627269676874677265656e)](./psalm.xml)[![Line Coverage](https://camo.githubusercontent.com/f4be4afa8842fc9202dcf5ab313d2f13952cb6a1141aecb26b8a1a7519a3cc18/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c696e65253230636f7665726167652d39382e322532352d627269676874677265656e)](./phpunit.xml)[![License](https://camo.githubusercontent.com/7f6e487eef4c6b8f44eb93613f9b1880d6853226e6e83b44121b73fa71bd0442/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f766574316b6b2f74656c656772616d2d626f742d636f7265)](./LICENSE)

Lightweight Telegram bot core for PHP 8.3+ with typed updates, attribute-based handlers, middleware, events, and a small DI-driven runtime.

It is designed for projects that want Telegram bot wiring without bringing in a full framework.

Highlights
----------

[](#highlights)

- Strictly typed PHP 8.3 codebase
- Attribute-based commands, actions, and listeners
- Typed DTO tree for Telegram updates
- Middleware pipeline for cross-cutting behavior
- Event manager for decoupled side effects
- Inline and reply keyboard builders
- PSR-11 container support through `php-di/php-di`
- Covered by PHPUnit tests and Psalm static analysis

Requirements
------------

[](#requirements)

- PHP `8.3+`
- Extensions: `curl`, `json`, `mbstring`
- A Telegram bot token from [@BotFather](https://t.me/BotFather)
- A public webhook URL for production webhook handling

Installation
------------

[](#installation)

```
composer require vet1kk/telegram-bot-core
```

Quick start
-----------

[](#quick-start)

Create a webhook entrypoint and register your handlers. The library bootstraps its core services for you.

```
