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

ActiveLibrary[API Development](/categories/api)

tigris/telegram-bot-api
=======================

Lightweight PHP7 client for a Telegram Bot API

3.2.4(8y ago)21.2k1MITPHPPHP &gt;=7.0

Since Jul 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/tigris-php/telegram-bot-api)[ Packagist](https://packagist.org/packages/tigris/telegram-bot-api)[ RSS](/packages/tigris-telegram-bot-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (1)

Tigris: Telegram Bot API Client
===============================

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

[![Build Status](https://camo.githubusercontent.com/2ee9368e5d6a9a650091acd0293e15da0cd16fdf3f064e48fd97342fb6bf9ed3/68747470733a2f2f7472617669732d63692e6f72672f7469677269732d7068702f74656c656772616d2d626f742d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tigris-php/tigris)[![Join the chat at https://gitter.im/tigris-php/tigris](https://camo.githubusercontent.com/ba8bd54b203b2b6f29b55f2b3786d16d0b7dc4332df66f878c2b02b9b563db67/68747470733a2f2f6261646765732e6769747465722e696d2f7469677269732d7068702f7469677269732e737667)](https://gitter.im/tigris-php/tigris?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![GitHub license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/tigris-php/tigris/master/LICENSE.md)

Lightweight PHP7 client for a Telegram Bot API

Overview
--------

[](#overview)

Current API version: **3.2**

Requirements:

- PHP 7
- Guzzle 6

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

[](#installation)

### Composer

[](#composer)

The preferred way to install this extension is through [Composer](http://getcomposer.org/).

Either run

```
php composer.phar require tigris/telegram-bot-api

```

or add

```
"tigris/telegram-bot-api": "*"

```

to the require section of your `composer.json`

Usage
-----

[](#usage)

### Getting started

[](#getting-started)

*First you need to create **api client** instance*

```
$httpClient = new \GuzzleHttp\Client();
$apiClient = new \Tigris\Telegram\ApiClient($httpClient);
$apiClient->setApiToken('CHANGEME');
```

*Create **api wrapper** instance*

```
$apiWrapper = new \Tigris\Telegram\ApiWrapper($apiClient);
```

*Use **api wrapper** methods mapped directly to the Telegram Bot API*

```
$apiWrapper->sendChatAction([
    'chat_id' => 123,
    'action' => \Tigris\Telegram\Helpers\ChatAction::TYPING,
]);
$apiWrapper->sendMessage([
    'chat_id' => 123
    'text' => 'Hello, World!',
    'parse_mode' => \Tigris\Telegram\Helpers\ParseMode::HTML,
]);
```

### Type mapping

[](#type-mapping)

Please note that every method call response call is being parsed into the corresponding *type*. We offer PHP classes for all of the API objects. For example, `sendMessage()` call would return an instance of `\Tigris\Telegram\Types\Message` objects. Objects, arrays, nested arrays, scalar values are fully supported by the type parser.

### Getting updates

[](#getting-updates)

```
// Get array of the \Tigris\Telegram\Types\Updates\Update
$updates = $apiWrapper->getUpdates([
    'offset' => $this->offset,
]);

// Process received updates
foreach ($updates as $update) {
    $this->offset = $update->update_id + 1;
    $this->setLastOffset($this->offset);
    $this->processUpdate($update);
}
```

### Handling errors

[](#handling-errors)

By default every mapped method returns `null` value if an error occurs. You can change this behavior by adding *callable* error handler to your ApiWrapper instance.

```
$apiWrapper->setErrorHandler(function (\Exception $e) use ($logger) {
    $logger->log($e);
});
```

### Going further

[](#going-further)

Please feel free to investigate the source code. All the api methods and types are fully documented. Please contact us in the gitter chat channel:

License
-------

[](#license)

MIT

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

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

Total

5

Last Release

3214d ago

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

3.2.2PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1297270?v=4)[Vahid G](/maintainers/lagman)[@lagman](https://github.com/lagman)

---

Top Contributors

[![metalagman](https://avatars.githubusercontent.com/u/1983796?v=4)](https://github.com/metalagman "metalagman (13 commits)")

---

Tags

php7telegram-bot-apiphpapiclientbottelegram

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

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

3.7k7.6M74](/packages/openai-php-laravel)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[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)[borsaco/telegram-bot-api-bundle

A simple wrapper for telegram-bot-api.

5633.0k](/packages/borsaco-telegram-bot-api-bundle)[klev-o/crypto-pay-api

Simple and convenient implementation of the Crypto Pay payment system (@CryptoBot)

205.1k](/packages/klev-o-crypto-pay-api)

PHPackages © 2026

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