PHPackages                             estaheri/easytel - 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. estaheri/easytel

ActiveLibrary[API Development](/categories/api)

estaheri/easytel
================

An easy to use php library for using telegram bot api

1.0.3(1y ago)030MITPHPPHP 8.2

Since Jun 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/es-taheri/EasyTel)[ Packagist](https://packagist.org/packages/estaheri/easytel)[ Docs](https://github.com/es-taheri/easytel)[ RSS](/packages/estaheri-easytel/feed)WikiDiscussions PHP-MASTER Synced today

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

 PHP Telegram Bot Library

 [![PHP Telegram Bot logo](https://repository-images.githubusercontent.com/38116958/144ea600-fa7f-11e9-80c7-df2996317cee)](https://repository-images.githubusercontent.com/38116958/144ea600-fa7f-11e9-80c7-df2996317cee)

=======================================================================================================================================================================================================================================================

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

An easy to use php library for using [telegram bot api](https://core.telegram.org/bots/api)

[![API Version](https://camo.githubusercontent.com/a61fc21947fcd313f5d40f86201e8efe0e8065a039e58e0fd0db8160c764e82e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f426f742532304150492d392e352532302532384f63746f626572253230323032342532392d3332613264612e737667)](https://core.telegram.org/bots/api-changelog#october-31-2024)[![Join Telegram channel](https://camo.githubusercontent.com/c8bb1ac13fb5451404f5025eee47d8d9a48b1282dbcf91d2484e56822367f21d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74656c656772616d2d406561737974656c2d3634363539642e737667)](https://t.me/EasyTel_lib)

[![Latest Stable Version](https://camo.githubusercontent.com/b3d7db2a7b2f0351e9a1f8444fbe9228063860a9b88d355404f46dd4bc38c92e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f6e676d616e2f74656c656772616d2d626f742e737667)](https://packagist.org/packages/estaheri/easytel)[![Minimum PHP Version](https://camo.githubusercontent.com/9a774c0c07eab970c982739c2de6cb8b43e86dd833b3cb89ab9393a10a85550e/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/afe3363e157bb1729508e8c77b971df33d554cd37ec701989504d95da172ce23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f65737461686572692f6561737974656c2e737667)](https://github.com/es-taheri/easytel/LICENSE)

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Quick Usage](#quick-usage)
- [Instructions](#instructions)
    - [Require in project](#require-in-project)
- [Webhook installation](#webhook-installation)
    - [Self Signed Certificate](#self-signed-certificate)
    - [Unset Webhook](#unset-webhook)
- [Updates](#Updates)
- [Types](#types)
- [Methods](#methods)

Introduction
------------

[](#introduction)

This is a fully php classes structured and easy to use library for communicating with telegram bot api and managing your bots. 🤖
As it's just a library you can use it next to any framework for example Laravel, Codeigniter,... 🌐
Every Methods &amp; Types has it's own description same as official telegram bot api document using standard phpdoc. 📄
Unlike other library this library full support object oriented structured any Methods and Types available on [Telegram Bot API](https://core.telegram.org/bots/api) which means you can get full IDE auto complete/code suggestion when using library. (So feel free to use `Ctl+Space` 😉)
All requests to telegram will be sent async through GuzzleHttp ⚡

Quick Usage
-----------

[](#quick-usage)

- Require library in your project 📁

```
composer require estaheri/easytel

```

- Require composer autoload in your php code ⚓

```
require_once __DIR__.'/vendor/autoload.php';
```

- Instantiating `Telegram` class📡

```
use EasyTel\Telegram;
$tg = new Telegram($bot_token,$updates,$botapi_url,$request_method,$guzzle_client_options,$output);
#---------------------------------------------------------------------------------
$bot_token = '123456789:xxxxxxxxxxxxxxxx'; // Telegram bot token (You can get it from @botfather)
$updates = file_get_contents('php://input'); // (Optional) Pure telegram webhook updates you can use any method you want to getting updates
$botapi_url = 'https://api.telegram.org'; // (Optional) Your bot api url https://core.telegram.org/bots/api#using-a-local-bot-api-server (Mostly use telegram official server)
$request_method = 'POST'; // (Optional) Request method of http requests sends to telegram bot api url, Can be POST or GET
$guzzle_client_options = ['verify' => false]; // (Optional) Your custom guzzlehttp client options https://docs.guzzlephp.org/en/stable/request-options.html
$output = Telegram::OUTPUT_ARRAY; // (Optional) Output result of your requests send and received by telegram when using methods
```

- Now you can use telegram request methods or telegram webhook update✅

```
use \EasyTel\Types\ReplyParameters;
# ------------------------- Methods -------------------------
$methods = $tg->methods; // Access to all telegram methods
$methods->sendMessage($chat_id, $text)
    ->parse_mode('markdown')
    ->reply_parameters(ReplyParameters::make($message_id, $chat_id));
# ------------------------- Updates -------------------------
$updates = $tg->updates; // Access to all webhook updates received
// IDE will suggest every property you see here because of full structured properties from their classes
$message = $updates->message;
$chat_id = $message->chat->id;
$message_id = $message->message_id;
$text = $message->text;
$reply_text = $message->reply_to_message->text;
```

Instructions
------------

[](#instructions)

Here we explained step by step how to use this library and working with telegram bots.

### Install composer

[](#install-composer)

Note

If composer with php 8.2 installed on your system ignore this step

Linux based operating systems installation :

```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'c8b085408188070d5f52bcfe4ecfbee5f727afa458b2573b8eaaf77b3419b0bf2768dc67c86944da1544f06fa544fd47') { echo 'Installer verified'.PHP_EOL; } else { echo 'Installer corrupt'.PHP_EOL; unlink('composer-setup.php'); exit(1); }"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```

Windows based operating systems installation :\\

> Download `Composer-Setup.exe` from link bellow than run it and follow installation steps.
>

### Require in project

[](#require-in-project)

Open terminal in your project folder and run this composer command :

```
composer require estaheri/easytel
```

Than include composer `autoload.php` file to load EasyTel library in your codes :

```
require_once __DIR__.'/vendor/autoload.php';
```

### Getting Updates

[](#getting-updates)

Now you have to use a way for getting your bot updates from telegram.
Telegram gives us two options `getUpdates` method or `Webhook`.

- #### Webhook (Recommended)

    [](#webhook-recommended)

    In this method you set a url to your webhook handler route or php file than telegram will send you any updates of messages or callback queries to it.
    webhook.php : ```
    $updates = file_get_contents('php://input');
    if(!empty($updates)) {
       $tg = new Telegram($bot_token, $updates);
       //...
    } else {
       http_response_code(400);
       echo 'Bad Request!';
    }
    ```

    Than set webhook to your webhook address : ```
    $tg = new Telegram($bot_token);
    $tg->webhook->setWebhook('https://example.com/webhook.php');
    ```
- #### GetUpdates

    [](#getupdates)

    In this method you don't need to set webhook or webhook file just request to telegram for getting updates using getUpdates method : ```
    $tg = new Telegram($bot_token);
    $tg->webhook->setWebhook('https://example.com/webhook.php');
    $result = $tg->methods->getUpdates()->_result();
    if ($result->success && $result->ok) {
       echo "Success";
    } else {
       $error = $result->ok ? $result->response()->description : $result->fail()->error;
       echo "Error: $error";
    }
    ```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance64

Regular maintenance activity

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Total

4

Last Release

604d ago

### Community

Maintainers

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

---

Top Contributors

[![es-taheri](https://avatars.githubusercontent.com/u/70095105?v=4)](https://github.com/es-taheri "es-taheri (34 commits)")

---

Tags

telegramtelegram bot apitelegram bot api sdkTelegram bot libraryeasy telegram sdkeasy to use telegram

### Embed Badge

![Health badge](/badges/estaheri-easytel/health.svg)

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

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.9M94](/packages/irazasyed-telegram-bot-sdk)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[telegram-bot-sdk/telegram-bot-sdk

The Telegram Bot API PHP SDK

32981.6k](/packages/telegram-bot-sdk-telegram-bot-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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