PHPackages                             whitebock/telegramapi - 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. whitebock/telegramapi

AbandonedArchivedLibrary

whitebock/telegramapi
=====================

A PHP Wrapper for the Telegram Bot Api

1.3.0(8y ago)633MITPHP

Since Jan 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Whitebock/TelegramApi)[ Packagist](https://packagist.org/packages/whitebock/telegramapi)[ RSS](/packages/whitebock-telegramapi/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (3)Dependencies (2)Versions (2)Used By (0)

Telegram BotApi
===============

[](#telegram-botapi)

A PHP Wrapper for the [Telegram Bot Api](https://core.telegram.org/bots/api)
Currently being refactored, see the latest [releases](https://github.com/Whitebock/TelegramBot-ApiWrapper/releases) for a stable version.

[![Donate on PayPal](https://camo.githubusercontent.com/d47cdb766a100070d38a702d9c7760ccc8052063484e1478a26bcd16680d33af/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d70617970616c2d626c75652e737667)](https://www.paypal.me/SvenDrewniok)[![Using PHP Version 7.1](https://camo.githubusercontent.com/cab4390badc6d9ebb66d47bf497f9a77686a677cb75e957a5f91af14f316cd27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e312d79656c6c6f772e737667)](https://camo.githubusercontent.com/cab4390badc6d9ebb66d47bf497f9a77686a677cb75e957a5f91af14f316cd27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e312d79656c6c6f772e737667)

- [Todo List](#todo)
- [Installation](#installation)
    - [Composer](#composer)
    - [Manual](#manual)
- [Usage / Demo Bot](#demo)
- [Changelog](#changelog)
    - [Unreleased](#unreleased)
    - [Latest Version](#130)
        - [Download](https://github.com/Whitebock/TelegramApi/releases/tag/1.3.0)

Todo
----

[](#todo)

- Bot Api 3.2
- Complete send functions
- Add group administration
- Inline mode
- Games

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

[](#installation)

### Composer

[](#composer)

When using [composer](https://getcomposer.org/) you can just require this library: `composer require whitebock/telegramapi`

### Manual

[](#manual)

Manual installation without composer is being worked on.

Demo
----

[](#demo)

Set your token from [@BotFather](https://t.me/BotFather) in the constructor.

```
use Whitebock\TelegramApi\Bot;
use Whitebock\TelegramApi\Photo;

$bot = new Bot('');

$me = $bot->getMe();
echo $me->getUsername().PHP_EOL;

$updates = $bot->getUpdates();
foreach ($updates as $update) {
    $chat = $update->getMessage()->getChat();
    echo $chat->getUsername().': '.$update->getMessage()->getText().PHP_EOL;
    $bot->sendMessage($chat, 'Hello World');
    $bot->sendChatAction($chat, 'upload_photo');
    $bot->sendMedia($chat, Photo::fromFile('test/bird.jpg'));
    $bot->sendLocation($chat, 52.520038, 13.404799);
    $bot->sendContact($chat,'+49123456789', 'John');
    $bot->sendVenue($chat, 51.496797, 7.455505, 'Westfalenhallen', 'Rheinlanddamm 200, 44139 Dortmund');
}
```

Changelog
---------

[](#changelog)

All notable changes to this project will be documented here.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

### \[Unreleased\]

[](#unreleased)

### \[1.3.0\]

[](#130)

### Added

[](#added)

- Composer files
- Namespaces
- Getters &amp; Fluent Setters
- Method: callApi
- Method: getUpdate
- Method: sendMedia
- Typehinting
- Added StickerSet.php in new /Sticker/ Namespace
- Added MaskPosition.php in new /Sticker/ Namespace
- Added ApiException.php in new /exception/ Namespace
- Copyright Header, better documentation

### Changed

[](#changed)

- Switched from private to protected variables
- Changed deserialization from parseClass to symfony

### Removed

[](#removed)

- PhpDoc version annotation
- PhpDoc package annotation
- Method: sendPOSTRequest
- Replaced sendPhoto
- Replaced sendAudio
- Replaced sendDocument
- Replaced sendSticker
- Replaced sendVideo
- Replaced sendVoice

### \[1.2.0\]

[](#120)

#### Added

[](#added-1)

- class.chatmember.php
- class.responseparameters.php

#### Changed

[](#changed-1)

- full phpDoc comments

#### Removed

[](#removed-1)

- closing php tag in pure php files

### \[1.1.0\]

[](#110)

#### Added

[](#added-2)

- class.bot.php
    - getUserProfilePhotos
    - getFile
- class.file.php
    - download
    - downloadTo

### \[1.0.0\]

[](#100)

#### Added

[](#added-3)

- support for api 2.0
- all send functions

### \[0.9.0\]

[](#090)

#### Added

[](#added-4)

- universal constructor
- class.bot.php
    - sendSticker

### \[0.8.0\]

[](#080)

#### Added

[](#added-5)

- phpdoc comments
- class.bot.php
    - serializePOSTData
    - sendPhoto
    - sendChatAction

#### Changed

[](#changed-2)

- inc.init.php renamed to api.telegram.php
- class.bot.php
    - sendMessage

### \[0.7.0\]

[](#070)

#### Added

[](#added-6)

- class.bot.php
    - setWebhook
    - sendMessage

#### Changed

[](#changed-3)

- inc.init.php
    - parseClass

### \[0.6.0\]

[](#060)

#### Added

[](#added-7)

- inc.init.php
- class.bot.php
    - sendPostRequest
    - getMe
    - getUpdates

### \[0.5.0\]

[](#050)

#### Added

[](#added-8)

- class.bot.php
- class.message.php

### \[0.4.0\]

[](#040)

#### Added

[](#added-9)

- class.audio.php
- class.chat.php
- class.contact.php
- class.document.php
- class.file.php
- class.forcereply.php
- class.location.php
- class.message.php
- class.photosize.php
- class.replykeyboardhide.php
- class.replykeyboardmarkup.php
- class.sticker.php
- class.update.php
- class.user.php
- class.userprofilephotos.php
- class.video.php
- class.voice.php

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Unknown

Total

1

Last Release

3042d ago

### Community

Maintainers

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

---

Tags

composerphp-wrappertelegram

### Embed Badge

![Health badge](/badges/whitebock-telegramapi/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k48.1M236](/packages/api-platform-core)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[symfony/serializer-pack

A pack for the Symfony serializer

1.1k28.2M221](/packages/symfony-serializer-pack)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

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