PHPackages                             mateodioev/tgbot - 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. mateodioev/tgbot

ActiveLibrary[API Development](/categories/api)

mateodioev/tgbot
================

Libreria para interactuar con los metodos de la api de bots de telegram

v4.7.7(3mo ago)4449↓100%21MITPHPPHP &gt;=8.2

Since Jun 16Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/Mateodioev/telegram-bot-api)[ Packagist](https://packagist.org/packages/mateodioev/tgbot)[ RSS](/packages/mateodioev-tgbot/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (80)Used By (1)

Telegram bot api
================

[](#telegram-bot-api)

Install
-------

[](#install)

```
composer require mateodioev/tgbot
```

```
git clone https://github.com/Mateodioev/tgbot
```

First step
----------

[](#first-step)

```
require __DIR__ . 'path/to/vendor/autoload.php';
```

Create new Api instance
-----------------------

[](#create-new-api-instance)

```
use Mateodioev\Bots\Telegram\Api;

$api = new Api($bot_token);
```

Send method to telegram api
---------------------------

[](#send-method-to-telegram-api)

```
use Mateodioev\Bots\Telegram\Types\Message;

$message = $api->sendMessage('chat_id', 'Text', $others_params);

var_dump($message->get());
var_dump($message instanceof Message::class);
```

Enable async mode
-----------------

[](#enable-async-mode)

Note: This use `amphp/http-client`

```
$api->setAsync(true);
```

Create new telegram types
-------------------------

[](#create-new-telegram-types)

```
use Mateodioev\Bots\Telegram\Types\baseType;

class MyCustomType extends baseType
{
    protected array $fields = [
        'field1' => 'valueType',
        'id'     => 'integer', // only accept integer values
        'user'   => User::class, // only accept arrays or instances of the User class
    ];
}
```

*Create new instance*

```
// from array
$customType = MyCustomType::createFromArray(['field1' => 'Type', 'id' => 1111, 'user' => $user]);
// From stdClass
$customType = MyCustomType::create((object) ['field1' => 'Type', 'id' => 1111, 'user' => $user]);
// Create from constructor
$customType = new MyCustomType(field1: 'Type', id: 1111, user: $user); // maybe this cause linter errors
```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance83

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 99% 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 ~17 days

Recently: every ~39 days

Total

78

Last Release

116d ago

Major Versions

v1.2.2 → v2.02022-09-30

v2.0.1 → v3.0-beta2022-11-28

v3.x-dev → v4.0.0-beta2023-08-14

PHP version history (2 changes)v3.0-betaPHP &gt;=8.1

v3.5.2PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/77e3f2a5c4e98caf6e911141af3d18235c658500e8b9e0a95ec251a803a39676?d=identicon)[Mateodioev](/maintainers/Mateodioev)

---

Top Contributors

[![Mateodioev](https://avatars.githubusercontent.com/u/68271130?v=4)](https://github.com/Mateodioev "Mateodioev (98 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

phptelegramtelegram-bottelegram-bot-apiapibottelegramtelegram bot api

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/mateodioev-tgbot/health.svg)

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

###  Alternatives

[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[longman/telegram-bot

PHP Telegram bot

4.0k2.1M50](/packages/longman-telegram-bot)[borsaco/telegram-bot-api-bundle

A simple wrapper for telegram-bot-api.

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

PHPackages © 2026

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