PHPackages                             kavalar/telegram\_bot - 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. kavalar/telegram\_bot

ActiveLibrary

kavalar/telegram\_bot
=====================

Telegram Bot Service

0.2(4y ago)0371MITPHPPHP &gt;=7.0.0

Since Aug 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/apuc/telegram_bot)[ Packagist](https://packagist.org/packages/kavalar/telegram_bot)[ RSS](/packages/kavalar-telegram-bot/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (1)

Telegram Bot Service
====================

[](#telegram-bot-service)

Telegram Bot Service

[TelegramBotService](https://github.com/apuc/telegram_bot/blob/master/src/TelegramBotService.php)
=================================================================================================

[](#telegrambotservice)

Methods
-------

[](#methods)

### sendMessageTo($chat\_id, $message)

[](#sendmessagetochat_id-message)

Use this method to send message to given chat.

```
$bot = new TelegramBotService($token);
$result = $bot->sendMessageTo($chat_id, $message);
```

[BotNotificationTemplateProcessor](https://github.com/apuc/telegram_bot/blob/master/src/BotNotificationTemplateProcessor.php)
=============================================================================================================================

[](#botnotificationtemplateprocessor)

Methods
-------

[](#methods-1)

### \_\_construct($templates)

[](#__constructtemplates)

*$templates* is associative array such format

```
[
   'template_name' => "Hello ~name~"
];
```

Where `~name~` is parameter which could be rendered by `renderTemplate` method

### renderTemplate($template\_name, $parameters)

[](#rendertemplatetemplate_name-parameters)

Returns rendered template

`$args` is associative array such format

```
[
   'name' => 'Jhon'
];
```

Throws [NoSuchParameterException](https://github.com/apuc/telegram_bot/blob/master/src/exceptions/NoSuchParameterException.php), [NoSuchTemplateException](https://github.com/apuc/telegram_bot/blob/master/src/exceptions/NoSuchTemplateException.php),

Example
=======

[](#example)

```
$bot = new TelegramBotService($token);

$templates = [
    'example' => "Hello ~name~"
];
$attributes = [
    'name' => 'Jhon'
];

$templateProcessor = new BotNotificationTemplateProcessor($templates);
$message = $templateProcessor->renderTemplate('example', $attributes);

$result = $bot->sendMessageTo($chat_id, $message);
```

Watch full example at [example.php](https://github.com/apuc/telegram_bot/blob/master/examples/example.php)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.9% 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 ~1 days

Total

2

Last Release

1727d ago

PHP version history (2 changes)0.1PHP &gt;=5.3.0

0.2PHP &gt;=7.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6388044?v=4)[kavalar](/maintainers/apuc)[@apuc](https://github.com/apuc)

---

Top Contributors

[![IvanivAnton](https://avatars.githubusercontent.com/u/32462360?v=4)](https://github.com/IvanivAnton "IvanivAnton (10 commits)")[![apuc](https://avatars.githubusercontent.com/u/6388044?v=4)](https://github.com/apuc "apuc (1 commits)")

### Embed Badge

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

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

###  Alternatives

[boshurik/telegram-bot-bundle

Telegram bot bundle

80114.0k](/packages/boshurik-telegram-bot-bundle)[sonko-dmitry/yii2-telegram-bot-api

Telegram bot api component for Yii2

2132.2k](/packages/sonko-dmitry-yii2-telegram-bot-api)[he110/communication-tools

Tools set for messenger managing. Allows you to send any content via Telegram, Viber, WhatsApp, VK and so on

1710.2k](/packages/he110-communication-tools)[micromagicman/laravel-telegram-webapp

Laravel middleware for Telegram WebApp data validation

263.9k](/packages/micromagicman-laravel-telegram-webapp)

PHPackages © 2026

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