PHPackages                             tahrz/simple-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. [HTTP &amp; Networking](/categories/http)
4. /
5. tahrz/simple-telegram-bot

ActiveLibrary[HTTP &amp; Networking](/categories/http)

tahrz/simple-telegram-bot
=========================

Packadge with connection service and simple helpers

2.0.0(2y ago)242082MITPHPPHP ^8.0CI failing

Since May 17Pushed 2y agoCompare

[ Source](https://github.com/tahrz/simple-telegram-bot)[ Packagist](https://packagist.org/packages/tahrz/simple-telegram-bot)[ RSS](/packages/tahrz-simple-telegram-bot/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (1)Dependencies (1)Versions (8)Used By (0)

Simple PHP telegram bot library
===============================

[](#simple-php-telegram-bot-library)

[![simple-telegram-bot](https://camo.githubusercontent.com/e8de7eb7f95458fc36afc91c5cfefd36b0e50107ecb0aadfe3febaae7661e11f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746168727a2f73696d706c652d74656c656772616d2d626f742e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/tahrz/simple-telegram-bot)

This library will help you, to create php telegram bot of any complexity.

> **v 2.0.0**

**Add library to composer:**

```
composer require tahrz/simple-telegram-bot

```

**Add global variables, to config component**

```
define('BOT_TOKEN', '');
define('BASIC_API_URL', 'https://api.telegram.org/bot' . BOT_TOKEN . '/');
define('WEBHOOK_URL', '');
```

#### How to use

[](#how-to-use)

To create an API request, use:

```
// create instance of ConnectionService
$connectionService = new ConnectionService();

// make connection without answer
$connectionService->init('');

// make connection with array answer type
$arrayResult = $connectionService->withArrayResponse('');

// make connection with object anaswer type
$objectResult = $connectionService->withObjectResponse('');
```

> Also, you can use `webhookConfigurationHelper`, witch build under `ConnectionService`, with `getWebhook`, `setWebhook` API methods. Helpers use **ONLY** `CurlConnectionService()`

```
// create instance of WebhookConfigurationHelper
$webhookConfigurationHelper = new WebhookConfigurationHelper($connectionService);

// get webhook info
$setWebhook = $webhookConfigurationHelper->getWebhookInfo();

// set new webhook
$getWebhook = $webhookConfigurationHelper->setWebhook();

// remove webhook
$removeWebhook = $webhookConfigurationHelper->removeWebhook();
```

`setWebhook()` will set a webhook on your `WEBHOOK_URL` url.

> For getting Updates with or without webhook, you can use

```
// create instance of WebhookGetUpdateHelper
$webhookUpdateHelper = new WebhookGetUpdateHelper();

// create instance of GetUpdateHelper
$getUpdateHelper = new GetUpdateHelper($connectionService);

// work only if you add webhook
$updatesWithWebhookAsArray = $webhookUpdateHelper->asArray();
$updatesWithWebhookAsObject = $webhookUpdateHelper->asObject();

// work only without webhook
$updatesWithoutWebhook = $getUpdateHelper->asArray();
$updatesWithoutWebhook = $getUpdateHelper->asObject();
```

You always can choose, what type of data, you need to return, `array` or `object` or even **do not return you any data**.

> For sending messages, you can use a `MessageHelper`

```
// create instance of MessageHelper
$messageHelper = new MessageHelper($connectionService);

// send message without response
$messageHelper->sendWithoutResponse(, '')

// send message with array response type
$messageSendWithArrayResponse = $messageHelper->sendWithArrayResponse(, '')

// send message with object response type
$messageSendWithObjectResponse = $messageHelper->sendWithObjectResponse(, '')
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 96.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 ~271 days

Recently: every ~402 days

Total

7

Last Release

975d ago

Major Versions

1.3.5 → 2.0.02023-10-29

PHP version history (3 changes)1.0.2PHP ^7.1

1.0.3PHP ^7.2

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf2c4f6702921cd95a4a828d61ab247413484a45af75fa08f06a66bf1a13d6fa?d=identicon)[tahrz](/maintainers/tahrz)

---

Top Contributors

[![tahrz](https://avatars.githubusercontent.com/u/38757318?v=4)](https://github.com/tahrz "tahrz (28 commits)")[![ypylypenko](https://avatars.githubusercontent.com/u/19938155?v=4)](https://github.com/ypylypenko "ypylypenko (1 commits)")

---

Tags

curllibraryphp8simple-telegram-bottelegram-botwebhookphpwebhooktelegram bot apiphp-telegram-botsimple telegram bot library

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[renoki-co/laravel-aws-webhooks

Easy webhook handler for Laravel to catch AWS SNS notifications for various services.

73250.0k](/packages/renoki-co-laravel-aws-webhooks)[hannesvdvreken/guzzle-debugbar

A Guzzle middleware that logs requests to debugbar's timeline

76423.5k2](/packages/hannesvdvreken-guzzle-debugbar)[skrepr/teams-connector

A simple PHP package for sending messages to Microsoft Teams

2210.8k1](/packages/skrepr-teams-connector)

PHPackages © 2026

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