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

ActiveLibrary[API Development](/categories/api)

botasis/telegram-client
=======================

Yet another PHP Telegram bot client

1.1.2(1y ago)52.0k1[1 issues](https://github.com/botasis/telegram-client/issues)2BSD-3-ClausePHPPHP ~8.2||~8.3||~8.4CI passing

Since Mar 10Pushed 1y ago3 watchersCompare

[ Source](https://github.com/botasis/telegram-client)[ Packagist](https://packagist.org/packages/botasis/telegram-client)[ RSS](/packages/botasis-telegram-client/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (12)Versions (20)Used By (2)

Botasis Telegram Bot API Client
===============================

[](#botasis-telegram-bot-api-client)

Overview
--------

[](#overview)

**Botasis** offers a lightweight and strictly PSR-compliant implementation of the [Telegram Bot API](https://core.telegram.org/bots/api). Designed for developers seeking a robust and advanced bot SDK, **Botasis** simplifies the creation and management of Telegram bots.

Explore our advanced SDK at [botasis/runtime](https://github.com/botasis/runtime) and access a ready-to-deploy application template at [botasis/bot-template](https://github.com/botasis/bot-template).

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

[](#quick-start)

Ensure you have [Composer](https://getcomposer.org/doc/00-intro.md) installed and a bot token from [BotFather](https://core.telegram.org/bots/features#creating-a-new-bot).

### Setup

[](#setup)

1. **Install the Package:**

    ```
    composer require botasis/telegram-client
    ```
2. **Install PSR HTTP Client and Message Factory:**If you don't have preferences, use:

    ```
    composer require httpsoft/http-message php-http/socket-client
    ```
3. **Create an API Client Instance:**Either use your DI container or manually instantiate:

    ```
    $streamFactory = new \HttpSoft\Message\StreamFactory();
    $client = new \Botasis\Client\Telegram\Client\ClientPsr(
        getenv('BOT_TOKEN'),
        new \Http\Client\Socket\Client(),
        new \HttpSoft\Message\RequestFactory(),
        $streamFactory,
        new \Http\Message\MultipartStream\MultipartStreamBuilder($streamFactory),
    );
    ```
4. **Send a Request:**Example to send a "Hello" message:

    ```
    $response = $client->send(new \Botasis\Client\Telegram\Request\TelegramRequest(
        'sendMessage', // any telegram bot api method you like
        // data to send
        [
            'text' => 'Hello Botasis!',
            'chat_id' => $chatId,
        ]
    ));
    ```

    `$response` will contain the Telegram Bot API response data. Refer to the [API specification](https://core.telegram.org/bots/api) for details.

Feature Highlights
------------------

[](#feature-highlights)

### Method-Specific Request Classes

[](#method-specific-request-classes)

Utilize strictly-typed classes for API requests. For instance:

```
$requestTyped = new \Botasis\Client\Telegram\Request\Message\Message(
    'Hello *Botasis*\!', // be sure you correctly escape special characters when use Markdown message format
    \Botasis\Client\Telegram\Request\Message\MessageFormat::MARKDOWN,
    $chatId,
);

// This is equal, but not strictly typed request:
$requestGeneric = new \Botasis\Client\Telegram\Request\TelegramRequest(
        'sendMessage',
        [
            'text' => 'Hello *Botasis*\!',
            'chat_id' => $chatId,
            'parse_mode' => 'MarkdownV2',
        ]
    )
```

### Extending Functionality

[](#extending-functionality)

Missing a method-specific request class? Extend the library:

- **Contribute**: Submit a PR with your implementation.
- **Fallback**: Use the generic `TelegramRequest` class.

This approach ensures immediate adaptability to any Telegram API updates.

Files uploading
---------------

[](#files-uploading)

*Documentation in progress – stay tuned!*

Error Handling
--------------

[](#error-handling)

*Documentation in progress – stay tuned!*

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 90.6% 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

Total

18

Last Release

482d ago

Major Versions

0.8.1 → 1.0.02023-12-02

1.1.2 → v2.x-dev2025-02-27

PHP version history (2 changes)0.1.0PHP ^8.2

1.1.1PHP ~8.2||~8.3||~8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/10acad9038a7b3af2d70f9404bdd4e377bbeb4214277a7cf61ae6fe9884988e6?d=identicon)[miolae](/maintainers/miolae)

---

Top Contributors

[![viktorprogger](https://avatars.githubusercontent.com/u/7670669?v=4)](https://github.com/viktorprogger "viktorprogger (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![xepozz](https://avatars.githubusercontent.com/u/6815714?v=4)](https://github.com/xepozz "xepozz (1 commits)")

---

Tags

phpbottelegramtelegram bot

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k26.1M294](/packages/openai-php-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k6](/packages/theodo-group-llphant)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35729.6k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

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