PHPackages                             devbx/telegram - 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. devbx/telegram

ActiveLibrary[API Development](/categories/api)

devbx/telegram
==============

Telegram BOT Api

9.5(2mo ago)0100MITPHPPHP &gt;=8.0

Since Feb 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/dev-bx/telegram)[ Packagist](https://packagist.org/packages/devbx/telegram)[ RSS](/packages/devbx-telegram/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Telegram Bot API Library for PHP
================================

[](#telegram-bot-api-library-for-php)

This PHP library provides a convenient and easy-to-use interface for interacting with the Telegram Bot API. It is designed to be used with the Bitrix CMS or the GuzzleHTTP client.

Features
--------

[](#features)

- **Easy Integration**: Seamlessly integrates with Bitrix CMS and GuzzleHTTP client.
- **Full API Coverage**: Supports all **Telegram Bot API 9.5** methods.
- **Customizable**: Easily extendable and customizable to fit your specific needs.

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

[](#installation)

You can install the package via Composer:

```
composer require devbx/telegram
```

Usage
-----

[](#usage)

### Bitrix CMS

[](#bitrix-cms)

```
use DevBX\Telegram;

$client = new Telegram\BitrixClient([
    'token' => '1234567890:zzz', //API token obtained from @BotFather
    'client_options' => [ // Bitrix client options
        'disableSslVerification' => false
    ]
]);

$result = $client->sendPhoto([
    'chat_id' => 1234567890,
    'photo' => [
        'filename' => 'media.jpg',
        'resource' => fopen('media.jpg', 'r'),
        'contentType' => 'image/jpeg',
    ],
]);

echo $result->messageId."\n";

foreach ($result->photo as $photo) {
    echo "File ID - {$photo->fileId}\nWidth - {$photo->width}\nHeight - {$photo->height}\nFile size - {$photo->fileSize}\n\n";
}
```

### Guzzle Http

[](#guzzle-http)

```
use DevBX\Telegram;

$client = new \DevBX\Telegram\GuzzleClient([
    'token' => '1234567890:zzz', //API token obtained from @BotFather
    'client_options' => [ // Guzzle client options
        'verify' => false
    ]
]);

$result = $client->sendPhoto([
    'chat_id' => 1234567890,
    'photo' => [
        'filename' => 'media.jpg',
        'resource' => fopen('media.jpg', 'r'),
        'contentType' => 'image/jpeg',
    ],
]);

echo $result->messageId."\n";

foreach ($result->photo as $photo) {
    echo "File ID - {$photo->fileId}\nWidth - {$photo->width}\nHeight - {$photo->height}\nFile size - {$photo->fileSize}\n\n";
}
```

Using a Local Bot API Server
----------------------------

[](#using-a-local-bot-api-server)

###

[](#httpscoretelegramorgbotsapiusing-a-local-bot-api-server)

### Bitrix

[](#bitrix)

```
use DevBX\Telegram;

$client = new Telegram\BitrixClient([
    'token' => '1234567890:zzz', //API token obtained from @BotFather
    'api_url' => 'http://localhost:8081/bot'
]);

$client->sendMessage([
    'chat_id' => '1234567890',
    'text' => 'message from Local Bot API Server'
]);
```

### Guzzle Http

[](#guzzle-http-1)

```
use DevBX\Telegram;

$client = new Telegram\GuzzleClient([
    'token' => '1234567890:zzz', //API token obtained from @BotFather
    'api_url' => 'http://localhost:8081/bot'
]);

$client->sendMessage([
    'chat_id' => '1234567890',
    'text' => 'message from Local Bot API Server'
]);
```

Getting updates from WebHook
----------------------------

[](#getting-updates-from-webhook)

```
use DevBX\Telegram;

$result = Telegram\Api::getWebhookUpdate();

foreach ($result as $updateType => $update) {
    if (!is_object($update))
        continue;

    switch ($updateType)
    {
        case 'message':
            /* @var Telegram\Types\Message $update */

            echo "Message from: {$update->from->id}\nText: {$update->text}\n";

            break;
    }
}
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance86

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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 ~26 days

Total

2

Last Release

66d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/032f35591d5a547274640e9007b2373a45483646e04f8746c1f608f5343fb72e?d=identicon)[dev-bx](/maintainers/dev-bx)

---

Top Contributors

[![dev-bx](https://avatars.githubusercontent.com/u/9969001?v=4)](https://github.com/dev-bx "dev-bx (50 commits)")

---

Tags

bitrixguzzlehttplibraryphp8telegram-bot-api

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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