PHPackages                             steadfast/telegram-bot-api - 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. steadfast/telegram-bot-api

ActiveLibrary[API Development](/categories/api)

steadfast/telegram-bot-api
==========================

Telegram Bot API written in PHP

2.3.0(7y ago)128MITPHPPHP &gt;=5.5.0

Since Aug 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Everhard/Telegram-Bot-API)[ Packagist](https://packagist.org/packages/steadfast/telegram-bot-api)[ Docs](https://github.com/Everhard/Telegram-Bot-API)[ RSS](/packages/steadfast-telegram-bot-api/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

Telegram Bot API
================

[](#telegram-bot-api)

[![Latest Stable Version](https://camo.githubusercontent.com/143561e57c69a4ace07f16ef18b1baf1b50298bbab7438927bbcb18bb1d27f95/68747470733a2f2f706f7365722e707567782e6f72672f7374656164666173742f74656c656772616d2d626f742d6170692f762f737461626c65)](https://packagist.org/packages/steadfast/telegram-bot-api)[![Total Downloads](https://camo.githubusercontent.com/73f58f873d73b6205e3b4985b2c4d69c2424e2874d09262a643f61fbbfbc5fa9/68747470733a2f2f706f7365722e707567782e6f72672f7374656164666173742f74656c656772616d2d626f742d6170692f646f776e6c6f616473)](https://packagist.org/packages/steadfast/telegram-bot-api)[![License](https://camo.githubusercontent.com/ba362c4448e83504d601941f38ac3bb27dbfe8760325e54611603d226f03d661/68747470733a2f2f706f7365722e707567782e6f72672f7374656164666173742f74656c656772616d2d626f742d6170692f6c6963656e7365)](https://packagist.org/packages/steadfast/telegram-bot-api)

An extended native [Telegram Bot API](https://core.telegram.org/bots/api) in PHP without requirements. Supports all methods and types of responses.

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

[](#installation)

```
composer require steadfast/telegram-bot-api
```

Client usage
------------

[](#client-usage)

How to send message:

```
use TelegramBot\Api\BotApi;

$bot = new BotApi($bot_api_token);

$bot->sendMessage($chat_id, $message_text);
```

Server usage
------------

[](#server-usage)

To handle commands:

```
use TelegramBot\Api\Client;

$bot = new Client($bot_api_token);

$bot->command('ping', function ($message) use ($bot) {
    $bot->sendMessage($message->getChat()->getId(), 'pong!');
});
```

To handle an event when the bot was added to a group:

```
use TelegramBot\Api\Client;

$bot = new Client($bot_api_token);

$bot->wasAddedToAGroup(function ($message) use ($bot) {
    $bot->sendMessage($message->getChat()->getId(), "Let's welcome our new member!");
});
```

To handle an event when the bot was removed from a group:

```
use TelegramBot\Api\Client;

$bot = new Client($bot_api_token);

$bot->wasRemovedFromAGroup(function ($message) use ($bot) {
    $bot->sendMessage($message->getChat()->getId(), "Say goodbye to our friend!");
});
```

To handle any events:

```
use TelegramBot\Api\Client;

$bot = new Client($bot_api_token);

$bot->on(function ($update) {
    echo $update->getUpdateId();
});
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

4

Last Release

2789d ago

### Community

Maintainers

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

---

Tags

phpbottelegrambot api

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[telegram-bot/api

PHP Wrapper for Telegram Bot API

1.2k2.4M29](/packages/telegram-bot-api)[telegram-bot-php/core

A PHP library that makes using Telegram Bot API much easier.

60293.1k](/packages/telegram-bot-php-core)[borsaco/telegram-bot-api-bundle

A simple wrapper for telegram-bot-api.

5633.0k](/packages/borsaco-telegram-bot-api-bundle)[kuvardin/telegram-bots-api

SDK for Telegram bots API

145.5k](/packages/kuvardin-telegram-bots-api)[klev-o/telegram-bot-api

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

457.8k1](/packages/klev-o-telegram-bot-api)[luzrain/telegram-bot-api

PHP Wrapper for Telegram Bot API

1032.8k1](/packages/luzrain-telegram-bot-api)

PHPackages © 2026

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