PHPackages                             tsvetkov/telegram\_bot - 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. tsvetkov/telegram\_bot

ActiveLibrary[API Development](/categories/api)

tsvetkov/telegram\_bot
======================

PHP Library for telegram bot API

2.6.1(5y ago)01.2k1PHPPHP &gt;=5.6.0

Since Feb 4Pushed 4y ago2 watchersCompare

[ Source](https://github.com/Alekers/telegram_bot)[ Packagist](https://packagist.org/packages/tsvetkov/telegram_bot)[ RSS](/packages/tsvetkov-telegram-bot/feed)WikiDiscussions 2.6 Synced 2mo ago

READMEChangelog (10)Dependencies (3)Versions (23)Used By (0)

Telegram Bot by Tsvetkov
========================

[](#telegram-bot-by-tsvetkov)

[![Latest Stable Version](https://camo.githubusercontent.com/8545e02e8c4df769d136a612602c39c50e6c9a05c5867751ee8498242efd7f9a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74737665746b6f762f74656c656772616d5f626f742e737667)](https://packagist.org/packages/tsvetkov/telegram_bot)[![Total Downloads](https://camo.githubusercontent.com/b2069912ee727e4dc8d8ef09d2a3f99c70aa645119e3f52971c97c8324d575e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74737665746b6f762f74656c656772616d5f626f742e737667)](https://packagist.org/packages/tsvetkov/telegram_bot)

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

[](#installation)

In order to install extension use Composer. Either run

```
php composer.phar require tsvetkov/telegram_bot

```

or add

```
"tsvetkov/telegram_bot": "*"

```

to the require section of your composer.json.

Basic Usage
-----------

[](#basic-usage)

Initialization

```
use tsvetkov\telegram_bot\TelegramBot;

$bot = new TelegramBot($token); // You can get token of you bots from @BotFather

// With proxy
$requestOptions = [
    'proxy' => 'your_proxy_config',
];
$bot = new TelegramBot($token, $requestOptions);

```

Send message

```
$bot->sendMessage($userId, 'Hello world!');

```

Get updates

```
$updates = $bot->getUpdates();

```

Webhooks

```
$data = json_decode(file_get_contents('php://input'));

$update = new \tsvetkov\telegram_bot\entities\update\Update($data);

```

How to send media group with a files?
-------------------------------------

[](#how-to-send-media-group-with-a-files)

Use `attach://file_name_in_post` for that

```
$media = [
    new \tsvetkov\telegram_bot\entities\inputMedia\InputMediaPhoto([
        'media' => 'attach://file-photo',
    ]),
    new \tsvetkov\telegram_bot\entities\inputMedia\InputMediaVideo([
        'media' => 'attach://file-video',
    ]),
];

```

Don't forget to add your files to request

```
$files = [
    'file-video' => "path_to_video_for_upload",
    'file-photo' => "path_to_photo_for_upload",
];

```

And just send your request

```
$message = $bot->sendMediaGroup($chatId, $media, $files);

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% 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 ~42 days

Recently: every ~108 days

Total

22

Last Release

1769d ago

Major Versions

1.0.x-dev → 2.0.02019-06-26

2.6.x-dev → 3.0.x-dev2021-07-07

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

3.0.x-devPHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b72b760e444bb27ecbeeac36c59a75dce6fed3fac9e7c9f988e82d4a268ce94?d=identicon)[Alekers](/maintainers/Alekers)

---

Top Contributors

[![Alekers](https://avatars.githubusercontent.com/u/27341059?v=4)](https://github.com/Alekers "Alekers (30 commits)")[![GoldcarrotYamil](https://avatars.githubusercontent.com/u/17644997?v=4)](https://github.com/GoldcarrotYamil "GoldcarrotYamil (2 commits)")

---

Tags

apiphptelegram-bottelegram-bot-api

###  Code Quality

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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