PHPackages                             alirezax5/telegram-bot-php - 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. [API Development](/categories/api)
4. /
5. alirezax5/telegram-bot-php

ActiveLibrary[API Development](/categories/api)

alirezax5/telegram-bot-php
==========================

A lightweight PHP wrapper for the Telegram Bot API

3.2.1(1w ago)27511MITPHPPHP &gt;=8.1

Since Apr 23Pushed 1w ago1 watchersCompare

[ Source](https://github.com/alirezax5/telegramBotPhp)[ Packagist](https://packagist.org/packages/alirezax5/telegram-bot-php)[ Docs](https://github.com/alirezax5/telegramBotPhp)[ RSS](/packages/alirezax5-telegram-bot-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)DependenciesVersions (30)Used By (1)

telegramBotPhp
==============

[](#telegrambotphp)

Lightweight PHP 8.1+ wrapper for the **Telegram Bot API** — zero runtime dependencies, full coverage of every current API method (186 bot methods) and every response/entity type (199 types).

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

[](#requirements)

- PHP &gt;= 8.1
- cURL extension (`ext-curl`)
- JSON extension (`ext-json`)
- Composer

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

[](#installation)

```
composer require alirezax5/telegram-bot-php
```

Quick Start
-----------

[](#quick-start)

```
require 'vendor/autoload.php';

use telegramBotApiPhp\Telegram;

// Long polling
$bot = new Telegram($_ENV['TELEGRAM_BOT_TOKEN']);

$updates = $bot->getUpdates(0, 100, 50);       // offset, limit, long-poll timeout (s)
foreach ($updates->result as $u) {
    $bot->setInputData($u);
    $chatId = $bot->chatId();
    $text   = $bot->text();

    if ($text === '/start') {
        $bot->sendMessage($chatId, 'Welcome!');
    }
}

// Webhook mode
$update = $bot->getInputData();                   // decodes php://input
if ($bot->isMessage()) {
    $bot->sendMessage($chatId, $bot->text());
}
```

Architecture
------------

[](#architecture)

```
src/
├── Telegram.php          # Core class — DI/container, HTTP client, update parser, token stack, caching, retry
├── Traits/
│   ├── Updates.php            # polling + webhook methods (getUpdates, setWebhook, getMe, ...)
│   ├── Messages.php          # 45 messaging methods (send*, edit*, ephemeral, rich)
│   ├── ChatAdministration.php# 51 chat/admin/forum methods
│   ├── Stickers.php          # 16 sticker-set methods
│   ├── PaymentsAndGames.php  # 11 payments/stars/games methods
│   ├── Business.php          # 36 business/managed-bot/story/inline/user-verify methods
│   ├── BotSettings.php       # 20 bot-profile/commands/menu methods
│   ├── isUpdates.php         # Boolean checkers for update types (23)
│   ├── isChatTypes.php       # Boolean checkers for chat types
│   ├── isMedia.php           # Boolean checkers for media types
│   └── otherTrait.php        # Convenience getters (messageID, text, chatId, mediaType, ...)
└── Types/                    # 199 typed response wrappers (BaseType subclass)

```

`Telegram` pulls in all domain traits via the `method` aggregator trait. All API methods return a typed `returned*` (response) object built by `BaseType::create()`.

License
-------

[](#license)

MIT

Documentation
-------------

[](#documentation)

- [architecture/overview.md](docs/architecture/overview.md) — full architecture
- [architecture/folder-structure.md](docs/architecture/folder-structure.md)
- [architecture/methods.md](docs/architecture/methods.md) — the 186 methods grouped by trait
- [architecture/telegram-class.md](docs/architecture/telegram-class.md) — core class reference
- [architecture/type-system.md](docs/architecture/type-system.md) — type system &amp; returned\*
- [guides/webhook-vs-polling.md](docs/guides/webhook-vs-polling.md)
- [guides/retry-and-resilience.md](docs/guides/retry-and-resilience.md)

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance98

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~56 days

Recently: every ~15 days

Total

29

Last Release

7d ago

Major Versions

1.5.6 → 2.3.72025-03-07

2.5.13 → 3.0.02026-06-08

PHP version history (2 changes)1.0.0PHP &gt;=7.0

3.1.1PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20362833?v=4)[alireza x5](/maintainers/alirezax5)[@alirezax5](https://github.com/alirezax5)

---

Top Contributors

[![alirezax5](https://avatars.githubusercontent.com/u/20362833?v=4)](https://github.com/alirezax5 "alirezax5 (53 commits)")

---

Tags

bottelegramtelegram botتلگرامربات تلگرامساخت ربات تلگرام

### Embed Badge

![Health badge](/badges/alirezax5-telegram-bot-php/health.svg)

```
[![Health](https://phpackages.com/badges/alirezax5-telegram-bot-php/health.svg)](https://phpackages.com/packages/alirezax5-telegram-bot-php)
```

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k5.1M99](/packages/irazasyed-telegram-bot-sdk)[longman/telegram-bot

PHP Telegram bot

4.0k2.2M52](/packages/longman-telegram-bot)[telegram-bot/api

PHP Wrapper for Telegram Bot API

1.2k2.5M32](/packages/telegram-bot-api)[tg-bot-api/bot-api-base

Clear and simple Telegram bot API

22282.9k2](/packages/tg-bot-api-bot-api-base)[botman/driver-telegram

Telegram driver for BotMan

94467.0k6](/packages/botman-driver-telegram)[klev-o/telegram-bot-api

Simple and convenient object-oriented implementation Telegram bot API with php version ^7.4 support. You'll like it)

468.8k1](/packages/klev-o-telegram-bot-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
